Point Lights
Last updated
Last updated
Points lights emit light of a specific color and intensity from a positional point in the world.
Point lights are real time lighting, meaning they will cast shadows and recalculate light each frame based on the objects in proximity of the light. This also means that point lights come at a much performance cost than ambient and directional lighting. Use point lights sparingly.
Point lights are created as a Light instance. The pattern of point light usage is similar to entities. You must create an instance of a Light first, then spawn the light in the world. Here's how we can do that.
You can attach a point light to follow an entity as the entity moves throughout the world like this.
The Light class, which is used to create point lights, supports a wide variety of features and is constantly evolving. If you'd like to learn more, we recommend you dig into the Light API Reference here.
If there are features that we don't currently support for point lights that you'd like to see added to the HYTOPIA SDK, you can submit a feature request here.