shader nan fixes

This commit is contained in:
Turánszki János
2022-10-08 17:43:08 +02:00
parent dd553e1dde
commit cde72786e7
7 changed files with 9 additions and 5 deletions
@@ -8,5 +8,6 @@ float4 main(PixelInput input) : SV_TARGET
{
float3 normal = normalize(input.nor);
float4 color = float4(GetDynamicSkyColor(normal), 1);
color = clamp(color, 0, 65000);
return float4(color.rgb,1);
}
@@ -8,6 +8,7 @@ TextureCube<float4> texture_sky : register(t0);
float4 main(PixelInput input) : SV_TARGET
{
float3 normal = normalize(input.nor);
float3 sky = DEGAMMA(texture_sky.SampleLevel(sampler_linear_clamp, normal, 0).rgb);
return float4(sky, 1);
float3 color = DEGAMMA_SKY(texture_sky.SampleLevel(sampler_linear_clamp, normal, 0).rgb);
color = clamp(color, 0, 65000);
return float4(color, 1);
}
+1 -1
View File
@@ -1441,7 +1441,7 @@ float4 main(PixelInput input, in bool is_frontface : SV_IsFrontFace) : SV_Target
#endif // OBJECTSHADER_USE_POSITION3D
color = max(0, color);
color = clamp(color, 0, 65000);
// end point:
+1
View File
@@ -10,5 +10,6 @@ float4 main(float4 pos : SV_POSITION, float2 clipspace : TEXCOORD) : SV_TARGET
float4 color = float4(GetDynamicSkyColor(V), 1);
color = clamp(color, 0, 65000);
return color;
}
+1
View File
@@ -13,6 +13,7 @@ float4 main(float4 pos : SV_POSITION, float2 clipspace : TEXCOORD) : SV_TARGET
float4 pos2DPrev = mul(GetCamera().previous_view_projection, float4(unprojected.xyz, 1));
float2 velocity = ((pos2DPrev.xy / pos2DPrev.w - GetCamera().temporalaa_jitter_prev) - (clipspace - GetCamera().temporalaa_jitter)) * float2(0.5f, -0.5f);
color = clamp(color, 0, 65000);
return color;
}
+1 -1
View File
@@ -10,5 +10,5 @@ float4 main(float4 pos : SV_POSITION, float2 clipspace : TEXCOORD) : SV_TARGET
const float3 origin = GetCamera().position;
const float3 direction = normalize(unprojected.xyz - origin);
return float4(GetDynamicSkyColor(direction, true, true, true), 1);
return float4(clamp(GetDynamicSkyColor(direction, true, true, true), 0, 65000), 1);
}
+1 -1
View File
@@ -114,7 +114,7 @@ void main(uint Gid : SV_GroupID, uint groupIndex : SV_GroupIndex)
ApplyFog(surface.hit_depth, GetCamera().position, surface.V, color);
color = max(0, color);
color = clamp(color, 0, 65000);
output[pixel] = float4(color.rgb, 1);