Merge pull request #110853 from Kaleb-Reid/compat-fix-reflections

Ensure reflection atlas is valid before rendering
This commit is contained in:
Thaddeus Crews 2025-10-08 13:56:32 -05:00
commit e5ee1911a9
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
3 changed files with 9 additions and 3 deletions

View file

@ -811,6 +811,9 @@ bool LightStorage::reflection_probe_instance_begin_render(RID p_instance, RID p_
ERR_FAIL_NULL_V(atlas, false); ERR_FAIL_NULL_V(atlas, false);
ERR_FAIL_COND_V_MSG(atlas->size < 4, false, "Attempted to render to a reflection atlas of invalid resolution.");
ERR_FAIL_COND_V_MSG(atlas->count < 1, false, "Attempted to render to a reflection atlas of size < 1.");
ReflectionProbeInstance *rpi = reflection_probe_instance_owner.get_or_null(p_instance); ReflectionProbeInstance *rpi = reflection_probe_instance_owner.get_or_null(p_instance);
ERR_FAIL_NULL_V(rpi, false); ERR_FAIL_NULL_V(rpi, false);

View file

@ -1482,6 +1482,9 @@ bool LightStorage::reflection_probe_instance_begin_render(RID p_instance, RID p_
ERR_FAIL_NULL_V(atlas, false); ERR_FAIL_NULL_V(atlas, false);
ERR_FAIL_COND_V_MSG(atlas->size < 2, false, "Attempted to render to a reflection atlas of invalid resolution.");
ERR_FAIL_COND_V_MSG(atlas->count < 1, false, "Attempted to render to a reflection atlas of size < 1.");
ReflectionProbeInstance *rpi = reflection_probe_instance_owner.get_or_null(p_instance); ReflectionProbeInstance *rpi = reflection_probe_instance_owner.get_or_null(p_instance);
ERR_FAIL_NULL_V(rpi, false); ERR_FAIL_NULL_V(rpi, false);

View file

@ -3649,9 +3649,9 @@ void RenderingServer::init() {
GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "rendering/reflections/sky_reflections/ggx_samples", PROPERTY_HINT_RANGE, "0,256,1"), 32); 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(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("rendering/reflections/sky_reflections/fast_filter_high_quality", false);
GLOBAL_DEF_RST(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, "4,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_size.mobile", PROPERTY_HINT_RANGE, "4,2048,1"), 128);
GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/reflections/reflection_atlas/reflection_count", PROPERTY_HINT_RANGE, "0,256,1"), 64); GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/reflections/reflection_atlas/reflection_count", PROPERTY_HINT_RANGE, "1,256,1"), 64);
GLOBAL_DEF_RST("rendering/reflections/specular_occlusion/enabled", true); GLOBAL_DEF_RST("rendering/reflections/specular_occlusion/enabled", true);
GLOBAL_DEF("rendering/global_illumination/gi/use_half_resolution", false); GLOBAL_DEF("rendering/global_illumination/gi/use_half_resolution", false);