mrdoob / glsl-sandbox

Shader editor and gallery.
https://glslsandbox.com/
MIT License
1.55k stars 260 forks source link

Information on what uniforms are available and what they mean. #45

Open nezumisama opened 7 years ago

nezumisama commented 7 years ago

I couldn't find information of what uniforms are available and what they do. It would be useful to provide a short explanation of each uniform. From what I found, these uniforms are available:

float time; // Seconds since start.
vec2 mouse; // Mouse position, X and Y 0 to 1, X starts left, Y starts bottom.
vec2 resolution; // Resolution.
sampler2D backbuffer // Texture storing previous rendered image.
vec2 surfaceSize; // ???
??? texture; // ???

What's the function of surfaceSize and texture by the way? And I know of one varying

varying vec2 surfacePosition;

But I don't know what it does.

dagostinelli commented 7 years ago

Agreed. It's not intuitive to me what's available either.

A simple one is what model/geometry is in gl_FragCoord? For experienced folks, some of this is obvious, but for newbies, it's not so obvious and this seems like a fantastic site to learn on.

Zireael07 commented 6 years ago

Can we create our own uniforms?