summaryrefslogtreecommitdiffstats
path: root/servers/rendering/rendering_server_default.h
diff options
context:
space:
mode:
authorjfons <joan.fonssanchez@gmail.com>2021-05-09 18:23:20 +0200
committerjfons <joan.fonssanchez@gmail.com>2021-06-14 12:17:11 +0200
commit3a53ae5d9fe3d8b3dcc686c6a32510e0fe53b19e (patch)
treef4201a9212a4d10309af2067899d0935ee86cd5f /servers/rendering/rendering_server_default.h
parent12e0f10c74e9619262f1edcfdc1840432ada0565 (diff)
downloadredot-engine-3a53ae5d9fe3d8b3dcc686c6a32510e0fe53b19e.tar.gz
Implement visibility range and dependencies.
This commit adds the following properties to GeometryInstance3D: `visibility_range_begin`, `visibility_range_begin_margin`, `visibility_range_end`, `visibility_range_end_margin`. Together they define a range in which the GeometryInstance3D will be visible from the camera, taking hysteresis into account for state changes. A begin or end value of 0 will be ignored, so the visibility range can be open-ended in both directions. This commit also adds the `visibility_parent` property to 'Node3D'. Which defines the visibility parents of the node and its subtree (until another parent is defined). Visual instances with a visibility parent will only be visible when the parent, and all of its ancestors recursively, are hidden because they are closer to the camera than their respective `visibility_range_begin` thresholds. Combining visibility ranges and visibility parents users can set-up a quick HLOD system that shows high detail meshes when close (i.e buildings, trees) and merged low detail meshes for far away groups (i.e. cities, woods).
Diffstat (limited to 'servers/rendering/rendering_server_default.h')
-rw-r--r--servers/rendering/rendering_server_default.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/rendering/rendering_server_default.h b/servers/rendering/rendering_server_default.h
index 6476d7c75d..e4d319ed6c 100644
--- a/servers/rendering/rendering_server_default.h
+++ b/servers/rendering/rendering_server_default.h
@@ -726,6 +726,7 @@ public:
FUNC2(instance_set_exterior, RID, bool)
FUNC2(instance_set_extra_visibility_margin, RID, real_t)
+ FUNC2(instance_set_visibility_parent, RID, RID)
// don't use these in a game!
FUNC2RC(Vector<ObjectID>, instances_cull_aabb, const AABB &, RID)
@@ -736,8 +737,7 @@ public:
FUNC2(instance_geometry_set_cast_shadows_setting, RID, ShadowCastingSetting)
FUNC2(instance_geometry_set_material_override, RID, RID)
- FUNC5(instance_geometry_set_draw_range, RID, float, float, float, float)
- FUNC2(instance_geometry_set_as_instance_lod, RID, RID)
+ FUNC5(instance_geometry_set_visibility_range, RID, float, float, float, float)
FUNC4(instance_geometry_set_lightmap, RID, RID, const Rect2 &, int)
FUNC2(instance_geometry_set_lod_bias, RID, float)