Fix for under water being much brighter and mismatching between alpha and deferred. Don't make terrain fullbright under water.
parent
ecf8c6f520
commit
7d0cf70e4f
|
|
@ -154,11 +154,7 @@ vec3 post_diffuse = color.rgb;
|
|||
|
||||
vec3 post_spec = color.rgb;
|
||||
|
||||
#ifdef WATER_FOG
|
||||
color.rgb += diffuse_srgb.rgb * diffuse_srgb.a * 0.25;
|
||||
#else
|
||||
color.rgb = mix(color.rgb, diffuse_linear.rgb, diffuse_linear.a);
|
||||
#endif
|
||||
|
||||
if (envIntensity > 0.0)
|
||||
{ //add environmentmap
|
||||
|
|
@ -209,6 +205,7 @@ vec3 post_atmo = color.rgb;
|
|||
|
||||
// convert to linear as fullscreen lights need to sum in linear colorspace
|
||||
// and will be gamma (re)corrected downstream...
|
||||
|
||||
frag_color.rgb = srgb_to_linear(color.rgb);
|
||||
frag_color.a = 0.0; //bloom;
|
||||
frag_color.a = bloom;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,10 +44,6 @@ VARYING vec4 vary_texcoord1;
|
|||
|
||||
vec2 encode_normal(vec3 n);
|
||||
|
||||
#ifdef WATER_FOG
|
||||
vec4 applyWaterFogView(vec3 pos, vec4 c);
|
||||
#endif
|
||||
|
||||
void main()
|
||||
{
|
||||
/// Note: This should duplicate the blending functionality currently used for the terrain rendering.
|
||||
|
|
@ -63,10 +59,6 @@ void main()
|
|||
vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
|
||||
|
||||
outColor.a = 0.0; // yes, downstream atmospherics
|
||||
#ifdef WATER_FOG
|
||||
outColor = applyWaterFogView(pos.xyz, outColor);
|
||||
outColor.a = 1.0; // no downstream atmo
|
||||
#endif
|
||||
|
||||
frag_data[0] = outColor;
|
||||
frag_data[1] = vec4(0.0,0.0,0.0,-1.0);
|
||||
|
|
|
|||
|
|
@ -162,11 +162,7 @@ vec3 post_diffuse = color.rgb;
|
|||
|
||||
vec3 post_spec = color.rgb;
|
||||
|
||||
#ifdef WATER_FOG
|
||||
color.rgb += diffuse_srgb.rgb * diffuse_srgb.a * 0.25;
|
||||
#else
|
||||
color.rgb = mix(color.rgb, diffuse_linear.rgb, diffuse_linear.a);
|
||||
#endif
|
||||
|
||||
if (envIntensity > 0.0)
|
||||
{ //add environmentmap
|
||||
|
|
|
|||
Loading…
Reference in New Issue