Skip to content

Commit

Permalink
amend to fxaa classic
Browse files Browse the repository at this point in the history
  • Loading branch information
dsvensson committed Dec 12, 2024
1 parent a16e5be commit f8c59a5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/gl_program.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ static r_program_uniform_t program_uniforms[] = {
{ r_program_post_process_glc, "v_blend", 1, false },
// r_program_uniform_post_process_glc_contrast,
{ r_program_post_process_glc, "contrast", 1, false },
// r_program_uniform_post_process_glc_r_inv_width,
{ r_program_post_process_glc, "r_inv_width", 1, false },
// r_program_uniform_post_process_glc_r_inv_height,
{ r_program_post_process_glc, "r_inv_height", 1, false },
// r_program_uniform_sky_glc_cameraPosition,
{ r_program_sky_glc, "cameraPosition", 1, false },
// r_program_uniform_sky_glc_speedscale,
Expand Down
2 changes: 2 additions & 0 deletions src/glc_framebuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ void GLC_RenderFramebuffers(void)
R_ProgramUniform1f(r_program_uniform_post_process_glc_gamma, v_gamma.value);
R_ProgramUniform4fv(r_program_uniform_post_process_glc_v_blend, blend_values);
R_ProgramUniform1f(r_program_uniform_post_process_glc_contrast, bound(1, v_contrast.value, 3));
R_ProgramUniform1f(r_program_uniform_post_process_glc_r_inv_width, 1.0f / (float)VID_ScaledWidth3D());
R_ProgramUniform1f(r_program_uniform_post_process_glc_r_inv_height, 1.0f / (float)VID_ScaledHeight3D());
R_ApplyRenderingState(r_state_default_2d);

if (flip2d && flip3d) {
Expand Down
4 changes: 3 additions & 1 deletion src/glsl/glc/glc_post_process_screen.fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ uniform sampler2D overlay;
uniform float gamma;
uniform vec4 v_blend;
uniform float contrast;
uniform float r_inv_width;
uniform float r_inv_height;

varying vec2 TextureCoord;

Expand All @@ -32,7 +34,7 @@ vec4 sampleBase(void)
base, // FxaaTex tex,
base, // FxaaTex fxaaConsole360TexExpBiasNegOne,
base, // FxaaTex fxaaConsole360TexExpBiasNegTwo,
vec2(1.0/1280.0, 1.0/720.0), // FxaaFloat2 fxaaQualityRcpFrame,
vec2(r_inv_width, r_inv_height), // FxaaFloat2 fxaaQualityRcpFrame,
FxaaFloat4(0.0f, 0.0f, 0.0f, 0.0f), // FxaaFloat4 fxaaConsoleRcpFrameOpt,
FxaaFloat4(0.0f, 0.0f, 0.0f, 0.0f), // FxaaFloat4 fxaaConsoleRcpFrameOpt2,
FxaaFloat4(0.0f, 0.0f, 0.0f, 0.0f), // FxaaFloat4 fxaaConsole360RcpFrameOpt2,
Expand Down
2 changes: 2 additions & 0 deletions src/r_program.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ typedef enum {
r_program_uniform_post_process_glc_overlay,
r_program_uniform_post_process_glc_v_blend,
r_program_uniform_post_process_glc_contrast,
r_program_uniform_post_process_glc_r_inv_width,
r_program_uniform_post_process_glc_r_inv_height,
r_program_uniform_sky_glc_cameraPosition,
r_program_uniform_sky_glc_speedscale,
r_program_uniform_sky_glc_speedscale2,
Expand Down

0 comments on commit f8c59a5

Please sign in to comment.