4 ms·
GLSL - OpenGL Shader Language Definitely check out ShaderToy to see many other examples: https://www.shadertoy.com/ https://www.shadertoy.com/
by thethimble 3y ago
GLSL - OpenGL Shader Language
Definitely check out ShaderToy to see many other examples: https://www.shadertoy.com/ https://www.shadertoy.com/
- jxf 3y agoAh, thanks! I was trying to copy-paste some examples and they didn't quite work -- it looks like ShaderToy exposes a mainImage(out vec4, in vec2) function with a different signature than the simulation-Sphere site wants. For example there's no main() method in here [0] and I wasn't sure how to translate that to the sphere's expected inputs. [0] https://www.shadertoy.com/view/Ms2SDc https://www.shadertoy.com/view/Ms2SDc
- HellsMaddy 3y agoYeah, you will need to adapt the code a bit: https://gist.github.com/b0o/ac939eb1608f949765ac842fe28f53b9 https://gist.github.com/b0o/ac939eb1608f949765ac842fe28f53b9
- jnrk 3y agoNice!
- hex4def6 3y agoYeah, looks like there's a couple of differences. If you look at the top left there are a few examples that are shadertoy examples. Example 5 (Smiley face) shows some differences: * the void main() declaration difference * the inclusion of iTime vs time * gl_FragColor vs fragcolor Also, the demo adds: uniform float time; varying vec2 vUv; varying vec3 vNormal; I think those are the biggest differences.