Does anyone know how to properly setup occluder instances on the RenderingServer? The interface seems pretty barren at the moment, but I've been trying to set it up similar to a normal visual instance, with no luck.
So far I have tried something like this:
var occluder_instance: RID = RenderingServer.occluder_create()
var vertices: PackedVector3Array = PackedVector3Array()
vertices.append(Vector3(0, 0, 0))
vertices.append(Vector3(10, 0, 0))
vertices.append(Vector3(10, 10, 0))
var indices: PackedInt32Array = PackedInt32Array()
RenderingServer.occluder_set_mesh(occluder_instance, vertices, indices)
- Occlusion culling is also enabled in project settings, which should make the first line unnecessary.
- I'm unsure if the
instance_set_* functions work on occluder instances, but I'm assuming the scenario must be set somehow.
- A reference to
occluder_instance is being kept to ensure it doesn't get freed.
- The occluder is not visible using
get_viewport().debug_draw = Viewport.DEBUG_DRAW_OCCLUDERS