diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2020-12-18 16:19:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-18 16:19:12 +0100 |
commit | 7ad29ed64e850fd43ba7ceb1cfaab4e015ef7b97 (patch) | |
tree | f1d46d8194f01e56cd3a4d042b9b33ba728c6f62 /servers/rendering/renderer_rd/renderer_storage_rd.cpp | |
parent | 36b4e035dc7c410c29cda4446f8daa2e00a31da0 (diff) | |
parent | d2302f53d6ad80943e7f4245ac572003f1681d00 (diff) |
Merge pull request #44468 from reduz/implement-lod
Implement automatic LOD (Level of Detail)
Diffstat (limited to 'servers/rendering/renderer_rd/renderer_storage_rd.cpp')
-rw-r--r-- | servers/rendering/renderer_rd/renderer_storage_rd.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp index 286281c83d..348f5c121e 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp @@ -5645,6 +5645,15 @@ void RendererStorageRD::reflection_probe_set_resolution(RID p_probe, int p_resol reflection_probe->resolution = p_resolution; } +void RendererStorageRD::reflection_probe_set_lod_threshold(RID p_probe, float p_ratio) { + ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!reflection_probe); + + reflection_probe->lod_threshold = p_ratio; + + reflection_probe->instance_dependency.instance_notify_changed(true, false); +} + AABB RendererStorageRD::reflection_probe_get_aabb(RID p_probe) const { const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); ERR_FAIL_COND_V(!reflection_probe, AABB()); @@ -5698,6 +5707,13 @@ float RendererStorageRD::reflection_probe_get_origin_max_distance(RID p_probe) c return reflection_probe->max_distance; } +float RendererStorageRD::reflection_probe_get_lod_threshold(RID p_probe) const { + const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!reflection_probe, 0); + + return reflection_probe->lod_threshold; +} + int RendererStorageRD::reflection_probe_get_resolution(RID p_probe) const { const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); ERR_FAIL_COND_V(!reflection_probe, 0); |