Bump version to 0.0.15
Add thresholded image to result of jump flood
This commit is contained in:
@@ -4,7 +4,7 @@ plugins {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
group 'org.openrndr.extra'
|
group 'org.openrndr.extra'
|
||||||
version '0.0.14'
|
version '0.0.15'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -13,7 +13,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
openrndrVersion = "0.3.30-rc2"
|
openrndrVersion = "0.3.30"
|
||||||
}
|
}
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ class JumpFlooder(val width: Int, val height: Int) {
|
|||||||
private val squareDim = Math.pow(2.0, exp.toDouble()).toInt()
|
private val squareDim = Math.pow(2.0, exp.toDouble()).toInt()
|
||||||
|
|
||||||
private val coordinates =
|
private val coordinates =
|
||||||
listOf(colorBuffer(squareDim, squareDim, format = ColorFormat.RG, type = ColorType.FLOAT32),
|
listOf(colorBuffer(squareDim, squareDim, format = ColorFormat.RGB, type = ColorType.FLOAT32),
|
||||||
colorBuffer(squareDim, squareDim, format = ColorFormat.RG, type = ColorType.FLOAT32))
|
colorBuffer(squareDim, squareDim, format = ColorFormat.RGB, type = ColorType.FLOAT32))
|
||||||
|
|
||||||
private val final = renderTarget(width, height) {
|
private val final = renderTarget(width, height) {
|
||||||
colorBuffer(type = ColorType.FLOAT32)
|
colorBuffer(type = ColorType.FLOAT32)
|
||||||
@@ -86,7 +86,7 @@ class JumpFlooder(val width: Int, val height: Int) {
|
|||||||
jumpFlood.apply(coordinates[i % 2], coordinates[(i + 1) % 2])
|
jumpFlood.apply(coordinates[i % 2], coordinates[(i + 1) % 2])
|
||||||
}
|
}
|
||||||
|
|
||||||
pixelDistance.apply(coordinates[exp % 2], coordinates[exp % 2])
|
pixelDistance.apply( arrayOf(coordinates[exp % 2], thresholded), coordinates[exp % 2])
|
||||||
drawer.isolatedWithTarget(final) {
|
drawer.isolatedWithTarget(final) {
|
||||||
drawer.background(ColorRGBa.BLACK)
|
drawer.background(ColorRGBa.BLACK)
|
||||||
drawer.ortho(final)
|
drawer.ortho(final)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#version 330 core
|
#version 330 core
|
||||||
|
|
||||||
uniform sampler2D tex0;
|
uniform sampler2D tex0;
|
||||||
|
uniform sampler2D tex1;
|
||||||
in vec2 v_texCoord0;
|
in vec2 v_texCoord0;
|
||||||
|
|
||||||
out vec4 o_color;
|
out vec4 o_color;
|
||||||
@@ -10,6 +11,6 @@ void main() {
|
|||||||
vec2 pixelPosition = v_texCoord0;
|
vec2 pixelPosition = v_texCoord0;
|
||||||
vec2 centroidPixelPosition = texture(tex0, v_texCoord0).xy;
|
vec2 centroidPixelPosition = texture(tex0, v_texCoord0).xy;
|
||||||
vec2 pixelDistance = (centroidPixelPosition - pixelPosition) * size * vec2(1.0, -1.0);
|
vec2 pixelDistance = (centroidPixelPosition - pixelPosition) * size * vec2(1.0, -1.0);
|
||||||
|
float threshold = texture(tex1, v_texCoord0).r;
|
||||||
o_color = vec4(pixelDistance, 0.0, 1.0);
|
o_color = vec4(pixelDistance, threshold, 1.0);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user