Lighting

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.

Ambient light and sun light used together to create a day/night cycle.

Types Of Lights

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.

Next Steps

Last updated