1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Disable unsupported SSR, SSS, DoF on transparent viewports

For technical reasons, transparent viewports cannot support
screen-space reflections, subsurface scattering and depth of field.
Previously, enabling any of these would turn transparent viewports
invisible.
This commit is contained in:
Hugo Locurcio
2025-07-02 17:53:50 +02:00
parent efb40c1524
commit 1c62ba40b7
6 changed files with 25 additions and 4 deletions

View File

@@ -478,7 +478,14 @@ void RendererSceneRenderRD::_render_buffers_post_process_and_tonemap(const Rende
bool dest_is_msaa_2d = rb->get_view_count() == 1 && texture_storage->render_target_get_msaa(render_target) != RS::VIEWPORT_MSAA_DISABLED;
if (can_use_effects && RSG::camera_attributes->camera_attributes_uses_dof(p_render_data->camera_attributes)) {
bool using_dof = RSG::camera_attributes->camera_attributes_uses_dof(p_render_data->camera_attributes);
if (using_dof && p_render_data->transparent_bg) {
WARN_PRINT_ONCE("Depth of field is not supported in viewports with a transparent background. Disabling DoF in transparent viewport.");
using_dof = false;
}
if (can_use_effects && using_dof) {
RENDER_TIMESTAMP("Depth of Field");
RD::get_singleton()->draw_command_begin_label("DOF");