How to get rid of shading?
Moderators: ObscureMemories, Runa, Love2Raid
-
- Posts: 1
- Joined: Wed Jun 06, 2018 9:53 pm
- Custom Rank: Veteran Page Scroller
How to get rid of shading?
when the written shader XL_detailShadlessOutline is chosen, the model always has one level of shade. Is there a way I can edit the .fx file so that the model is rendered flat without any shading (like when render group is set to 10 in material editor) while retaining the outlines?
Re: How to get rid of shading?
Sure, you can edit the .fx file so that the model is rendered flat without any shading.DemiMaximoff wrote:when the written shader XL_detailShadlessOutline is chosen, the model always has one level of shade. Is there a way I can edit the .fx file so that the model is rendered flat without any shading (like when render group is set to 10 in material editor) while retaining the outlines?
Just comment (using //) the 3 lines that produce the "one level of shade".
Code: Select all
float4 XL_PS(BasicVertexShaderOutput input) : COLOR0
{
float4 diffuseColor;
if (!AlphaPass) {
diffuseColor = GetDiffuseColor(input.TexCoord);
diffuseColor *= input.Color;
float phongShadingFactor1 = CalcPhongShadingFactors_1(input.NormalWorld);
// if (phongShadingFactor1 < 0.1) {
// diffuseColor.rgb *= 0.7;
// }
} else {
diffuseColor = tex2D(DiffuseTextureSampler, input.TexCoord);
diffuseColor.rgb = 1;
}
return saturate(diffuseColor);
}
Or extend the .fx file with your new technique
Code: Select all
float4 DemiMaximoff_PS(BasicVertexShaderOutput input) : COLOR0
{
float4 diffuseColor;
if (!AlphaPass) {
diffuseColor = GetDiffuseColor(input.TexCoord);
diffuseColor *= input.Color;
float phongShadingFactor1 = CalcPhongShadingFactors_1(input.NormalWorld);
//if (phongShadingFactor1 < 0.1) {
// diffuseColor.rgb *= 0.7;
//}
} else {
diffuseColor = tex2D(DiffuseTextureSampler, input.TexCoord);
diffuseColor.rgb = 1;
}
return saturate(diffuseColor);
}
technique DemiMaximoff
{
pass P0
{
VertexShader = compile vs_2_0 BasicOutlineVS();
PixelShader = compile ps_2_0 BlackPS_2();
CullMode = CW;
}
pass P1
{
VertexShader = compile vs_2_0 BasicVS();
PixelShader = compile ps_2_0 DemiMaximoff_PS();
CullMode = CCW;
}
}
-
- Posts: 12
- Joined: Sat Mar 14, 2020 7:39 am
Re: How to get rid of shading?
I usually go and change the lighting parameters mostly, should be easy.