Reading punctual lights from glTF

Posted on

3d_fps_game_template_2
3d_fps_game_template
blender screenshot 2020-06-07 00:12:50 selection
fps_game_screen_4
fps_game_screen_3

We can now read lights from the glTF file.

The lights have to follow glTF extension KHR_lights_punctual. It’s a popular extension supported e.g. by Blender -> glTF exporter. So you can just add lights in Blender, export to glTF, open in CGE, and the lights are there!

This works for “punctual” glTF lights, which are converted in a very straightforward fashion to X3D lighting nodes: PointLight, SpotLight, DirectionalLight.

Demos:

Start the discussion at Castle Game Engine Forum