|
|
|
@ -499,7 +499,7 @@
|
|
|
|
|
|
|
|
|
|
#if SHADOWS || SHADOWS_PSSM
|
|
|
|
|
float fadeRange = shadowFar_fadeStart.x - shadowFar_fadeStart.y;
|
|
|
|
|
float fade = 1-((depthPassthrough - shadowFar_fadeStart.y) / fadeRange);
|
|
|
|
|
float fade = 1.0-((depthPassthrough - shadowFar_fadeStart.y) / fadeRange);
|
|
|
|
|
shadow = (depthPassthrough > shadowFar_fadeStart.x) ? 1.0 : ((depthPassthrough > shadowFar_fadeStart.y) ? 1.0-((1.0-shadow)*fade) : shadow);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
@ -514,11 +514,11 @@
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if UNDERWATER
|
|
|
|
|
float3 waterEyePos = intercept(worldPos, cameraPos.xyz - worldPos, float3(0,0,1), waterLevel);
|
|
|
|
|
float3 waterEyePos = intercept(worldPos, cameraPos.xyz - worldPos, float3(0.0,0.0,1.0), waterLevel);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if SHADOWS || SHADOWS_PSSM
|
|
|
|
|
shOutputColour(0) *= (lightResult - float4(directionalResult * (1.0-shadow),0));
|
|
|
|
|
shOutputColour(0) *= (lightResult - float4(directionalResult * (1.0-shadow),0.0));
|
|
|
|
|
#else
|
|
|
|
|
shOutputColour(0) *= lightResult;
|
|
|
|
|
#endif
|
|
|
|
@ -574,7 +574,7 @@
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// prevent negative colour output (for example with negative lights)
|
|
|
|
|
shOutputColour(0).xyz = max(shOutputColour(0).xyz, float3(0,0,0));
|
|
|
|
|
shOutputColour(0).xyz = max(shOutputColour(0).xyz, float3(0.0,0.0,0.0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|