Learning three.js 03 :: Light/Shadows in 60 seconds
Going off of the last video, lights and shadows added in under 60 seconds.
Source code - https://github.com/saucecode/threejs-demos/tree/master/03_LightAndShadow
All the materials need to be Phong materials so that they are affected by lighting/shadows. You can still use Basic materials.
If an ambient light isn't included, then everything not lit is completely black. You can add as many lights as you please. They're dynamic, so you can move them around too.
Lights work by projecting a shadowmap from an internal "camera." We define the near and far distances of this internal camera in the same way we do for the PerspectiveCamera. The reach of the light is limited by the near and far settings of the light's internal camera.
By limiting it you reduce CPU/GPU load by reducing lighting calculations to a certain radius of vertices.
https://rawr.nz/
Send mail and music recommendations to cahill.julian@gmail.com
https://youtu.be/jfFTT3iz740 - Nujabes - Feather
Också, om någon talar svenska, skicka mig en email. Jag behöver öva!