Skip to content

Commit

Permalink
[orx-jumpflood] Fix jumpflood readme example, signature seems to have…
Browse files Browse the repository at this point in the history
… changed (#129)
  • Loading branch information
hamoid authored and edwinRNDR committed Jul 3, 2020
1 parent 5adf04a commit 6fa78af
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions orx-jumpflood/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ fun main() = application {
thresholdFilter.threshold = 0.5
thresholdFilter.apply(blurred, thresholded)

distanceFieldFromBitmap(drawer, thresholded, result = distanceField)
distanceFieldFromBitmap(thresholded, result = distanceField)

drawer.isolated {
// -- use a shadestyle to visualize the distance field
drawer.shadeStyle = shadeStyle {
fragmentTransform = """
float d = x_fill.r;
if (x_fill.g > 0.5) {
x_fill.rgb = 1.0 * vec3(cos(d) * 0.5 + 0.5);
x_fill.rgb = vec3(cos(d) * 0.5 + 0.5);
} else {
x_fill.rgb = 0.25 * vec3(1.0 - (cos(d) * 0.5 + 0.5));
}
Expand Down Expand Up @@ -131,20 +131,17 @@ fun main() = application {
thresholdFilter.threshold = 0.5
thresholdFilter.apply(blurred, thresholded)

directionFieldFromBitmap(drawer, thresholded, result = directionField)
directionFieldFromBitmap(thresholded, result = directionField)

drawer.isolated {
// -- use a shadestyle to visualize the direction field
drawer.shadeStyle = shadeStyle {
fragmentTransform = """
float a = atan(x_fill.r, x_fill.g);
if (a < 0) {
a += 3.1415926535*2;
}
if (x_fill.g > 0.5) {
x_fill.rgb = 1.0*vec3(cos(a*1.0)*0.5+0.5);
if (x_fill.b > 0.5) {
x_fill.rgb = vec3(cos(a)*0.5+0.5, 1.0, sin(a)*0.5+0.5);
} else {
x_fill.rgb = 0.25*vec3(cos(a*1.0)*0.5+0.5);
x_fill.rgb = vec3(cos(a)*0.5+0.5, 0.0, sin(a)*0.5+0.5);
}
"""
}
Expand Down

0 comments on commit 6fa78af

Please sign in to comment.