diff options
author | clayjohn <claynjohn@gmail.com> | 2022-07-31 16:20:24 -0700 |
---|---|---|
committer | clayjohn <claynjohn@gmail.com> | 2022-08-31 12:14:46 -0700 |
commit | 385ee5c70b110fc4e6a47c847428bfe3da89e18e (patch) | |
tree | 79a98b11b042372e99ed209f033dd721f5a74e14 /servers/rendering/renderer_rd/shaders/light_data_inc.glsl | |
parent | 736632ee7ed00a3474448cfd227f696f82905ac7 (diff) |
Implement Physical Light Units as an optional setting.
This allows light sources to be specified in physical light units in addition to the regular energy multiplier. In order to avoid loss of precision at high values, brightness values are premultiplied by an exposure normalization value.
In support of Physical Light Units this PR also renames CameraEffects to CameraAttributes.
Diffstat (limited to 'servers/rendering/renderer_rd/shaders/light_data_inc.glsl')
-rw-r--r-- | servers/rendering/renderer_rd/shaders/light_data_inc.glsl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/rendering/renderer_rd/shaders/light_data_inc.glsl b/servers/rendering/renderer_rd/shaders/light_data_inc.glsl index a7fca25a6b..7488a3f2c7 100644 --- a/servers/rendering/renderer_rd/shaders/light_data_inc.glsl +++ b/servers/rendering/renderer_rd/shaders/light_data_inc.glsl @@ -44,7 +44,7 @@ struct ReflectionData { bool exterior; bool box_project; uint ambient_mode; - uint pad; + float exposure_normalization; //0-8 is intensity,8-9 is ambient, mode highp mat4 local_matrix; // up to here for spot and omni, rest is for directional // notes: for ambientblend, use distance to edge to blend between already existing global environment @@ -52,7 +52,7 @@ struct ReflectionData { struct DirectionalLightData { mediump vec3 direction; - mediump float energy; + highp float energy; // needs to be highp to avoid NaNs being created with high energy values (i.e. when using physical light units and over-exposing the image) mediump vec3 color; mediump float size; mediump float specular; |