GeometryInstance3D

package
v0.0.0-...-0d6c339 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsGeometryInstance3D() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsGeometryInstance3D

func (self *Extension[T]) AsGeometryInstance3D() Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsNode3D

func (self *Extension[T]) AsNode3D() Node3D.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsVisualInstance3D

func (self *Extension[T]) AsVisualInstance3D() VisualInstance3D.Instance

type GIMode

type GIMode int //gd:GeometryInstance3D.GIMode
const (
	// Disabled global illumination mode. Use for dynamic objects that do not contribute to global illumination (such as characters). When using [graphics.gd/classdb/VoxelGI] and SDFGI, the geometry will receive indirect lighting and reflections but the geometry will not be considered in GI baking.
	GiModeDisabled GIMode = 0
	// Baked global illumination mode. Use for static objects that contribute to global illumination (such as level geometry). This GI mode is effective when using [graphics.gd/classdb/VoxelGI], SDFGI and [graphics.gd/classdb/LightmapGI].
	GiModeStatic GIMode = 1
	// Dynamic global illumination mode. Use for dynamic objects that contribute to global illumination. This GI mode is only effective when using [graphics.gd/classdb/VoxelGI], but it has a higher performance impact than [GiModeStatic]. When using other GI methods, this will act the same as [GiModeDisabled]. When using [graphics.gd/classdb/LightmapGI], the object will receive indirect lighting using lightmap probes instead of using the baked lightmap texture.
	GiModeDynamic GIMode = 2
)

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.GeometryInstance3D

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsGeometryInstance3D

func (self Instance) AsGeometryInstance3D() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode3D

func (self Instance) AsNode3D() Node3D.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsVisualInstance3D

func (self Instance) AsVisualInstance3D() VisualInstance3D.Instance

func (Instance) CastShadow

func (self Instance) CastShadow() ShadowCastingSetting

func (Instance) CustomAabb

func (self Instance) CustomAabb() AABB.PositionSize

func (Instance) ExtraCullMargin

func (self Instance) ExtraCullMargin() Float.X

func (Instance) GetInstanceShaderParameter

func (self Instance) GetInstanceShaderParameter(name string) any

Get the value of a shader parameter as set on this instance.

func (Instance) GiLightmapScale

func (self Instance) GiLightmapScale() LightmapScale

func (Instance) GiLightmapTexelScale

func (self Instance) GiLightmapTexelScale() Float.X

func (Instance) GiMode

func (self Instance) GiMode() GIMode

func (Instance) ID

func (self Instance) ID() ID

func (Instance) IgnoreOcclusionCulling

func (self Instance) IgnoreOcclusionCulling() bool

func (Instance) LodBias

func (self Instance) LodBias() Float.X

func (Instance) MaterialOverlay

func (self Instance) MaterialOverlay() Material.Instance

func (Instance) MaterialOverride

func (self Instance) MaterialOverride() Material.Instance

func (Instance) SetCastShadow

func (self Instance) SetCastShadow(value ShadowCastingSetting)

func (Instance) SetCustomAabb

func (self Instance) SetCustomAabb(value AABB.PositionSize)

func (Instance) SetExtraCullMargin

func (self Instance) SetExtraCullMargin(value Float.X)

func (Instance) SetGiLightmapScale

func (self Instance) SetGiLightmapScale(value LightmapScale)

func (Instance) SetGiLightmapTexelScale

func (self Instance) SetGiLightmapTexelScale(value Float.X)

func (Instance) SetGiMode

func (self Instance) SetGiMode(value GIMode)

func (Instance) SetIgnoreOcclusionCulling

func (self Instance) SetIgnoreOcclusionCulling(value bool)

func (Instance) SetInstanceShaderParameter

func (self Instance) SetInstanceShaderParameter(name string, value any)

Set the value of a shader uniform for this instance only (per-instance uniform). See also graphics.gd/classdb/ShaderMaterial.Instance.SetShaderParameter to assign a uniform on all instances using the same graphics.gd/classdb/ShaderMaterial.

Note: For a shader uniform to be assignable on a per-instance basis, it must be defined with instance uniform ... rather than uniform ... in the shader code.

Note: 'name' is case-sensitive and must match the name of the uniform in the code exactly (not the capitalized name in the inspector).

Note: Per-instance shader uniforms are only available in Spatial and CanvasItem shaders, but not for Fog, Sky, or Particles shaders.

func (Instance) SetLodBias

func (self Instance) SetLodBias(value Float.X)

func (Instance) SetMaterialOverlay

func (self Instance) SetMaterialOverlay(value Material.Instance)

func (Instance) SetMaterialOverride

func (self Instance) SetMaterialOverride(value Material.Instance)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetTransparency

func (self Instance) SetTransparency(value Float.X)

func (Instance) SetVisibilityRangeBegin

func (self Instance) SetVisibilityRangeBegin(value Float.X)

func (Instance) SetVisibilityRangeBeginMargin

func (self Instance) SetVisibilityRangeBeginMargin(value Float.X)

func (Instance) SetVisibilityRangeEnd

func (self Instance) SetVisibilityRangeEnd(value Float.X)

func (Instance) SetVisibilityRangeEndMargin

func (self Instance) SetVisibilityRangeEndMargin(value Float.X)

func (Instance) SetVisibilityRangeFadeMode

func (self Instance) SetVisibilityRangeFadeMode(value VisibilityRangeFadeMode)

func (Instance) Transparency

func (self Instance) Transparency() Float.X

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

func (Instance) VisibilityRangeBegin

func (self Instance) VisibilityRangeBegin() Float.X

func (Instance) VisibilityRangeBeginMargin

func (self Instance) VisibilityRangeBeginMargin() Float.X

func (Instance) VisibilityRangeEnd

func (self Instance) VisibilityRangeEnd() Float.X

func (Instance) VisibilityRangeEndMargin

func (self Instance) VisibilityRangeEndMargin() Float.X

func (Instance) VisibilityRangeFadeMode

func (self Instance) VisibilityRangeFadeMode() VisibilityRangeFadeMode

type LightmapScale

type LightmapScale int //gd:GeometryInstance3D.LightmapScale
const (
	// The standard texel density for lightmapping with [graphics.gd/classdb/LightmapGI].
	LightmapScale1x LightmapScale = 0
	// Multiplies texel density by 2× for lightmapping with [graphics.gd/classdb/LightmapGI]. To ensure consistency in texel density, use this when scaling a mesh by a factor between 1.5 and 3.0.
	LightmapScale2x LightmapScale = 1
	// Multiplies texel density by 4× for lightmapping with [graphics.gd/classdb/LightmapGI]. To ensure consistency in texel density, use this when scaling a mesh by a factor between 3.0 and 6.0.
	LightmapScale4x LightmapScale = 2
	// Multiplies texel density by 8× for lightmapping with [graphics.gd/classdb/LightmapGI]. To ensure consistency in texel density, use this when scaling a mesh by a factor greater than 6.0.
	LightmapScale8x LightmapScale = 3
	// Represents the size of the [LightmapScale] enum.
	LightmapScaleMax LightmapScale = 4
)

type ShadowCastingSetting

type ShadowCastingSetting int //gd:GeometryInstance3D.ShadowCastingSetting
const (
	// Will not cast any shadows. Use this to improve performance for small geometry that is unlikely to cast noticeable shadows (such as debris).
	ShadowCastingSettingOff ShadowCastingSetting = 0
	// 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.
	ShadowCastingSettingOn ShadowCastingSetting = 1
	// 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.
	ShadowCastingSettingDoubleSided ShadowCastingSetting = 2
	// 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.
	ShadowCastingSettingShadowsOnly ShadowCastingSetting = 3
)

type VisibilityRangeFadeMode

type VisibilityRangeFadeMode int //gd:GeometryInstance3D.VisibilityRangeFadeMode
const (
	// Will not fade itself nor its visibility dependencies, hysteresis will be used instead. This is the fastest approach to manual LOD, but it can result in noticeable LOD transitions depending on how the LOD meshes are authored. See [Instance.VisibilityRangeBegin] and [graphics.gd/classdb/Node3D.Instance.VisibilityParent] for more information.
	VisibilityRangeFadeDisabled VisibilityRangeFadeMode = 0
	// Will fade-out itself when reaching the limits of its own visibility range. This is slower than [VisibilityRangeFadeDisabled], but it can provide smoother transitions. The fading range is determined by [Instance.VisibilityRangeBeginMargin] and [Instance.VisibilityRangeEndMargin].
	//
	// Note: Only supported when using the Forward+ rendering method. When using the Mobile or Compatibility rendering method, this mode acts like [VisibilityRangeFadeDisabled] but with hysteresis disabled.
	VisibilityRangeFadeSelf VisibilityRangeFadeMode = 1
	// Will fade-in its visibility dependencies (see [graphics.gd/classdb/Node3D.Instance.VisibilityParent]) when reaching the limits of its own visibility range. This is slower than [VisibilityRangeFadeDisabled], but it can provide smoother transitions. The fading range is determined by [Instance.VisibilityRangeBeginMargin] and [Instance.VisibilityRangeEndMargin].
	//
	// Note: Only supported when using the Forward+ rendering method. When using the Mobile or Compatibility rendering method, this mode acts like [VisibilityRangeFadeDisabled] but with hysteresis disabled.
	VisibilityRangeFadeDependencies VisibilityRangeFadeMode = 2
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL