mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-01 03:21:41 +00:00
Support A2C for groundcover
This commit is contained in:
parent
4f510d85ba
commit
b8ee32e317
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user