Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Shaders: Apply tone mapping before fog calculation.
  • Loading branch information
lhofhansl authored and nerzhul committed Oct 25, 2016
1 parent 779d2c5 commit 9817648
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions client/shaders/nodes_shader/opengl_fragment.glsl
Expand Up @@ -194,6 +194,10 @@ void main(void)

vec4 col = vec4(color.rgb * gl_Color.rgb, 1.0);

#ifdef ENABLE_TONE_MAPPING
col = applyToneMapping(col);
#endif

#if MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT
float alpha = gl_Color.a;
if (fogDistance != 0.0) {
Expand All @@ -209,9 +213,5 @@ void main(void)
col = vec4(col.rgb, base.a);
#endif

#ifdef ENABLE_TONE_MAPPING
gl_FragColor = applyToneMapping(col);
#else
gl_FragColor = col;
#endif
}
8 changes: 4 additions & 4 deletions client/shaders/water_surface_shader/opengl_fragment.glsl
Expand Up @@ -150,6 +150,10 @@ vec4 base = texture2D(baseTexture, uv).rgba;

vec4 col = vec4(color.rgb * gl_Color.rgb, 1.0);

#ifdef ENABLE_TONE_MAPPING
col = applyToneMapping(col);
#endif

#if MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE
float alpha = gl_Color.a;
if (fogDistance != 0.0) {
Expand All @@ -165,9 +169,5 @@ vec4 base = texture2D(baseTexture, uv).rgba;
col = vec4(col.rgb, base.a);
#endif

#ifdef ENABLE_TONE_MAPPING
gl_FragColor = applyToneMapping(col);
#else
gl_FragColor = col;
#endif
}

0 comments on commit 9817648

Please sign in to comment.