Because I keep forgetting that stuff...
light that will be reflected on different surfaces
"mirror-like" reflection of light
objects outside of viewport should not be rendered
objects create shadows between themselves
varying vec2 vUv;
varying vec2 vNormal;
void main() {
vUv = uv;
vNormal = normal;
...
- model: transformation of the vertex
- view: "eye" (alignment) of the camera
- projection: viewport + camera perspective (FOV, near, far)
use cases: distort a mesh in the "right" direction, calculate light position
dot(vNormal, lightPosition) * lightColor
Circular mapping of the texture (so a texture/shader on a sphere will loop instead of having a "cut")
vUv.x = sin(PI * uv.x);
vec2 coords = position.xy;