mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-28 11:03:49 +00:00
doublesided material renderfix
as per the OG writeup, need to apply horizon trick strictly to the specular component
This commit is contained in:
parent
e90419ab7f
commit
1f7d06542e
4 changed files with 10 additions and 10 deletions
|
|
@ -496,9 +496,9 @@ vec4 computeForwardProbes(Surface surface,
|
|||
float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
|
||||
horizon *= horizon;
|
||||
#if CAPTURING == 1
|
||||
return vec4(mix(surface.baseColor.rgb,(irradiance + specular) * horizon,surface.metalness/2),0);
|
||||
return vec4(mix(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0);
|
||||
#else
|
||||
return vec4((irradiance + specular) * horizon, 0);//alpha writes disabled
|
||||
return vec4((irradiance + specular* horizon) , 0);//alpha writes disabled
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -657,5 +657,5 @@ vec4 debugVizForwardProbes(Surface surface,
|
|||
float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
|
||||
horizon *= horizon;
|
||||
|
||||
return vec4((irradiance + specular) * horizon, 0);//alpha writes disabled
|
||||
return vec4((irradiance + specular* horizon) , 0);//alpha writes disabled
|
||||
}
|
||||
|
|
|
|||
|
|
@ -501,9 +501,9 @@ float4 computeForwardProbes(Surface surface,
|
|||
float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
|
||||
horizon *= horizon;
|
||||
#if CAPTURING == 1
|
||||
return float4(lerp(surface.baseColor.rgb,(irradiance + specular) * horizon,surface.metalness/2),0);
|
||||
return float4(lerp(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0);
|
||||
#else
|
||||
return float4((irradiance + specular) * horizon, 0);//alpha writes disabled
|
||||
return float4((irradiance + specular* horizon) , 0);//alpha writes disabled
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -662,5 +662,5 @@ float4 debugVizForwardProbes(Surface surface,
|
|||
float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
|
||||
horizon *= horizon;
|
||||
|
||||
return float4((irradiance + specular) * horizon, 0);//alpha writes disabled
|
||||
return float4((irradiance + specular* horizon) , 0);//alpha writes disabled
|
||||
}
|
||||
|
|
@ -200,8 +200,8 @@ void main()
|
|||
float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
|
||||
horizon *= horizon;
|
||||
#if CAPTURING == 1
|
||||
OUT_col = vec4(mix(surface.baseColor.rgb,(irradiance + specular) * horizon,surface.metalness/2),0);
|
||||
OUT_col = vec4(mix(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0);
|
||||
#else
|
||||
OUT_col = vec4((irradiance + specular) * horizon, 0);//alpha writes disabled
|
||||
OUT_col = vec4((irradiance + specular* horizon) , 0);//alpha writes disabled
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,8 +188,8 @@ float4 main(PFXVertToPix IN) : SV_TARGET
|
|||
float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
|
||||
horizon *= horizon;
|
||||
#if CAPTURING == 1
|
||||
return float4(lerp(surface.baseColor.rgb,(irradiance + specular) * horizon,surface.metalness/2),0);
|
||||
return float4(lerp(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0);
|
||||
#else
|
||||
return float4((irradiance + specular) * horizon, 0);//alpha writes disabled
|
||||
return result = float4((irradiance + specular* horizon) , 0);//alpha writes disabled
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue