|
|
|
@ -30,11 +30,7 @@ centroid varying vec3 shadowDiffuseLighting;
|
|
|
|
|
|
|
|
|
|
#include "shadows_fragment.glsl"
|
|
|
|
|
#include "lighting.glsl"
|
|
|
|
|
|
|
|
|
|
float calc_coverage(float a, float alpha_ref, float falloff_rate)
|
|
|
|
|
{
|
|
|
|
|
return clamp(falloff_rate * (a - alpha_ref) + alpha_ref, 0.0, 1.0);
|
|
|
|
|
}
|
|
|
|
|
#include "alpha.glsl"
|
|
|
|
|
|
|
|
|
|
void main()
|
|
|
|
|
{
|
|
|
|
@ -55,12 +51,13 @@ void main()
|
|
|
|
|
gl_FragData[0] = vec4(1.0);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
gl_FragData[0].a = calc_coverage(gl_FragData[0].a, 128.0/255.0, 4.0);
|
|
|
|
|
|
|
|
|
|
float shadowing = unshadowedLightRatio(linearDepth);
|
|
|
|
|
if (euclideanDepth > @groundcoverFadeStart)
|
|
|
|
|
gl_FragData[0].a *= 1.0-smoothstep(@groundcoverFadeStart, @groundcoverFadeEnd, euclideanDepth);
|
|
|
|
|
|
|
|
|
|
alphaTest();
|
|
|
|
|
|
|
|
|
|
float shadowing = unshadowedLightRatio(linearDepth);
|
|
|
|
|
|
|
|
|
|
vec3 lighting;
|
|
|
|
|
#if !PER_PIXEL_LIGHTING
|
|
|
|
|
lighting = passLighting + shadowDiffuseLighting * shadowing;
|
|
|
|
|