mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 21:10:42 +00:00
Use abs instead of saturate to do double-sided lighting on meshes
* This means we don't need to care about winding making normals inside out, and in this case it's not a bad thing to light backfaces I think.
This commit is contained in:
@@ -50,7 +50,7 @@ void main(void)
|
||||
{
|
||||
vec3 lightDir = normalize(vec3(0, -0.3f, -1));
|
||||
|
||||
color_out = vec4(RENDERDOC_GenericFS_Color.xyz*clamp(dot(lightDir, IN.norm.xyz), 0.0f, 1.0f), 1);
|
||||
color_out = vec4(RENDERDOC_GenericFS_Color.xyz*abs(dot(lightDir, IN.norm.xyz)), 1);
|
||||
}
|
||||
else //if(type == MESHDISPLAY_SOLID)
|
||||
{
|
||||
|
||||
@@ -253,7 +253,7 @@ float4 RENDERDOC_MeshPS(wireframeV2F IN) : SV_Target0
|
||||
{
|
||||
float3 lightDir = normalize(float3(0, -0.3f, -1));
|
||||
|
||||
return float4(WireframeColour.xyz*saturate(dot(lightDir, IN.norm)), 1);
|
||||
return float4(WireframeColour.xyz*abs(dot(lightDir, IN.norm)), 1);
|
||||
}
|
||||
else //if(type == MESHDISPLAY_SOLID)
|
||||
return float4(WireframeColour.xyz, 1);
|
||||
|
||||
Reference in New Issue
Block a user