Lighting
Last updated
Last updated
Lighting is a critical piece for making a game look and feel a certain way to players. The HYTOPIA SDK gives developers full control of the most common types of lighting a game might need.
Lighting is controlled in a few different ways depending on the lighting type. For example, ambient and directional light is controlled through a World instance, while point lights and spot lights are controlled through an instance of the Light class.
There's 5 types of lighting that HYTOPIA supports. All lighting besides emissive lights are dynamic and will cast physically accurate shadows in real time. All lights automatically interpolated value changes for smooth visual changes to lighting effects. We'll cover the 5 lighting types below.
Ambient Light - Ambient light is the base lighting of the entire world. This determines the minimum brightness and light color of your world.
Emissive Lights - Emissive lights can emit light from static/fixed game elements like blocks. This lighting is the only lighting that will not cast shadows. Emissive lights are not yet supported!
Point Lights - Point lights are lights that emit from a fixed point in space. They can move dynamically through the world, follow entities, have their color or intensity controlled in real time and more. Point lights are real time lights that are graphically expensive and should be used sparingly.
Spot Lights - Spot lights are lights taht emit from a fixed point in space in a cone-like shape. They can move dynamically through the world, track a position or an entity and have their angle, color, intensity and penumbra controlled. Spot lights are real time lights that are graphically expensive and should be used sparingly.
Sun Light (aka Directional Light) - Sun light, also known as the directional light, is a single light source emitting from a set position. It casts a light across the entire world relative to its position with a intensity and color you can control. Its position when updated is automatically interpolated, as well as its color, so it can be used to control lighting effects like day/night cycles, and more.
Ambient Light
Learn more about ambient lighting and how to use it.
Light Manager
Learn more about the light manager that tracks and allows lookup of point lights and spot lights in a world.
Point Lights
Learn more about point lights that emit light from a point in the world.
Spot Lights
Learn more about spot lights that emit a cone shaped spot light from a point in the world.
Sun Light
Learn more about sun light that emits a directional light from the sky across the entire world.