SL-11512
Modify method for nerfing additive on terrain so it doesn't trip up deferred lighting and make light artifacts.meow-7.2.2
parent
4b8ec2f11f
commit
7c651f8423
|
|
@ -176,8 +176,9 @@ vec3 post_env = color.rgb;
|
|||
if (norm.w < 1)
|
||||
{
|
||||
#if !defined(SUNLIGHT_KILL)
|
||||
additive *= spec.a;
|
||||
float additive_angular_atten = max(0.0, dot(light_dir, normalize(pos.xyz)));
|
||||
color = atmosFragLighting(color, additive * additive_angular_atten * (1.0 - spec.a), atten);
|
||||
color = atmosFragLighting(color, additive * additive_angular_atten, atten);
|
||||
color = scaleSoftClipFrag(color);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ void main()
|
|||
#endif
|
||||
|
||||
frag_data[0] = outColor;
|
||||
frag_data[1] = vec4(0.0,0.0,0.0,1.0);
|
||||
frag_data[1] = vec4(0.0,0.0,0.0,-1.0);
|
||||
vec3 nvn = normalize(vary_normal);
|
||||
frag_data[2] = vec4(encode_normal(nvn.xyz), 0.0, 0.0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,8 +185,9 @@ vec3 post_env = color.rgb;
|
|||
{
|
||||
#if !defined(SUNLIGHT_KILL)
|
||||
vec3 p = normalize(pos.xyz);
|
||||
additive *= spec.a;
|
||||
float additive_angular_atten = max(0.0, dot(light_dir.xyz, p.xyz));
|
||||
color = atmosFragLighting(color, additive * additive_angular_atten * (1.0 - spec.a), atten);
|
||||
color = atmosFragLighting(color, additive * additive_angular_atten, atten);
|
||||
color = scaleSoftClipFrag(color);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue