3D Web · Exercise 3 of 3 Previous
Advanced
Dim the lamp with a uniform
The lens glows with a fixed strength. Make the strength a TSL uniform, keep it in lens.userData.glow, and make the Off button set it to 0.
Don't create a new material: a uniform change needs no recompile.
What Check tests
- The strength is a uniform kept in lens.userData.glow
- Off sets it to 0
- The material is the same object after the click
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.