mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 18:09:39 +00:00
Support A2C for groundcover
This commit is contained in:
parent
4f510d85ba
commit
b8ee32e317
1 changed files with 5 additions and 8 deletions
|
@ -30,11 +30,7 @@ centroid varying vec3 shadowDiffuseLighting;
|
||||||
|
|
||||||
#include "shadows_fragment.glsl"
|
#include "shadows_fragment.glsl"
|
||||||
#include "lighting.glsl"
|
#include "lighting.glsl"
|
||||||
|
#include "alpha.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);
|
|
||||||
}
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
@ -55,12 +51,13 @@ void main()
|
||||||
gl_FragData[0] = vec4(1.0);
|
gl_FragData[0] = vec4(1.0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gl_FragData[0].a = calc_coverage(gl_FragData[0].a, 128.0/255.0, 4.0);
|
|
||||||
|
|
||||||
float shadowing = unshadowedLightRatio(linearDepth);
|
|
||||||
if (euclideanDepth > @groundcoverFadeStart)
|
if (euclideanDepth > @groundcoverFadeStart)
|
||||||
gl_FragData[0].a *= 1.0-smoothstep(@groundcoverFadeStart, @groundcoverFadeEnd, euclideanDepth);
|
gl_FragData[0].a *= 1.0-smoothstep(@groundcoverFadeStart, @groundcoverFadeEnd, euclideanDepth);
|
||||||
|
|
||||||
|
alphaTest();
|
||||||
|
|
||||||
|
float shadowing = unshadowedLightRatio(linearDepth);
|
||||||
|
|
||||||
vec3 lighting;
|
vec3 lighting;
|
||||||
#if !PER_PIXEL_LIGHTING
|
#if !PER_PIXEL_LIGHTING
|
||||||
lighting = passLighting + shadowDiffuseLighting * shadowing;
|
lighting = passLighting + shadowDiffuseLighting * shadowing;
|
||||||
|
|
Loading…
Reference in a new issue