1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-01 16:38:31 +00:00

Various fixes for transmittance effect

Use correct shadow sampling for omni and spot lights

Disable transmittance if shadows are disabled

Correct DirectionalLight transmittance bias to match shadow bias (its still pretty sensitive though)
This commit is contained in:
clayjohn
2024-06-21 18:15:14 -07:00
parent e2fc6d38cb
commit d61fae36f3
3 changed files with 37 additions and 29 deletions

View File

@@ -685,7 +685,7 @@ void LightStorage::update_light_buffers(RenderDataRD *p_render_data, const Paged
float bias_scale = light_instance->shadow_transform[j].bias_scale * light_data.soft_shadow_scale;
light_data.shadow_bias[j] = light->param[RS::LIGHT_PARAM_SHADOW_BIAS] / 100.0 * bias_scale;
light_data.shadow_normal_bias[j] = light->param[RS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] * light_instance->shadow_transform[j].shadow_texel_size;
light_data.shadow_transmittance_bias[j] = light->param[RS::LIGHT_PARAM_TRANSMITTANCE_BIAS] * bias_scale;
light_data.shadow_transmittance_bias[j] = light->param[RS::LIGHT_PARAM_TRANSMITTANCE_BIAS] / 100.0 * bias_scale;
light_data.shadow_z_range[j] = light_instance->shadow_transform[j].farplane;
light_data.shadow_range_begin[j] = light_instance->shadow_transform[j].range_begin;
RendererRD::MaterialStorage::store_camera(shadow_mtx, light_data.shadow_matrices[j]);