Merge pull request #109186 from clayjohn/reflection-probe-size-update

Prompt editor restart when reflection probe size is updated
This commit is contained in:
Thaddeus Crews 2025-09-30 18:34:57 -05:00
commit c28b6c2ced
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
6 changed files with 5 additions and 22 deletions

View file

@ -3350,12 +3350,12 @@
Sets the render reflection mask for this reflection probe. Only instances with a matching layer will have reflections applied from this probe. Equivalent to [member ReflectionProbe.reflection_mask].
</description>
</method>
<method name="reflection_probe_set_resolution">
<method name="reflection_probe_set_resolution" deprecated="This method has not done anything since Godot 3.">
<return type="void" />
<param index="0" name="probe" type="RID" />
<param index="1" name="resolution" type="int" />
<description>
Sets the resolution to use when rendering the specified reflection probe. The [param resolution] is specified for each cubemap face: for instance, specifying [code]512[/code] will allocate 6 faces of 512×512 each (plus mipmaps for roughness levels).
Deprecated. This method does nothing.
</description>
</method>
<method name="reflection_probe_set_size">

View file

@ -562,10 +562,7 @@ void LightStorage::reflection_probe_set_reflection_mask(RID p_probe, uint32_t p_
}
void LightStorage::reflection_probe_set_resolution(RID p_probe, int p_resolution) {
ReflectionProbe *reflection_probe = reflection_probe_owner.get_or_null(p_probe);
ERR_FAIL_NULL(reflection_probe);
reflection_probe->resolution = p_resolution;
WARN_PRINT_ONCE("reflection_probe_set_resolution is not available in Godot 4. ReflectionProbe size is configured in the project settings with the rendering/reflections/reflection_atlas/reflection_size setting.");
}
AABB LightStorage::reflection_probe_get_aabb(RID p_probe) const {

View file

@ -113,7 +113,6 @@ struct LightInstance {
struct ReflectionProbe {
RS::ReflectionProbeUpdateMode update_mode = RS::REFLECTION_PROBE_UPDATE_ONCE;
int resolution = 256;
float intensity = 1.0;
float blend_distance = 1.0;
RS::ReflectionProbeAmbientMode ambient_mode = RS::REFLECTION_PROBE_AMBIENT_ENVIRONMENT;

View file

@ -1169,11 +1169,7 @@ void LightStorage::reflection_probe_set_reflection_mask(RID p_probe, uint32_t p_
}
void LightStorage::reflection_probe_set_resolution(RID p_probe, int p_resolution) {
ReflectionProbe *reflection_probe = reflection_probe_owner.get_or_null(p_probe);
ERR_FAIL_NULL(reflection_probe);
ERR_FAIL_COND(p_resolution < 32);
reflection_probe->resolution = p_resolution;
WARN_PRINT_ONCE("reflection_probe_set_resolution is not available in Godot 4. ReflectionProbe size is configured in the project settings with the rendering/reflections/reflection_atlas/reflection_size setting.");
}
void LightStorage::reflection_probe_set_mesh_lod_threshold(RID p_probe, float p_ratio) {
@ -1259,13 +1255,6 @@ float LightStorage::reflection_probe_get_mesh_lod_threshold(RID p_probe) const {
return reflection_probe->mesh_lod_threshold;
}
int LightStorage::reflection_probe_get_resolution(RID p_probe) const {
const ReflectionProbe *reflection_probe = reflection_probe_owner.get_or_null(p_probe);
ERR_FAIL_NULL_V(reflection_probe, 0);
return reflection_probe->resolution;
}
float LightStorage::reflection_probe_get_baked_exposure(RID p_probe) const {
const ReflectionProbe *reflection_probe = reflection_probe_owner.get_or_null(p_probe);
ERR_FAIL_NULL_V(reflection_probe, 1.0);

View file

@ -220,7 +220,6 @@ private:
struct ReflectionProbe {
RS::ReflectionProbeUpdateMode update_mode = RS::REFLECTION_PROBE_UPDATE_ONCE;
int resolution = 256;
float intensity = 1.0;
float blend_distance = 1.0;
RS::ReflectionProbeAmbientMode ambient_mode = RS::REFLECTION_PROBE_AMBIENT_ENVIRONMENT;
@ -864,7 +863,6 @@ public:
virtual float reflection_probe_get_origin_max_distance(RID p_probe) const override;
virtual float reflection_probe_get_mesh_lod_threshold(RID p_probe) const override;
int reflection_probe_get_resolution(RID p_probe) const;
float reflection_probe_get_baked_exposure(RID p_probe) const;
virtual bool reflection_probe_renders_shadows(RID p_probe) const override;

View file

@ -3649,7 +3649,7 @@ void RenderingServer::init() {
GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "rendering/reflections/sky_reflections/ggx_samples", PROPERTY_HINT_RANGE, "0,256,1"), 32);
GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/reflections/sky_reflections/ggx_samples.mobile", PROPERTY_HINT_RANGE, "0,128,1"), 16);
GLOBAL_DEF("rendering/reflections/sky_reflections/fast_filter_high_quality", false);
GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/reflections/reflection_atlas/reflection_size", PROPERTY_HINT_RANGE, "0,4096,1"), 256);
GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "rendering/reflections/reflection_atlas/reflection_size", PROPERTY_HINT_RANGE, "0,4096,1"), 256);
GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/reflections/reflection_atlas/reflection_size.mobile", PROPERTY_HINT_RANGE, "0,2048,1"), 128);
GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/reflections/reflection_atlas/reflection_count", PROPERTY_HINT_RANGE, "0,256,1"), 64);
GLOBAL_DEF_RST("rendering/reflections/specular_occlusion/enabled", true);