shader adjustments

This commit is contained in:
2026-03-15 22:37:08 +01:00
parent cd0f6d038f
commit 9109baad18
10 changed files with 172 additions and 105 deletions
+8 -8
View File
@@ -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());
}