Graphics Reference
In-Depth Information
With these simple steps, you've created
THREE.PointLight
, which moves up and
down through the scene.
How it works...
THREE.PointLight
emits light in all directions; you can compare this a bit with
THREE.SpotLight
but with a 360 degree field of view in all directions. This is
also the main reason that
THREE.PointLight
can't be used to cast shadows. As
there is so much light being emitted by
THREE.PointLight
, it is very difficult and
resource-intensive to calculate the resulting shadows.
So, if you want shadows and also use
THREE.PointLight
, you could use a
shadow map if you have a static
THREE.PointLight
object or an extra
THREE.SpotLight
object and set it to only cast shadows with the
onlyShadow
property.
See also
There are a couple of recipes that you can look at in relation to this recipe:
• In the
Creating shadows with a THREE.SpotLight
recipe, we showed you
how you can use
THREE.SpotLight
to create shadows. You can use this
together with
THREE.PointLight
.
• In the
Creating shadows with a THREE.DirectionalLight
recipe, we show you
how to set up and configure
THREE.DirectionalLight
. This light casts
shadows and can be used together with
THREE.PointLight
.
map for fixed shadows
recipe. This recipe explained how to use shadow
maps to fake shadows. If you use that recipe together with this one, you can
use it to fake the shadows cast by
THREE.PointLight
.