Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Viewport property to use full floating-point precision #51709

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,14 @@
Sets the screen-space antialiasing mode for the default screen [Viewport]. Screen-space antialiasing works by selectively blurring edges in a post-process shader. It differs from MSAA which takes multiple coverage samples while rendering objects. Screen-space AA methods are typically faster than MSAA and will smooth out specular aliasing, but tend to make scenes appear blurry.
Another way to combat specular aliasing is to enable [member rendering/anti_aliasing/screen_space_roughness_limiter/enabled].
</member>
<member name="rendering/anti_aliasing/quality/use_32_bpc_depth" type="bool" setter="" getter="" default="false">
If [code]true[/code], allocates the root [Viewport]'s framebuffer with full floating-point precision (32-bit) instead of half floating-point precision (16-bit).
[b]Note:[/b] Enabling this setting does not improve rendering quality. Using full floating-point precision is slower, and is generally only needed for advanced shaders that require a high level of precision. To reduce banding, enable [member rendering/anti_aliasing/quality/use_debanding] instead.
[b]Note:[/b] Only available on the Vulkan Clustered backend, not the Vulkan Mobile backend.
</member>
<member name="rendering/anti_aliasing/quality/use_debanding" type="bool" setter="" getter="" default="false">
If [code]true[/code], uses a fast post-processing filter to make banding significantly less visible. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger.
[b]Note:[/b] There are known issues with debanding breaking rendering on mobile platforms. Due to this, it is recommended to leave this option disabled when targeting mobile platforms.
</member>
<member name="rendering/anti_aliasing/screen_space_roughness_limiter/amount" type="float" setter="" getter="" default="0.25">
</member>
Expand Down
7 changes: 7 additions & 0 deletions doc/classes/RenderingServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3176,6 +3176,13 @@
Sets when the viewport should be updated. See [enum ViewportUpdateMode] constants for options.
</description>
</method>
<method name="viewport_set_use_32_bpc_depth">
<return type="void" />
<argument index="0" name="viewport" type="RID" />
<argument index="1" name="enable" type="bool" />
<description>
</description>
</method>
<method name="viewport_set_use_debanding">
<return type="void" />
<argument index="0" name="viewport" type="RID" />
Expand Down
6 changes: 6 additions & 0 deletions doc/classes/Viewport.xml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,13 @@
<member name="transparent_bg" type="bool" setter="set_transparent_background" getter="has_transparent_background" default="false">
If [code]true[/code], the viewport should render its background as transparent.
</member>
<member name="use_32_bpc_depth" type="bool" setter="set_use_32_bpc_depth" getter="get_use_32_bpc_depth" default="false">
If [code]true[/code], allocates the root [Viewport]'s framebuffer with full floating-point precision (32-bit) instead of half floating-point precision (16-bit).
[b]Note:[/b] Enabling this setting does not improve rendering quality. Using full floating-point precision is slower, and is generally only needed for advanced shaders that require a high level of precision. To reduce banding, enable [member use_debanding] instead.
[b]Note:[/b] Only available on the Vulkan Clustered backend, not the Vulkan Mobile backend.
</member>
<member name="use_debanding" type="bool" setter="set_use_debanding" getter="is_using_debanding" default="false">
If [code]true[/code], uses a fast post-processing filter to make banding significantly less visible. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger.
</member>
<member name="use_occlusion_culling" type="bool" setter="set_use_occlusion_culling" getter="is_using_occlusion_culling" default="false">
</member>
Expand Down
2 changes: 2 additions & 0 deletions editor/plugins/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2598,6 +2598,8 @@ void Node3DEditorViewport::_project_settings_changed() {
viewport->set_screen_space_aa(Viewport::ScreenSpaceAA(ssaa_mode));
const bool use_debanding = GLOBAL_GET("rendering/anti_aliasing/quality/use_debanding");
viewport->set_use_debanding(use_debanding);
const bool use_32_bpc_depth = GLOBAL_GET("rendering/anti_aliasing/quality/use_32_bpc_depth");
viewport->set_use_32_bpc_depth(use_32_bpc_depth);

const bool use_occlusion_culling = GLOBAL_GET("rendering/occlusion_culling/use_occlusion_culling");
viewport->set_use_occlusion_culling(use_occlusion_culling);
Expand Down
3 changes: 3 additions & 0 deletions scene/main/scene_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,9 @@ SceneTree::SceneTree() {
const bool use_debanding = GLOBAL_DEF("rendering/anti_aliasing/quality/use_debanding", false);
root->set_use_debanding(use_debanding);

const bool use_32_bpc_depth = GLOBAL_DEF("rendering/anti_aliasing/quality/use_32_bpc_depth", false);
root->set_use_32_bpc_depth(use_32_bpc_depth);

const bool use_occlusion_culling = GLOBAL_DEF("rendering/occlusion_culling/use_occlusion_culling", false);
root->set_use_occlusion_culling(use_occlusion_culling);

Expand Down
17 changes: 17 additions & 0 deletions scene/main/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2809,6 +2809,19 @@ bool Viewport::is_using_debanding() const {
return use_debanding;
}

void Viewport::set_use_32_bpc_depth(bool p_enable) {
if (use_32_bpc_depth == p_enable) {
return;
}

use_32_bpc_depth = p_enable;
RS::get_singleton()->viewport_set_use_32_bpc_depth(viewport, p_enable);
}

bool Viewport::is_using_32_bpc_depth() const {
return use_32_bpc_depth;
}

void Viewport::set_lod_threshold(float p_pixels) {
lod_threshold = p_pixels;
RS::get_singleton()->viewport_set_lod_threshold(viewport, lod_threshold);
Expand Down Expand Up @@ -3480,6 +3493,9 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_use_debanding", "enable"), &Viewport::set_use_debanding);
ClassDB::bind_method(D_METHOD("is_using_debanding"), &Viewport::is_using_debanding);

ClassDB::bind_method(D_METHOD("set_use_32_bpc_depth", "enable"), &Viewport::set_use_32_bpc_depth);
ClassDB::bind_method(D_METHOD("get_use_32_bpc_depth"), &Viewport::is_using_32_bpc_depth);

ClassDB::bind_method(D_METHOD("set_use_occlusion_culling", "enable"), &Viewport::set_use_occlusion_culling);
ClassDB::bind_method(D_METHOD("is_using_occlusion_culling"), &Viewport::is_using_occlusion_culling);

Expand Down Expand Up @@ -3596,6 +3612,7 @@ void Viewport::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "msaa", PROPERTY_HINT_ENUM, String::utf8("Disabled (Fastest),2× (Average),4× (Slow),8× (Slowest)")), "set_msaa", "get_msaa");
ADD_PROPERTY(PropertyInfo(Variant::INT, "screen_space_aa", PROPERTY_HINT_ENUM, "Disabled (Fastest),FXAA (Fast)"), "set_screen_space_aa", "get_screen_space_aa");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_debanding"), "set_use_debanding", "is_using_debanding");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_32_bpc_depth"), "set_use_32_bpc_depth", "get_use_32_bpc_depth");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_occlusion_culling"), "set_use_occlusion_culling", "is_using_occlusion_culling");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lod_threshold", PROPERTY_HINT_RANGE, "0,1024,0.1"), "set_lod_threshold", "get_lod_threshold");
ADD_PROPERTY(PropertyInfo(Variant::INT, "debug_draw", PROPERTY_HINT_ENUM, "Disabled,Unshaded,Overdraw,Wireframe"), "set_debug_draw", "get_debug_draw");
Expand Down
4 changes: 4 additions & 0 deletions scene/main/viewport.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ class Viewport : public Node {
MSAA msaa = MSAA_DISABLED;
ScreenSpaceAA screen_space_aa = SCREEN_SPACE_AA_DISABLED;
bool use_debanding = false;
bool use_32_bpc_depth = false;
float lod_threshold = 1.0;
bool use_occlusion_culling = false;

Expand Down Expand Up @@ -514,6 +515,9 @@ class Viewport : public Node {
void set_use_debanding(bool p_use_debanding);
bool is_using_debanding() const;

void set_use_32_bpc_depth(bool p_enable);
bool is_using_32_bpc_depth() const;

void set_lod_threshold(float p_pixels);
float get_lod_threshold() const;

Expand Down
2 changes: 1 addition & 1 deletion servers/rendering/rasterizer_dummy.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class RasterizerSceneDummy : public RendererSceneRender {
void set_debug_draw_mode(RS::ViewportDebugDraw p_debug_draw) override {}

RID render_buffers_create() override { return RID(); }
void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, RS::ViewportMSAA p_msaa, RS::ViewportScreenSpaceAA p_screen_space_aa, bool p_use_debanding, uint32_t p_view_count) override {}
void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, RS::ViewportMSAA p_msaa, RS::ViewportScreenSpaceAA p_screen_space_aa, bool p_use_debanding, bool p_use_32_bpc_depth, uint32_t p_view_count) override {}
void gi_set_use_half_resolution(bool p_enable) override {}

void screen_space_roughness_limiter_set_active(bool p_enable, float p_amount, float p_curve) override {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void RenderForwardClustered::RenderBufferDataForwardClustered::clear() {
}
}

void RenderForwardClustered::RenderBufferDataForwardClustered::configure(RID p_color_buffer, RID p_depth_buffer, RID p_target_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa, uint32_t p_view_count) {
void RenderForwardClustered::RenderBufferDataForwardClustered::configure(RID p_color_buffer, RID p_depth_buffer, RID p_target_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa, bool p_use_32_bpc_depth, uint32_t p_view_count) {
clear();

ERR_FAIL_COND_MSG(p_view_count != 1, "Multiple views is currently not supported in this renderer, please use the mobile renderer for VR support");
Expand Down Expand Up @@ -212,7 +212,14 @@ void RenderForwardClustered::RenderBufferDataForwardClustered::configure(RID p_c
}
} else {
RD::TextureFormat tf;
tf.format = RD::DATA_FORMAT_R16G16B16A16_SFLOAT;
if (p_use_32_bpc_depth) {
// 32 bpc. Can be useful for advanced shaders, but should not be used
// for general-purpose rendering as it's slower.
tf.format = RD::DATA_FORMAT_R32G32B32A32_SFLOAT;
} else {
// 16 bpc. This is the default HDR mode.
tf.format = RD::DATA_FORMAT_R16G16B16A16_SFLOAT;
}
tf.width = p_width;
tf.height = p_height;
tf.texture_type = RD::TEXTURE_TYPE_2D;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class RenderForwardClustered : public RendererSceneRenderRD {
void ensure_specular();
void ensure_voxelgi();
void clear();
virtual void configure(RID p_color_buffer, RID p_depth_buffer, RID p_target_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa, uint32_t p_view_count);
virtual void configure(RID p_color_buffer, RID p_depth_buffer, RID p_target_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa, bool p_use_32_bpc_depth, uint32_t p_view_count);

~RenderBufferDataForwardClustered();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void RenderForwardMobile::RenderBufferDataForwardMobile::clear() {
}
}

void RenderForwardMobile::RenderBufferDataForwardMobile::configure(RID p_color_buffer, RID p_depth_buffer, RID p_target_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa, uint32_t p_view_count) {
void RenderForwardMobile::RenderBufferDataForwardMobile::configure(RID p_color_buffer, RID p_depth_buffer, RID p_target_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa, bool p_use_32_bpc_depth, uint32_t p_view_count) {
clear();

msaa = p_msaa;
Expand All @@ -98,6 +98,10 @@ void RenderForwardMobile::RenderBufferDataForwardMobile::configure(RID p_color_b
color = p_color_buffer;
depth = p_depth_buffer;

if (p_use_32_bpc_depth) {
WARN_PRINT_ONCE("32 BPC depth is only supported when using the Vulkan clustered renderer, not the Vulkan mobile renderer. Falling back to lower precision.");
}

// We are creating 4 configurations here for our framebuffers.

if (p_msaa == RS::VIEWPORT_MSAA_DISABLED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class RenderForwardMobile : public RendererSceneRenderRD {
uint32_t view_count;

void clear();
virtual void configure(RID p_color_buffer, RID p_depth_buffer, RID p_target_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa, uint32_t p_view_count);
virtual void configure(RID p_color_buffer, RID p_depth_buffer, RID p_target_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa, bool p_use_32_bpc_depth, uint32_t p_view_count);

~RenderBufferDataForwardMobile();
};
Expand Down
13 changes: 10 additions & 3 deletions servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2587,7 +2587,7 @@ bool RendererSceneRenderRD::_render_buffers_can_be_storage() {
return true;
}

void RendererSceneRenderRD::render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, RS::ViewportMSAA p_msaa, RenderingServer::ViewportScreenSpaceAA p_screen_space_aa, bool p_use_debanding, uint32_t p_view_count) {
void RendererSceneRenderRD::render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, RS::ViewportMSAA p_msaa, RenderingServer::ViewportScreenSpaceAA p_screen_space_aa, bool p_use_debanding, bool p_use_32_bpc_depth, uint32_t p_view_count) {
ERR_FAIL_COND_MSG(p_view_count == 0, "Must have at least 1 view");

RenderBuffers *rb = render_buffers_owner.getornull(p_render_buffers);
Expand Down Expand Up @@ -2615,7 +2615,14 @@ void RendererSceneRenderRD::render_buffers_configure(RID p_render_buffers, RID p
if (rb->view_count > 1) {
tf.texture_type = RD::TEXTURE_TYPE_2D_ARRAY;
}
tf.format = _render_buffers_get_color_format();
if (p_use_32_bpc_depth) {
// 32 bpc. Can be useful for advanced shaders, but should not be used
// for general-purpose rendering as it's slower.
tf.format = RD::DATA_FORMAT_R32G32B32A32_SFLOAT;
} else {
// 16 bpc. This is the default HDR mode.
tf.format = RD::DATA_FORMAT_R16G16B16A16_SFLOAT;
}
tf.width = rb->width;
tf.height = rb->height;
tf.array_layers = rb->view_count; // create a layer for every view
Expand Down Expand Up @@ -2662,7 +2669,7 @@ void RendererSceneRenderRD::render_buffers_configure(RID p_render_buffers, RID p
}

RID target_texture = storage->render_target_get_rd_texture(rb->render_target);
rb->data->configure(rb->texture, rb->depth_texture, target_texture, rb->width, rb->height, p_msaa, p_view_count);
rb->data->configure(rb->texture, rb->depth_texture, target_texture, rb->width, rb->height, p_msaa, p_use_32_bpc_depth, p_view_count);

if (is_clustered_enabled()) {
rb->cluster_builder->setup(Size2i(rb->width, rb->height), max_cluster_elements, rb->depth_texture, storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED), rb->texture);
Expand Down
4 changes: 2 additions & 2 deletions servers/rendering/renderer_rd/renderer_scene_render_rd.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class RendererSceneRenderRD : public RendererSceneRender {
double time_step = 0;

struct RenderBufferData {
virtual void configure(RID p_color_buffer, RID p_depth_buffer, RID p_target_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa, uint32_t p_view_count) = 0;
virtual void configure(RID p_color_buffer, RID p_depth_buffer, RID p_target_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa, bool p_use_32_bpc_depth, uint32_t p_view_count) = 0;
virtual ~RenderBufferData() {}
};
virtual RenderBufferData *_create_render_buffer_data() = 0;
Expand Down Expand Up @@ -1194,7 +1194,7 @@ class RendererSceneRenderRD : public RendererSceneRender {
virtual RD::DataFormat _render_buffers_get_color_format();
virtual bool _render_buffers_can_be_storage();
virtual RID render_buffers_create() override;
virtual void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, RS::ViewportMSAA p_msaa, RS::ViewportScreenSpaceAA p_screen_space_aa, bool p_use_debanding, uint32_t p_view_count) override;
virtual void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, RS::ViewportMSAA p_msaa, RS::ViewportScreenSpaceAA p_screen_space_aa, bool p_use_debanding, bool p_use_32_bpc_depth, uint32_t p_view_count) override;
virtual void gi_set_use_half_resolution(bool p_enable) override;

RID render_buffers_get_ao_texture(RID p_render_buffers);
Expand Down
2 changes: 1 addition & 1 deletion servers/rendering/renderer_scene.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class RendererScene {

virtual RID render_buffers_create() = 0;

virtual void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, RS::ViewportMSAA p_msaa, RS::ViewportScreenSpaceAA p_screen_space_aa, bool p_use_debanding, uint32_t p_view_count) = 0;
virtual void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, RS::ViewportMSAA p_msaa, RS::ViewportScreenSpaceAA p_screen_space_aa, bool p_use_debanding, bool p_use_32_bpc_depth, uint32_t p_view_count) = 0;

virtual void gi_set_use_half_resolution(bool p_enable) = 0;

Expand Down
2 changes: 1 addition & 1 deletion servers/rendering/renderer_scene_cull.h
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ class RendererSceneCull : public RendererScene {
/* Render Buffers */

PASS0R(RID, render_buffers_create)
PASS8(render_buffers_configure, RID, RID, int, int, RS::ViewportMSAA, RS::ViewportScreenSpaceAA, bool, uint32_t)
PASS9(render_buffers_configure, RID, RID, int, int, RS::ViewportMSAA, RS::ViewportScreenSpaceAA, bool, bool, uint32_t)
PASS1(gi_set_use_half_resolution, bool)

/* Shadow Atlas */
Expand Down
2 changes: 1 addition & 1 deletion servers/rendering/renderer_scene_render.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class RendererSceneRender {
virtual void set_debug_draw_mode(RS::ViewportDebugDraw p_debug_draw) = 0;

virtual RID render_buffers_create() = 0;
virtual void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, RS::ViewportMSAA p_msaa, RS::ViewportScreenSpaceAA p_screen_space_aa, bool p_use_debanding, uint32_t p_view_count) = 0;
virtual void render_buffers_configure(RID p_render_buffers, RID p_render_target, int p_width, int p_height, RS::ViewportMSAA p_msaa, RS::ViewportScreenSpaceAA p_screen_space_aa, bool p_use_debanding, bool p_use_32_bpc_depth, uint32_t p_view_count) = 0;
virtual void gi_set_use_half_resolution(bool p_enable) = 0;

virtual void screen_space_roughness_limiter_set_active(bool p_enable, float p_amount, float p_limit) = 0;
Expand Down
1 change: 1 addition & 0 deletions servers/rendering/renderer_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ class RendererStorage {
enum RenderTargetFlags {
RENDER_TARGET_TRANSPARENT,
RENDER_TARGET_DIRECT_TO_SCREEN,
RENDER_TARGET_USE_32_BPC_DEPTH,
RENDER_TARGET_FLAG_MAX
};

Expand Down
13 changes: 12 additions & 1 deletion servers/rendering/renderer_viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void RendererViewport::_configure_3d_render_buffers(Viewport *p_viewport) {
default:
break;
}
RSG::scene->render_buffers_configure(p_viewport->render_buffers, p_viewport->render_target, width, height, p_viewport->msaa, p_viewport->screen_space_aa, p_viewport->use_debanding, p_viewport->get_view_count());
RSG::scene->render_buffers_configure(p_viewport->render_buffers, p_viewport->render_target, width, height, p_viewport->msaa, p_viewport->screen_space_aa, p_viewport->use_debanding, p_viewport->use_32_bpc_depth, p_viewport->get_view_count());
}
}
}
Expand Down Expand Up @@ -982,6 +982,17 @@ void RendererViewport::viewport_set_use_debanding(RID p_viewport, bool p_use_deb
_configure_3d_render_buffers(viewport);
}

void RendererViewport::viewport_set_use_32_bpc_depth(RID p_viewport, bool p_use_32_bpc_depth) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);

if (viewport->use_32_bpc_depth == p_use_32_bpc_depth) {
return;
}
viewport->use_32_bpc_depth = p_use_32_bpc_depth;
_configure_3d_render_buffers(viewport);
}

void RendererViewport::viewport_set_use_occlusion_culling(RID p_viewport, bool p_use_occlusion_culling) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
ERR_FAIL_COND(!viewport);
Expand Down
3 changes: 3 additions & 0 deletions servers/rendering/renderer_viewport.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class RendererViewport {
RS::ViewportMSAA msaa;
RS::ViewportScreenSpaceAA screen_space_aa;
bool use_debanding;
bool use_32_bpc_depth;

bool use_occlusion_culling;
bool occlusion_buffer_dirty;
Expand Down Expand Up @@ -150,6 +151,7 @@ class RendererViewport {
msaa = RS::VIEWPORT_MSAA_DISABLED;
screen_space_aa = RS::VIEWPORT_SCREEN_SPACE_AA_DISABLED;
use_debanding = false;
use_32_bpc_depth = false;
use_occlusion_culling = false;
occlusion_buffer_dirty = true;

Expand Down Expand Up @@ -244,6 +246,7 @@ class RendererViewport {
void viewport_set_msaa(RID p_viewport, RS::ViewportMSAA p_msaa);
void viewport_set_screen_space_aa(RID p_viewport, RS::ViewportScreenSpaceAA p_mode);
void viewport_set_use_debanding(RID p_viewport, bool p_use_debanding);
void viewport_set_use_32_bpc_depth(RID p_viewport, bool p_use_32_bpc_depth);
void viewport_set_use_occlusion_culling(RID p_viewport, bool p_use_occlusion_culling);
void viewport_set_occlusion_rays_per_thread(int p_rays_per_thread);
void viewport_set_occlusion_culling_build_quality(RS::ViewportOcclusionCullingBuildQuality p_quality);
Expand Down
Loading