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:
-
demo-models/gltf/punctual_lights (open the glTF file there in view3dscene or adjust any engine example to open it using
TCastleScene.Load
). -
examples/fps_game (level now includes lights designed in Blender and exported to glTF).
-
Editor template for 3d_fps_game (as above, the lights are now designed in Blender and exported to glTF).