Re:A trip down the League of Legends graphics pipeline
by adamnemecek on Thursday January 19, 2017 @11:21AM
(#13436945)
You are right, I didn't pick the best example. But I believe everything is procedurally generated on the GPU in this demo https://www.youtube.com/watch?v=pnn6QC8a5g8. Note that all of this had to be fit into a binary of 4k or smaller.
Re:A trip down the League of Legends graphics pipeline
by kickscondor on Thursday January 19, 2017 @07:04PM
(#13440633)
Oh it's a fine example - I'm sorry - it didn't occur to me that my reply would sound critical! I just wanted to add some explanation, for anyone who was curious. The original post was good!
The shaders on ShaderToy aren't quite the same as straight OpenGL fragment shaders - there is quite a bit of boilerplate code built into the site that allows ShaderToy shaders to have access to stuff like mouse coordinates and audio signal info. (Expand the 'Shader inputs' area above the code block - none of those are available in OpenGL.)
But OpenGL also has its own library[1] of functions: `texture2D`, `smoothstep`, `mix` and all the built-in vector math - and you can see all of these in action in the shader you linked. The ShaderToy boilerplate - in partnership with these libraries - is the reason the code is so concise.
[1] http://www.shaderific.com/glsl-functions/