shader adjustments
This commit is contained in:
@@ -65,12 +65,12 @@ float4 fragmentMain(in FragmentParameter params) : SV_Target
|
||||
float shadowFactor = 0.0f;
|
||||
int count = 0;
|
||||
int range = 1;
|
||||
//for (int x = -range; x <= range; ++x) {
|
||||
// for (int y = -range; y <= range; ++y) {
|
||||
for (int x = -range; x <= range; ++x) {
|
||||
for (int y = -range; y <= range; ++y) {
|
||||
float shadow = 1.0f;
|
||||
if (currentDepth > 0.0 && currentDepth < 1.0)
|
||||
{
|
||||
float dist = pShadowMapping.shadowMaps[cascadeIndex].Sample(pShadowMapping.shadowSampler, float3(shadowCoord.xy, i)).r;
|
||||
float dist = pShadowMapping.shadowMaps[cascadeIndex].Sample(pShadowMapping.shadowSampler, float3(shadowCoord.xy + float2(dx * x, dy * y), i)).r;
|
||||
if (shadowCoord.w > 0 && currentDepth < dist)
|
||||
{
|
||||
shadow = 0;
|
||||
@@ -78,16 +78,16 @@ float4 fragmentMain(in FragmentParameter params) : SV_Target
|
||||
}
|
||||
shadowFactor += shadow;
|
||||
count++;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
result = (shadowFactor / count) * pLightEnv.directionalLights[i].illuminate(lightingParams, brdf);
|
||||
}
|
||||
for (uint i = 0; i < pLightEnv.numPointLights; ++i)
|
||||
{
|
||||
//uint lightIndex = pLightCullingData.lightIndexList[startOffset + i];
|
||||
//result += pLightEnv.pointLights[i].illuminate(lightingParams, brdf);
|
||||
uint lightIndex = pLightCullingData.lightIndexList[startOffset + i];
|
||||
result += pLightEnv.pointLights[lightIndex].illuminate(lightingParams, brdf);
|
||||
}
|
||||
//result += brdf.evaluateAmbient(lightingParams.viewDir_WS);
|
||||
result += brdf.evaluateAmbient(lightingParams.viewDir_WS);
|
||||
return float4(result, brdf.getAlpha());
|
||||
}
|
||||
Reference in New Issue
Block a user