.. | ||
screenshots | ||
camera.gd | ||
cube.blend | ||
cube.glb | ||
cube.glb.import | ||
cube.glb.unwrap_cache | ||
default_env.tres | ||
icon.png | ||
icon.png.import | ||
project.godot | ||
README.md | ||
test_all.exr | ||
test_all.exr.import | ||
test_all.lmbake | ||
test.exr | ||
test.exr.import | ||
test.gd | ||
test.lmbake | ||
test.tscn | ||
zdm2.blend | ||
zdm2.glb | ||
zdm2.glb.import | ||
zdm2.glb.unwrap_cache |
Global Illumination
This demo showcases Godot's global illumination systems: GIProbe, BakedLightmap (indirect only and fully baked) and ReflectionProbe.
Use the mouse to look around, W/A/S/D or arrow keys to move.
Language: GDScript
Renderer: GLES 31
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/1290
How does it work?
A glTF scene (which acts as the level mesh) is imported with its Light Baking option set to Gen Lightmaps. This is required for BakedLightmap to work (but is not required for GIProbe or BakedLightmap).
The level mesh is duplicated several times to allow displaying it with various bake settings:
- No baking (uses GIProbe or environment lighting).
- Baked indirect lighting. Slower, but allows for real-time shadows to display on baked surfaces.
- Baked direct and indirect lighting. Faster, but does not allow for real-time shadows to display on baked surfaces.
A sphere and box are parented to the camera to showcase dynamic object lighting. A ReflectionProbe is parented to the sphere to showcase real-time reflections. When the ReflectionProbe is hidden, it is disabled. In this case, GIProbe or environment lighting will be used to provide fallback reflections.
Screenshots
Licenses
zdm2.glb
is derived from the Cube 2: Sauerbraten
map "zdm2" and is
licensed under CC BY 4.0 Unported.
The OBJ file which it was converted from is available in the game-maps-obj repository.
-
This demo can be made to work with GLES2, but GIProbe will not work. Additionally, lightmaps have to be rebaked with the Atlas > Generate property disabled in BakedLightmap. ↩︎