Skip to content

Commit

Permalink
feat(shaders): make vibrance shader configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
loqusion committed May 5, 2024
1 parent 48216fd commit 3d61135
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions shaders/vibrance.glsl → shaders/vibrance.glsl.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ varying vec2 v_texcoord;
uniform sampler2D tex;

// see https://github.com/CeeJayDK/SweetFX/blob/a792aee788c6203385a858ebdea82a77f81c67f0/Shaders/Vibrance.fx#L20-L30
const vec3 VIB_RGB_BALANCE = vec3(1.0, 1.0, 1.0);
const float VIB_VIBRANCE = 0.15;
const vec3 VIB_RGB_BALANCE = vec3(
{{#nc}}{{balance.red}} ? 1.0{{/nc}},
{{#nc}}{{balance.green}} ? 1.0{{/nc}},
{{#nc}}{{balance.blue}} ? 1.0{{/nc}}
);
const float VIB_VIBRANCE = {{#nc}}{{strength}} ? 0.15{{/nc}};

const vec3 VIB_coeffVibrance = VIB_RGB_BALANCE * -VIB_VIBRANCE;

Expand All @@ -32,3 +36,5 @@ void main() {

gl_FragColor = pixColor;
}

// vim: ft=glsl

0 comments on commit 3d61135

Please sign in to comment.