You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-28 16:07:14 +00:00
Fix transparent viewport backgrounds with custom clear color
This commit is contained in:
@@ -908,13 +908,19 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color
|
||||
{
|
||||
// regular forward for now
|
||||
Vector<Color> c;
|
||||
c.push_back(clear_color.srgb_to_linear()); // our render buffer
|
||||
if (rb_data.is_valid()) {
|
||||
if (p_render_data->render_buffers->get_msaa_3d() != RS::VIEWPORT_MSAA_DISABLED) {
|
||||
c.push_back(clear_color.srgb_to_linear()); // our resolve buffer
|
||||
{
|
||||
Color cc = clear_color.srgb_to_linear();
|
||||
if (rb_data.is_valid()) {
|
||||
cc.a = 0; // For transparent viewport backgrounds.
|
||||
}
|
||||
if (using_subpass_post_process) {
|
||||
c.push_back(Color()); // our 2D buffer we're copying into
|
||||
c.push_back(cc); // Our render buffer.
|
||||
if (rb_data.is_valid()) {
|
||||
if (p_render_data->render_buffers->get_msaa_3d() != RS::VIEWPORT_MSAA_DISABLED) {
|
||||
c.push_back(clear_color.srgb_to_linear()); // Our resolve buffer.
|
||||
}
|
||||
if (using_subpass_post_process) {
|
||||
c.push_back(Color()); // Our 2D buffer we're copying into.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user