1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

Merge pull request #108206 from Calinou/transparent-viewport-no-ssr-sss-dof

Disable unsupported SSR, SSS, DoF on transparent viewports
This commit is contained in:
Thaddeus Crews
2025-09-16 11:44:48 -05:00
6 changed files with 25 additions and 4 deletions

View File

@@ -1820,9 +1820,13 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co
using_sdfgi = true;
}
if (environment_get_ssr_enabled(p_render_data->environment)) {
using_separate_specular = true;
using_ssr = true;
color_pass_flags |= COLOR_PASS_FLAG_SEPARATE_SPECULAR;
if (!p_render_data->transparent_bg) {
using_separate_specular = true;
using_ssr = true;
color_pass_flags |= COLOR_PASS_FLAG_SEPARATE_SPECULAR;
} else {
WARN_PRINT_ONCE("Screen-space reflections are not supported in viewports with a transparent background. Disabling SSR in transparent viewport.");
}
}
}
@@ -1900,6 +1904,11 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co
bool using_sss = rb_data.is_valid() && !is_reflection_probe && scene_state.used_sss && ss_effects->sss_get_quality() != RS::SUB_SURFACE_SCATTERING_QUALITY_DISABLED;
if (using_sss && p_render_data->transparent_bg) {
WARN_PRINT_ONCE("Sub-surface scattering is not supported in viewports with a transparent background. Disabling SSS in transparent viewport.");
using_sss = false;
}
if ((using_sss || ce_needs_separate_specular) && !using_separate_specular) {
using_separate_specular = true;
color_pass_flags |= COLOR_PASS_FLAG_SEPARATE_SPECULAR;