diff options
author | Christian Hergert <chergert@redhat.com> | 2020-12-03 10:20:11 -0800 |
---|---|---|
committer | Christian Hergert <chergert@redhat.com> | 2020-12-03 10:23:13 -0800 |
commit | 8e62ff50febaf05a5b1f4900f6c5ea52713383c7 (patch) | |
tree | f4d6d2046fdce83ca1d59e70bb57a4295fd8077a /demos | |
parent | 0daa905a2709512160215d261c3165aec19b6447 (diff) | |
download | gtk+-8e62ff50febaf05a5b1f4900f6c5ea52713383c7.tar.gz |
demos: make alienplanet demo work on macOS OpenGL
On the macOS OpenGL implementation, the use of noise2 as a
function within the glsl shader collides with the builtin noise2 of a
different signature.
This changes the name to something similar (noize2) so that we
do not risk colliding names when linking.
With this commit, the shadertoy alienplanet demo works on mac
OpenGL (albeit still with the Cairo renderer).
Diffstat (limited to 'demos')
-rw-r--r-- | demos/gtk-demo/alienplanet.glsl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/demos/gtk-demo/alienplanet.glsl b/demos/gtk-demo/alienplanet.glsl index 3e3aea3ac8..ad77fb15f4 100644 --- a/demos/gtk-demo/alienplanet.glsl +++ b/demos/gtk-demo/alienplanet.glsl @@ -67,7 +67,7 @@ vec2 raySphere(vec3 ro, vec3 rd, vec4 sphere) { return vec2(t0, t1); } -float noise1(vec2 p) { +float noize1(vec2 p) { vec2 n = mod2(p, vec2(cellWidth)); vec2 hh = hash(sqrt(2.0)*(n+1000.0)); hh.x *= hh.y; @@ -81,7 +81,7 @@ float noise1(vec2 p) { return h*0.25; } -float noise2(vec2 p) { +float noize2(vec2 p) { vec2 n = mod2(p, vec2(cellWidth)); vec2 hh = hash(sqrt(2.0)*(n+1000.0)); hh.x *= hh.y; @@ -114,7 +114,7 @@ float height(vec2 p, float dd, int mx) { int i = 0; for (; i < 4;++i) { - float nn = a*noise2(p); + float nn = a*noize2(p); s += nn; d += abs(a); p += o; @@ -130,7 +130,7 @@ float height(vec2 p, float dd, int mx) { mx = int(mix(float(4), float(mx), step(rdd, far))); for (; i < mx; ++i) { - float nn = a*noise1(p); + float nn = a*noize1(p); s += nn; d += abs(a); p += o; |