1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 20:29:57 +00:00

tmp_sun_fix

This commit is contained in:
glassmancody.info 2022-07-05 23:47:23 -07:00
parent f451b09f10
commit 89bc756732

View file

@ -49,21 +49,20 @@ void paintSun(inout vec4 color)
color.a *= gl_FrontMaterial.diffuse.a; color.a *= gl_FrontMaterial.diffuse.a;
} }
void paintSunflashQuery(inout vec4 color)
{
const float threshold = 0.8;
color = texture2D(diffuseMap, diffuseMapUV);
if (color.a <= threshold)
discard;
}
void paintSunglare(inout vec4 color) void paintSunglare(inout vec4 color)
{ {
color = gl_FrontMaterial.emission; color = gl_FrontMaterial.emission;
color.a = gl_FrontMaterial.diffuse.a; color.a = gl_FrontMaterial.diffuse.a;
} }
void processSunflashQuery()
{
const float threshold = 0.8;
if (texture2D(diffuseMap, diffuseMapUV).a <= threshold)
discard;
}
void main() void main()
{ {
vec4 color = vec4(0.0); vec4 color = vec4(0.0);
@ -78,10 +77,12 @@ void main()
paintMoon(color); paintMoon(color);
else if (pass == PASS_SUN) else if (pass == PASS_SUN)
paintSun(color); paintSun(color);
else if (pass == PASS_SUNFLASH_QUERY)
paintSunflashQuery(color);
else if (pass == PASS_SUNGLARE) else if (pass == PASS_SUNGLARE)
paintSunglare(color); paintSunglare(color);
else if (pass == PASS_SUNFLASH_QUERY) {
processSunflashQuery();
return;
}
gl_FragData[0] = color; gl_FragData[0] = color;
} }