[orx-fx] Add bias to contour.frag

This commit is contained in:
Edwin Jakobs
2024-06-24 11:34:14 +02:00
parent e8aa2ce1ce
commit a08090318a

View File

@@ -7,11 +7,12 @@ uniform float contourOpacity;
uniform vec4 contourColor; uniform vec4 contourColor;
uniform float backgroundOpacity; uniform float backgroundOpacity;
uniform int window; uniform int window;
uniform float bias;
float calc_contour(vec2 uv) { float calc_contour(vec2 uv) {
vec4 box = texture(tex0, uv); vec4 box = texture(tex0, uv);
float v = sin(3.1415926535 * levels * dot(vec3(1.0/3.0),box.xyz)); float v = sin(3.1415926535 * levels * (dot(vec3(1.0 / 3.0), box.xyz) + bias));
float level = floor(dot(vec3(1.0/3.0),box.xyz) * levels) / levels; float level = floor((dot(vec3(1.0 / 3.0), box.xyz) + bias) * levels) / levels;
float contour = 1.0 - smoothstep(0., contourWidth, 0.5 * abs(v) / fwidth(v)); float contour = 1.0 - smoothstep(0., contourWidth, 0.5 * abs(v) / fwidth(v));
return contour; return contour;
} }