Bumped to version 0.0.7

version of JumpFlood with reusable color buffers
This commit is contained in:
Edwin Jakobs
2018-10-07 17:02:57 +02:00
parent 6e39e61473
commit 75b5fb5e84
5 changed files with 73 additions and 64 deletions

View File

@@ -6,15 +6,15 @@ in vec2 v_texCoord0;
out vec4 o_color;
void main() {
vec2 step = 1.0 / textureSize(tex0, 0);
vec2 stepSize = 1.0 / textureSize(tex0, 0);
float ref = step(0.5 , texture(tex0, v_texCoord0).r);
vec4 outc = vec4(-1.0, -1.0, 0.0, 1.0);
float contour = 0.0;
for (int y = -1; y <= 1; ++y) {
for (int x = -1; x <= 1; ++x) {
float smp = step(0.5, texture(tex0, v_texCoord0 + vec2(x,y) * step).r);
if (smp != ref) {
float smp = step(0.5, texture(tex0, v_texCoord0 + vec2(x,y) * stepSize).r);
if (smp != ref && ref == 1.0) {
contour = 1.0;
}
}

View File

@@ -7,9 +7,9 @@ out vec4 o_color;
void main() {
vec2 size = textureSize(tex0, 0);
vec2 pixelPosition = v_texCoord0 * size;
vec2 centroidPixelPosition = texture(tex0, v_texCoord0).xy * size;
vec2 pixelDistance = centroidPixelPosition - pixelPosition;
vec2 pixelPosition = v_texCoord0;
vec2 centroidPixelPosition = texture(tex0, v_texCoord0).xy;
vec2 pixelDistance = (centroidPixelPosition - pixelPosition) * size;
o_color = vec4(pixelDistance, 0.0, 1.0);
}

View File

@@ -7,7 +7,5 @@ out vec4 o_color;
void main() {
float ref = step(threshold , dot( vec3(1.0/3.0), texture(tex0, v_texCoord0).rgb ));
o_color = vec4(ref, ref, ref, 1.0);
}