diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-01-07 00:05:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-07 00:05:43 +0100 |
commit | 9e9726213251b42283994e231919458ddcf1c982 (patch) | |
tree | 1738d3d0d32fe2b710ca80904323740df92c0021 | |
parent | 4deb55956bb18d23f416677d173bb9f15b6b4fec (diff) | |
parent | bf339842a530e4e21beb395b9b4eea97c9578e0e (diff) |
Merge pull request #56170 from Calinou/renderingserver-expose-gi-half-resolution
-rw-r--r-- | doc/classes/ProjectSettings.xml | 2 | ||||
-rw-r--r-- | doc/classes/RenderingServer.xml | 7 | ||||
-rw-r--r-- | servers/rendering_server.cpp | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 2065c59d18..7034fc1f75 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -1691,6 +1691,8 @@ <member name="rendering/gles2/compatibility/enable_high_float.Android" type="bool" setter="" getter="" default="false"> </member> <member name="rendering/global_illumination/gi/use_half_resolution" type="bool" setter="" getter="" default="false"> + If [code]true[/code], renders [VoxelGI] and SDFGI ([member Environment.sdfgi_enabled]) buffers at halved resolution (e.g. 960×540 when the viewport size is 1920×1080). This improves performance significantly when VoxelGI or SDFGI is enabled, at the cost of artifacts that may be visible on polygon edges. The loss in quality becomes less noticeable as the viewport resolution increases. [LightmapGI] rendering is not affected by this setting. + [b]Note:[/b] This property is only read when the project starts. To set half-resolution GI at run-time, call [method RenderingServer.gi_set_use_half_resolution] instead. </member> <member name="rendering/global_illumination/sdfgi/frames_to_converge" type="int" setter="" getter="" default="4"> </member> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 45b587246f..009e9d3df4 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -1265,6 +1265,13 @@ Returns the id of a white texture. Creates one if none exists. </description> </method> + <method name="gi_set_use_half_resolution"> + <return type="void" /> + <argument index="0" name="half_resolution" type="bool" /> + <description> + If [code]half_resolution[/code] is [code]true[/code], renders [VoxelGI] and SDFGI ([member Environment.sdfgi_enabled]) buffers at halved resolution (e.g. 960×540 when the viewport size is 1920×1080). This improves performance significantly when VoxelGI or SDFGI is enabled, at the cost of artifacts that may be visible on polygon edges. The loss in quality becomes less noticeable as the viewport resolution increases. [LightmapGI] rendering is not affected by this setting. See also [member ProjectSettings.rendering/global_illumination/gi/use_half_resolution]. + </description> + </method> <method name="global_variable_add"> <return type="void" /> <argument index="0" name="name" type="StringName" /> diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 41841d241c..a94f70e20f 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -2000,6 +2000,10 @@ void RenderingServer::_bind_methods() { BIND_ENUM_CONSTANT(DECAL_FILTER_LINEAR_MIPMAPS); BIND_ENUM_CONSTANT(DECAL_FILTER_LINEAR_MIPMAPS_ANISOTROPIC); + /* GI API (affects VoxelGI and SDFGI) */ + + ClassDB::bind_method(D_METHOD("gi_set_use_half_resolution", "half_resolution"), &RenderingServer::gi_set_use_half_resolution); + /* VOXEL GI API */ ClassDB::bind_method(D_METHOD("voxel_gi_create"), &RenderingServer::voxel_gi_create); |