Browse Source

GPU: remove persistence from default post process shader.

The feature will still be accessible from a uniform in the shader, but it
is now disabled by default.
legacy
Sam Hocevar 6 years ago
parent
commit
9307f454ad
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      src/gpu/postprocess.lolfx

+ 7
- 2
src/gpu/postprocess.lolfx View File

@@ -23,6 +23,11 @@ uniform sampler2D u_buffer;
uniform sampler2D u_prev_buffer; uniform sampler2D u_prev_buffer;
uniform sampler2D u_prev_final; uniform sampler2D u_prev_final;


// Persistence settings:
// x: persistence of backbuffer (default 0)
// y: persistence of whites in render buffer (default 0)
uniform vec3 u_persistence;

in vec2 pass_position; in vec2 pass_position;
out vec4 out_color; out vec4 out_color;


@@ -35,10 +40,10 @@ void main(void)
vec4 prev_color = vec4(texture2D(u_prev_buffer, texcoords).rgb, 1.0); vec4 prev_color = vec4(texture2D(u_prev_buffer, texcoords).rgb, 1.0);


/* (do stuff with color here) */ /* (do stuff with color here) */
vec4 final_color = mix(color, prev_color, 0.01);
vec4 final_color = mix(color, prev_color, u_persistence.x);


/* Blend final color with previous frame’s final color */ /* Blend final color with previous frame’s final color */
vec4 prev_final_color = vec4(texture2D(u_prev_final, texcoords).rgb, 1.0); vec4 prev_final_color = vec4(texture2D(u_prev_final, texcoords).rgb, 1.0);
out_color = mix(final_color, prev_final_color, vec4(0.5) + 0.3 * (prev_final_color - final_color));
out_color = mix(final_color, prev_final_color, u_persistence.y * (vec4(1.6666) + prev_final_color - final_color));
} }



Loading…
Cancel
Save