fix
This commit is contained in:
parent
668d1d522f
commit
3f3f48eb6d
@ -21,10 +21,14 @@ vec4 effect() {
|
|||||||
vec3 normal = transpose(mat3(u_view)) * texture(u_normal, v_uv).xyz;
|
vec3 normal = transpose(mat3(u_view)) * texture(u_normal, v_uv).xyz;
|
||||||
vec3 dir = modelpos.xyz - u_cameraPos;
|
vec3 dir = modelpos.xyz - u_cameraPos;
|
||||||
|
|
||||||
|
float emission = texture(u_emission, v_uv).r;
|
||||||
|
|
||||||
#ifdef ENABLE_SHADOWS
|
#ifdef ENABLE_SHADOWS
|
||||||
light *= max(calc_shadow(modelpos, normal, length(pos)), texture(u_emission, v_uv).r);
|
light *= calc_shadow(modelpos, normal, length(pos));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
light = max(light, emission);
|
||||||
|
|
||||||
vec3 fogColor = texture(u_skybox, dir).rgb;
|
vec3 fogColor = texture(u_skybox, dir).rgb;
|
||||||
float fog = calc_fog(length(u_view * vec4((modelpos.xyz - u_cameraPos) * FOG_POS_SCALE, 0.0)) / 256.0);
|
float fog = calc_fog(length(u_view * vec4((modelpos.xyz - u_cameraPos) * FOG_POS_SCALE, 0.0)) / 256.0);
|
||||||
return vec4(mix(texture(u_screen, v_uv).rgb * mix(1.0, light, 1.0), fogColor, fog), 1.0);
|
return vec4(mix(texture(u_screen, v_uv).rgb * mix(1.0, light, 1.0), fogColor, fog), 1.0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user