Question

I had been studying glsl.heroku.com for a while and still cannot figure out something. Hopefully some of you can help me out a bit on the part I don't quite understand. Thanks!

I am looking at this link and I am wondering where did the varying vec2 surfacePosition; come from, since there isn't any vertex shader around. Or there is that I am not aware of all this time?

I see some of the posts too have 3D model that is obviously link from somewhere, but I cannot figure out where and how since the site only show the code of fragment shader.

I really appreciate any help. Thanks!

Was it helpful?

Solution

Actually, there is a Vertex Shader and that is where the varying vec2 surfacePosition; comes from. If you look at the source of any "effect" on glsl.heroku.com, then you can find/see the Vertex Shader. Note, effect is what glsl.heroku.com calls the things.

The Vertex Shader, is basically the same on every "effect", Though glsl.heroku.com might remove the various un-needed attributes and uniforms, when it checks/parses the Fragment Shader created by the user. It might do that, but I can't say for sure.

Of course all the attributes and uniforms there might be, are passes from WebGL to both the Vertex and Fragment Shader.

Also, there are NO models, all those 3D objects you see, is just a really advanced Fragment Shader which does ray-tracing.

Vertex Shader of your link

image

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top