Lighting
Last updated
Last updated
Lighting is an important and non trivial part of creating shaders.
The library comes with some built in implementations of materials.
The Lambert material implementation is highly efficient as it only calculated the light at each vertex. It can take a diffuse color and returns an RgbaNode.
The standard material is based on a physically based rendering approach and looks just like except it that it does not have features like metalness or refraction.
Light and shadow information is passed in by ThreeJS based on what exists in the scene and you can access them with uniforms. Check out the / for what predefined uniforms exist and for how to create new ones if some you need are missing.