further wipwork on the pointlight conversion. filled CreateSurfaceToLight out in a theoretically correct manner (spoiler, not actually correct)

This commit is contained in:
Azaezel 2018-11-06 20:07:09 -06:00
parent b8fb90ab94
commit 452c35f11c

View file

@ -180,7 +180,8 @@ LightTargetOutput main( ConvexConnectP IN )
float nDotL = dot( lightVec, normDepth.xyz ); float nDotL = dot( lightVec, normDepth.xyz );
//DB_CLIP( nDotL < 0 ); //DB_CLIP( nDotL < 0 );
//create surface to light //create surface to light
SurfaceToLight surfaceToLight = CreateSurfaceToLight(surface, dot( lightVec, normDepth.xyz )); float3 wsLightDir = mul(cameraToWorld, float4(lightVec,0)).xyz;
SurfaceToLight surfaceToLight = CreateSurfaceToLight(surface, wsLightDir);//lightPosition - viewSpacePos);
#ifdef NO_SHADOW #ifdef NO_SHADOW
@ -206,7 +207,7 @@ LightTargetOutput main( ConvexConnectP IN )
shadowCoord, shadowCoord,
shadowSoftness, shadowSoftness,
distToLight, distToLight,
nDotL, surfaceToLight.NdotL,
lightParams.y); lightParams.y);
// Dynamic // Dynamic
@ -216,7 +217,7 @@ LightTargetOutput main( ConvexConnectP IN )
dynamicShadowCoord, dynamicShadowCoord,
shadowSoftness, shadowSoftness,
distToLight, distToLight,
nDotL, surfaceToLight.NdotL,
lightParams.y); lightParams.y);
float shadowed = min(static_shadowed, dynamic_shadowed); float shadowed = min(static_shadowed, dynamic_shadowed);