diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2022-02-10 20:08:50 +0100 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2022-02-10 20:12:33 +0100 |
commit | 09563e4bd8fa4dda8802b3b48f111f3c1de499d8 (patch) | |
tree | 3b430af4914933806f06bc583c163c78c41ceb54 | |
parent | 38c851a3fa14983e60f74703fea2178d52358b92 (diff) |
Default to real-time radiance map filter for environment sky reflections
This makes radiance map updates much faster, which improves performance
when rotating the sun in the editor or at run-time.
This real-time filter is also much less prone to "fireflies" that can
appear when using a sky with a bright sun.
-rw-r--r-- | doc/classes/Sky.xml | 2 | ||||
-rw-r--r-- | scene/resources/sky.cpp | 2 | ||||
-rw-r--r-- | scene/resources/sky.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/doc/classes/Sky.xml b/doc/classes/Sky.xml index 79a9bd4b31..66be4bc4f3 100644 --- a/doc/classes/Sky.xml +++ b/doc/classes/Sky.xml @@ -9,7 +9,7 @@ <tutorials> </tutorials> <members> - <member name="process_mode" type="int" setter="set_process_mode" getter="get_process_mode" enum="Sky.ProcessMode" default="0"> + <member name="process_mode" type="int" setter="set_process_mode" getter="get_process_mode" enum="Sky.ProcessMode" default="3"> Sets the method for generating the radiance map from the sky. The radiance map is a cubemap with increasingly blurry versions of the sky corresponding to different levels of roughness. Radiance maps can be expensive to calculate. See [enum ProcessMode] for options. </member> <member name="radiance_size" type="int" setter="set_radiance_size" getter="get_radiance_size" enum="Sky.RadianceSize" default="3"> diff --git a/scene/resources/sky.cpp b/scene/resources/sky.cpp index 9cb6a16f5c..917aa40934 100644 --- a/scene/resources/sky.cpp +++ b/scene/resources/sky.cpp @@ -83,7 +83,7 @@ void Sky::_bind_methods() { ClassDB::bind_method(D_METHOD("get_material"), &Sky::get_material); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "sky_material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,PanoramaSkyMaterial,ProceduralSkyMaterial,PhysicalSkyMaterial"), "set_material", "get_material"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Automatic,HighQuality,HighQualityIncremental,RealTime"), "set_process_mode", "get_process_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Automatic,High Quality (Slow),High Quality Incremental (Average),Real-Time (Fast)"), "set_process_mode", "get_process_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "radiance_size", PROPERTY_HINT_ENUM, "32,64,128,256,512,1024,2048"), "set_radiance_size", "get_radiance_size"); BIND_ENUM_CONSTANT(RADIANCE_SIZE_32); diff --git a/scene/resources/sky.h b/scene/resources/sky.h index 5e52239032..3653568ac6 100644 --- a/scene/resources/sky.h +++ b/scene/resources/sky.h @@ -59,7 +59,7 @@ public: private: RID sky; - ProcessMode mode = PROCESS_MODE_AUTOMATIC; + ProcessMode mode = PROCESS_MODE_REALTIME; RadianceSize radiance_size = RADIANCE_SIZE_256; Ref<Material> sky_material; |