Base node for geometry-based visual instances.
    public abstract class GeometryInstance : VisualInstance

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

Inheritance Chain

Derived Classes

Properties

    public ShadowCastingSetting CastShadow { get; set; }

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

    public float ExtraCullMargin { get; set; }

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

    public float LodMaxDistance { get; set; }

The GeometryInstance’s max LOD distance.

Note: This property currently has no effect.

    public float LodMaxHysteresis { get; set; }

The GeometryInstance’s max LOD margin.

Note: This property currently has no effect.

    public float LodMinDistance { get; set; }

The GeometryInstance’s min LOD distance.

Note: This property currently has no effect.

    public float LodMinHysteresis { get; set; }

The GeometryInstance’s min LOD margin.

Note: This property currently has no effect.

    public Material MaterialOverride { get; set; }

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.

    public bool UseInBakedLight { get; set; }

If true, this GeometryInstance will be used when baking lights using a GIProbe or BakedLightmap.

Methods

    [Obsolete("GetCastShadowsSetting is deprecated. Use the CastShadow property instead.")]
    public ShadowCastingSetting GetCastShadowsSetting()

Getter for CastShadow

    [Obsolete("GetExtraCullMargin is deprecated. Use the ExtraCullMargin property instead.")]
    public float GetExtraCullMargin()

Getter for ExtraCullMargin

    [Obsolete("GetFlag is deprecated. Use the UseInBakedLight property instead.")]
    public bool GetFlag(Flags flag)

    [Obsolete("GetLodMaxDistance is deprecated. Use the LodMaxDistance property instead.")]
    public float GetLodMaxDistance()

Getter for LodMaxDistance

    [Obsolete("GetLodMaxHysteresis is deprecated. Use the LodMaxHysteresis property instead.")]
    public float GetLodMaxHysteresis()

Getter for LodMaxHysteresis

    [Obsolete("GetLodMinDistance is deprecated. Use the LodMinDistance property instead.")]
    public float GetLodMinDistance()

Getter for LodMinDistance

    [Obsolete("GetLodMinHysteresis is deprecated. Use the LodMinHysteresis property instead.")]
    public float GetLodMinHysteresis()

Getter for LodMinHysteresis

    [Obsolete("GetMaterialOverride is deprecated. Use the MaterialOverride property instead.")]
    public Material GetMaterialOverride()

Getter for MaterialOverride

    [Obsolete("SetCastShadowsSetting is deprecated. Use the CastShadow property instead.")]
    public void SetCastShadowsSetting(ShadowCastingSetting shadowCastingSetting)

Setter for CastShadow

    public void SetCustomAabb(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.

    [Obsolete("SetExtraCullMargin is deprecated. Use the ExtraCullMargin property instead.")]
    public void SetExtraCullMargin(float margin)

Setter for ExtraCullMargin

    [Obsolete("SetFlag is deprecated. Use the UseInBakedLight property instead.")]
    public void SetFlag(Flags flag, bool value)

    [Obsolete("SetLodMaxDistance is deprecated. Use the LodMaxDistance property instead.")]
    public void SetLodMaxDistance(float mode)

Setter for LodMaxDistance

    [Obsolete("SetLodMaxHysteresis is deprecated. Use the LodMaxHysteresis property instead.")]
    public void SetLodMaxHysteresis(float mode)

Setter for LodMaxHysteresis

    [Obsolete("SetLodMinDistance is deprecated. Use the LodMinDistance property instead.")]
    public void SetLodMinDistance(float mode)

Setter for LodMinDistance

    [Obsolete("SetLodMinHysteresis is deprecated. Use the LodMinHysteresis property instead.")]
    public void SetLodMinHysteresis(float mode)

Setter for LodMinHysteresis

    [Obsolete("SetMaterialOverride is deprecated. Use the MaterialOverride property instead.")]
    public void SetMaterialOverride(Material material)

Setter for MaterialOverride

Inner Types

Flags

Name Value Description
UseBakedLight 0 Will allow the GeometryInstance to be used when baking lights using a [GIProbe] or [BakedLightmap].
DrawNextFrameIfVisible 1 Unused in this class, exposed for consistency with [enum VisualServer.InstanceFlags].
Max 2 Represents the size of the [enum Flags] enum.

ShadowCastingSetting

Name Value Description
Off 0 Will not cast any shadows.
On 1 Will cast shadows from all visible faces in the GeometryInstance.
Will take culling into account, so faces not being rendered will not be taken into account when shadow casting.    
DoubleSided 2 Will cast shadows from all visible faces in the GeometryInstance.
Will not take culling into account, so all faces will be taken into account when shadow casting.    
ShadowsOnly 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.    
Tags: