Commit Graph

2 Commits

Author SHA1 Message Date
Christian Hergert
8e62ff50fe 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).
2020-12-03 10:23:13 -08:00
Alexander Larsson
0092a08dfc gtk-demo: Add shadertoy demo
This adds a small demo of using OpenGL shaders, it renders a quad
over the entire widget with a custom fragment shader. The coordinates
and the uniform names are compatible with the ones on shadertoy.com
(although some features, like texture inputs are missing currently).

The default shader in the demo is
https://www.shadertoy.com/view/wsjBD3 which is CC0, so it is
redistributable by Gtk+ (most other shaders are CC-BY-NC-SA which
isn't obviously compatible). I also added a set of buttons loading
a few other CC0 shaders I found.
2020-09-08 09:56:25 +02:00