We’re proud to announce a big new feature in Castle Game Engine: new light components that allow to easily manipulate lights (from the editor and from Pascal code) and a number of related improvements.
I’ve made a video presentation that describes everything, enjoy! And read below the movie for more information.
New features details:
New components to define light nodes:
TCastleDirectionalLight. Descendants of
TCastleTransform, which can be easily added and manipulated from the editor and from Pascal code.
TCastleRenderOptions.PhongShadingis now by default true. In short, it means that the lights look pretty. If you want to use Gouraud shading for efficiency, just change
Note: using some features (normal maps, PBR, shadow maps) requires Phong shading anyway, and will override this.
TCastleRenderOptions.DefaultMaxLightsPerShapeis now by default a big number: 64 instead of previous 8. Remember that each light has a cost, esp. as we use classic “forward rendering” right now in CGE. So try to limit the number of lights that affect given shape anyway, try to stay well below the 64 limit. The simplest way to do this is to use reasonable
Radiuson point and spot lights, and limit the number of directional lights that affect all scenes.
SpotLight defaults adjusted, matching also X3D 4.0 changes:
beamWidthby default is now
pi * 3 / 16, so it shows a small falloff until
Proper calculation and optimization of lights radius when lights are in a different scene than shape they shine on.
TCastleEnvironmentLight and shadows properties on lights, to easily activate shadow maps.
Do you enjoy this feature? Please support us on Patreon.