Browse Source

invert surface.NdotV contribution for brdf texture lookup in keeping with authoring tool outputs

AzaezelX 6 years ago
parent
commit
6326147fca

+ 1 - 1
Templates/Full/game/shaders/common/lighting.hlsl

@@ -398,7 +398,7 @@ float4 computeForwardProbes(Surface surface,
 
 
    //apply brdf
    //apply brdf
    //Do it once to save on texture samples
    //Do it once to save on texture samples
-   float2 brdf = TORQUE_TEX2DLOD(BRDFTexture,float4(surface.roughness, surface.NdotV, 0.0, 0.0)).xy;
+   float2 brdf = TORQUE_TEX2DLOD(BRDFTexture,float4(surface.roughness, 1.0-surface.NdotV, 0.0, 0.0)).xy;
    specular *= brdf.x * F + brdf.y;
    specular *= brdf.x * F + brdf.y;
 
 
    //final diffuse color
    //final diffuse color

+ 1 - 1
Templates/Full/game/shaders/common/lighting/advanced/reflectionProbeArrayP.hlsl

@@ -191,7 +191,7 @@ float4 main(PFXVertToPix IN) : SV_TARGET
 
 
    //apply brdf
    //apply brdf
    //Do it once to save on texture samples
    //Do it once to save on texture samples
-   float2 brdf = TORQUE_TEX2DLOD(BRDFTexture, float4(surface.roughness, surface.NdotV, 0.0, 0.0)).xy;
+   float2 brdf = TORQUE_TEX2DLOD(BRDFTexture, float4(surface.roughness, 1.0-surface.NdotV, 0.0, 0.0)).xy;
    specular *= brdf.x * F + brdf.y;
    specular *= brdf.x * F + brdf.y;
 
 
    //final diffuse color
    //final diffuse color