Skip to content
Benedikt S. Vogler edited this page Mar 12, 2019 · 6 revisions

Wurfel Engine supports a day-night cycle with global light sources via pixel based shading. For pixel-based shading, normal maps for each texture must be used. The vertex based shading is not supported anymore but still included in the source code.

The Light Engine (LE) is in the package "com.bombinggames.wurfelengine.core.lightengine".

Day/Night Cycle with Global Light Sources

To simulate a day-night cycle there are two global light sources: sun and moon.

Local Light Sources

When you want to have local lights e.g. a torch you can use the interface Coordinate.addLight(GameView view, Side side, int vertex, com.badlogic.gdx.graphics.Color color)

Javadoc

The shading is raytraced by using one sample per neighboring block. it is performed on the CPU.

There are also pixel based point lights calculated on the GPU. The point lights are based on the angle and are currently limited to one.

It should be now possible to use a fast er but feasible solution by using shadow maps. This should be outdated: Local lights are very slow because they must relay on raytracing. The advantage is that global illumination via radiosity is supported by the engine.

Diagrams

You can render some diagrams showing some data with the [console command](Console commands) "le".

Clone this wiki locally