Spotlights are like point lights but their area of influence is constrained to a cone that gets projected from the light. The border where the light meets the shadows is called penumbra and its softness can be adjusted on the spotlight. You will also notice that the shadows look a bit broken right now. Shadows in three.js are generated using a technique called shadowmaps, which is a performance-optimized way of calculating shadows but can sometimes yield glitchy results. The problem that we are currently seeing is one of the most common artifacts that occurs when using shadow maps. To fix this we need to adjust the bias value on the light shadow.
- [Instructor] In this video, we will take…a look at SpotLights.…You can create a SpotLight by simply calling…the three SpotLight function.…I will again create a dedicated function…to wrap the three.js SpotLight functionality.…So I will find the PointLight-creating function.…I will copy it and paste it…and change its name to getSpotLight.…And here, instead of calling the PointLight function,…I will call the SpotLight function.…SpotLight works with the same arguments as the PointLight.…
So I will get this function's name.…And inside my main function body,…instead of creating a PointLight here,…I'll be creating a SpotLight, and I will be changing…the references to the PointLight name…with the SpotLight name.…I will be selecting all these references…by pressing the Commands + D button…on the Sublime Text editor.…So, here, instead of calling these variables PointLights,…I will be changing them to SpotLight.…And one more change that I would like to do is…I would like to start my SpotLight from a higher position,…which is 4. Perfect.…
- Building a simple scene
- Creating three.js 3D objects
- Adding light and shadows
- Animating with Tween.js
- Working with materials and textures
- Editing and importing geometries
- Creating a particle system
- Post-processing with effects and shaders
Skill Level Intermediate
1. Building a Simple Scene
2. Three.js Scene Object
5. Materials and Textures
Next steps1m 53s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.