GeometryInstance3D

Inherits: VisualInstance3D < Node3D < Node < Object

Inherited By: CPUParticles3D, CSGShape3D, GPUParticles3D, MeshInstance3D, MultiMeshInstance3D, SpriteBase3D

Base node for geometry-based visual instances.

Description

Base node for geometry-based visual instances. Shares some common functionality like visibility and custom materials.

Methods

Variant

get_shader_instance_uniform ( StringName uniform ) const

void

set_custom_aabb ( AABB aabb )

void

set_shader_instance_uniform ( StringName uniform, Variant value )

Enumerations

enum ShadowCastingSetting:

  • SHADOW_CASTING_SETTING_OFF = 0 --- Will not cast any shadows.

  • SHADOW_CASTING_SETTING_ON = 1 --- Will cast shadows from all visible faces in the GeometryInstance3D.

Will take culling into account, so faces not being rendered will not be taken into account when shadow casting.

  • SHADOW_CASTING_SETTING_DOUBLE_SIDED = 2 --- Will cast shadows from all visible faces in the GeometryInstance3D.

Will not take culling into account, so all faces will be taken into account when shadow casting.

  • SHADOW_CASTING_SETTING_SHADOWS_ONLY = 3 --- Will only show the shadows casted from this object.

In other words, the actual mesh will not be visible, only the shadows casted from the mesh will be.


enum GIMode:

  • GI_MODE_DISABLED = 0

  • GI_MODE_BAKED = 1

  • GI_MODE_DYNAMIC = 2


enum LightmapScale:

  • LIGHTMAP_SCALE_1X = 0

  • LIGHTMAP_SCALE_2X = 1

  • LIGHTMAP_SCALE_4X = 2

  • LIGHTMAP_SCALE_8X = 3

  • LIGHTMAP_SCALE_MAX = 4

Property Descriptions

Default

1

Setter

set_cast_shadows_setting(value)

Getter

get_cast_shadows_setting()

The selected shadow casting flag. See ShadowCastingSetting for possible values.


  • float extra_cull_margin

Default

0.0

Setter

set_extra_cull_margin(value)

Getter

get_extra_cull_margin()

The extra distance added to the GeometryInstance3D's bounding box (AABB) to increase its cull box.


Default

0

Setter

set_lightmap_scale(value)

Getter

get_lightmap_scale()


Default

0

Setter

set_gi_mode(value)

Getter

get_gi_mode()


  • bool ignore_occlusion_culling

Default

false

Setter

set_ignore_occlusion_culling(value)

Getter

is_ignoring_occlusion_culling()


Default

1.0

Setter

set_lod_bias(value)

Getter

get_lod_bias()


Setter

set_material_override(value)

Getter

get_material_override()

The material override for the whole geometry.

If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh.


  • float visibility_range_begin

Default

0.0

Setter

set_visibility_range_begin(value)

Getter

get_visibility_range_begin()

Starting distance from which the GeometryInstance3D will be visible, taking visibility_range_begin_margin into account as well. The default value of 0 is used to disable the range check.


  • float visibility_range_begin_margin

Default

0.0

Setter

set_visibility_range_begin_margin(value)

Getter

get_visibility_range_begin_margin()

Margin for the visibility_range_begin threshold. The GeometryInstance3D will only change its visibility state when it goes over or under the visibility_range_begin threshold by this amount.


  • float visibility_range_end

Default

0.0

Setter

set_visibility_range_end(value)

Getter

get_visibility_range_end()

Distance from which the GeometryInstance3D will be hidden, taking visibility_range_end_margin into account as well. The default value of 0 is used to disable the range check..


  • float visibility_range_end_margin

Default

0.0

Setter

set_visibility_range_end_margin(value)

Getter

get_visibility_range_end_margin()

Margin for the visibility_range_end threshold. The GeometryInstance3D will only change its visibility state when it goes over or under the visibility_range_end threshold by this amount.

Method Descriptions


  • void set_custom_aabb ( AABB aabb )

Overrides the bounding box of this node with a custom one. To remove it, set an AABB with all fields set to zero.