08 What Three.js writes for you
Material: why a surface looks like plastic or metal
Drag the roughness and compare highlights and reflections.
0.021
01
Exercise
Drag the underlined numbers left and rightDrag numbers, or edit the code
const material = new THREE.MeshStandardMaterial({ roughness: , metalness: });// the environment map provides visible reflections
Roughness / metalnessDecide how the surface responds to light. They are uniforms of Three.js’s built-in shader.JS side
MeshStandardMaterial is a big fragment shader Three.js wrote for you; roughness and metalness are just its uniforms.
Try it
- Set roughness to 0: sharp reflections appear
- Set metalness to 1: the colour becomes the reflection’s colour