Daemon
Daemon copied to clipboard
renderer: make r_dynamicLight only enable the related renderer, not a kind of light
Make r_dynamicLight only enable the related renderer, not a kind of light.
With that change,
- r_dynamicLight enables the dynamic light renderer
- r_animatedLight enables the “animated” kind of dynamic lights (weapons, particles…)
- r_staticLight enables the “static” kind of dynamic lights (static map lights)
The animated/static light naming scheme is inspired from the misc_anim_model and misc_model map entities (the later being described as “static” in documentation).
The purpose of that PR is that by disabling r_dynamicLight, the dynamic light renderer is effectively disabled and related GLSL code is not compiled.
Previously, disabling r_dynamicLight but keeping r_staticLight enable was still compiling the GLSL related code, depite no one map uses the feature yet.
The idea is that we would always keep r_animatedLight and r_staticLight enabled, but only enable/disable r_dynamicLight in presets.
This makes possible to not have to add entries for r_staticLight in presets or in game options.
Basically, r_animatedLight and r_staticLight becomes debugging cvars, while r_dynamicLight is kept as a feature cvar.
In the glConfig2 struct,
- dynamicLight is enabled if the engine should run the dynamic light renderer and then allocate related images and compile the related GLSL code. It is enabled if r_dynamicLight cvar enabled and either r_animatedLight or r_staticLight is enabled.
- animatedLight is enabled if the engine should process animated lights. It is enabled if r_dynamicLight and r_animatedLight is enabled.
- staticLight is enabled if the engine should process static lights. It is enabled if r_dynamicLight and r_staticLight is enabled.