mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 17:59:56 +00:00
tmp_sun_fix
This commit is contained in:
parent
f451b09f10
commit
89bc756732
1 changed files with 12 additions and 11 deletions
|
@ -49,21 +49,20 @@ void paintSun(inout vec4 color)
|
|||
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)
|
||||
{
|
||||
color = gl_FrontMaterial.emission;
|
||||
color.a = gl_FrontMaterial.diffuse.a;
|
||||
}
|
||||
|
||||
void processSunflashQuery()
|
||||
{
|
||||
const float threshold = 0.8;
|
||||
|
||||
if (texture2D(diffuseMap, diffuseMapUV).a <= threshold)
|
||||
discard;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 color = vec4(0.0);
|
||||
|
@ -78,10 +77,12 @@ void main()
|
|||
paintMoon(color);
|
||||
else if (pass == PASS_SUN)
|
||||
paintSun(color);
|
||||
else if (pass == PASS_SUNFLASH_QUERY)
|
||||
paintSunflashQuery(color);
|
||||
else if (pass == PASS_SUNGLARE)
|
||||
paintSunglare(color);
|
||||
else if (pass == PASS_SUNFLASH_QUERY) {
|
||||
processSunflashQuery();
|
||||
return;
|
||||
}
|
||||
|
||||
gl_FragData[0] = color;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue