Fix shader warning

This commit is contained in:
2025-11-19 23:29:28 -08:00
parent e2aaef9b88
commit 032f698c7b
2 changed files with 4 additions and 8 deletions
+2 -5
View File
@@ -329,7 +329,7 @@ float3 GetInscatteredLight(AtmosphericFogData atmosphericFog, in float3 viewPosi
if (intersectAtmosphere(viewPosition, viewDir, offset, maxPathLength)) if (intersectAtmosphere(viewPosition, viewDir, offset, maxPathLength))
{ {
return float3(offset / 10, 0, 0); return float3(offset / 10, 0, 0);
#if 0
float pathLength = distance(viewPosition, surfacePos); float pathLength = distance(viewPosition, surfacePos);
//return pathLength.xxx; //return pathLength.xxx;
@@ -413,6 +413,7 @@ float3 GetInscatteredLight(AtmosphericFogData atmosphericFog, in float3 viewPosi
float sunIntensity = 10; float sunIntensity = 10;
inscatteredLight *= sunIntensity; inscatteredLight *= sunIntensity;
} }
#endif
} }
return inscatteredLight; return inscatteredLight;
@@ -420,8 +421,6 @@ float3 GetInscatteredLight(AtmosphericFogData atmosphericFog, in float3 viewPosi
float4 GetAtmosphericFog(AtmosphericFogData atmosphericFog, float viewFar, float3 viewPosition, float3 viewVector, float sceneDepth, float3 sceneColor) float4 GetAtmosphericFog(AtmosphericFogData atmosphericFog, float viewFar, float3 viewPosition, float3 viewVector, float sceneDepth, float3 sceneColor)
{ {
float4 result = float4(1, 0, 0, 1);
#if 0 #if 0
float scale = 0.00001f * atmosphericFog.AtmosphericFogDistanceScale;// convert cm to km float scale = 0.00001f * atmosphericFog.AtmosphericFogDistanceScale;// convert cm to km
@@ -536,8 +535,6 @@ float4 GetAtmosphericFog(AtmosphericFogData atmosphericFog, float viewFar, float
//return float4(sun + groundColor + inscatterColor, 1); //return float4(sun + groundColor + inscatterColor, 1);
#endif #endif
return result;
} }
float4 GetAtmosphericFog(AtmosphericFogData atmosphericFog, float viewFar, float3 worldPosition, float3 cameraPosition) float4 GetAtmosphericFog(AtmosphericFogData atmosphericFog, float viewFar, float3 worldPosition, float3 cameraPosition)
+2 -3
View File
@@ -227,7 +227,8 @@ ShadowSample SampleDirectionalLightShadowCascade(LightData light, Buffer<float4>
// Increase the sharpness for higher cascades to match the filter radius // Increase the sharpness for higher cascades to match the filter radius
const float SharpnessScale[MaxNumCascades] = { 1.0f, 1.5f, 3.0f, 3.5f }; const float SharpnessScale[MaxNumCascades] = { 1.0f, 1.5f, 3.0f, 3.5f };
shadow.Sharpness *= SharpnessScale[cascadeIndex]; shadow.Sharpness *= SharpnessScale[cascadeIndex];
result.TransmissionShadow = 1;
#if defined(USE_GBUFFER_CUSTOM_DATA) #if defined(USE_GBUFFER_CUSTOM_DATA)
// Subsurface shadowing // Subsurface shadowing
BRANCH BRANCH
@@ -239,8 +240,6 @@ ShadowSample SampleDirectionalLightShadowCascade(LightData light, Buffer<float4>
result.TransmissionShadow = CalculateSubsurfaceOcclusion(opacity, shadowPosition.z, shadowMapDepth); result.TransmissionShadow = CalculateSubsurfaceOcclusion(opacity, shadowPosition.z, shadowMapDepth);
result.TransmissionShadow = PostProcessShadow(shadow, result.TransmissionShadow); result.TransmissionShadow = PostProcessShadow(shadow, result.TransmissionShadow);
} }
#else
result.TransmissionShadow = 1;
#endif #endif
result.SurfaceShadow = PostProcessShadow(shadow, result.SurfaceShadow); result.SurfaceShadow = PostProcessShadow(shadow, result.SurfaceShadow);