Documentation
¶
Overview ¶
Base node for geometry-based visual instances. Shares some common functionality like visibility and custom materials.
Index ¶
- type Advanced
- type Any
- type Extension
- type GIMode
- type ID
- type Instance
- func (self Instance) AsGeometryInstance3D() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode3D() Node3D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsVisualInstance3D() VisualInstance3D.Instance
- func (self Instance) CastShadow() ShadowCastingSetting
- func (self Instance) CustomAabb() AABB.PositionSize
- func (self Instance) ExtraCullMargin() Float.X
- func (self Instance) GetInstanceShaderParameter(name string) any
- func (self Instance) GiLightmapScale() LightmapScale
- func (self Instance) GiLightmapTexelScale() Float.X
- func (self Instance) GiMode() GIMode
- func (self Instance) ID() ID
- func (self Instance) IgnoreOcclusionCulling() bool
- func (self Instance) LodBias() Float.X
- func (self Instance) MaterialOverlay() Material.Instance
- func (self Instance) MaterialOverride() Material.Instance
- func (self Instance) SetCastShadow(value ShadowCastingSetting)
- func (self Instance) SetCustomAabb(value AABB.PositionSize)
- func (self Instance) SetExtraCullMargin(value Float.X)
- func (self Instance) SetGiLightmapScale(value LightmapScale)
- func (self Instance) SetGiLightmapTexelScale(value Float.X)
- func (self Instance) SetGiMode(value GIMode)
- func (self Instance) SetIgnoreOcclusionCulling(value bool)
- func (self Instance) SetInstanceShaderParameter(name string, value any)
- func (self Instance) SetLodBias(value Float.X)
- func (self Instance) SetMaterialOverlay(value Material.Instance)
- func (self Instance) SetMaterialOverride(value Material.Instance)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetTransparency(value Float.X)
- func (self Instance) SetVisibilityRangeBegin(value Float.X)
- func (self Instance) SetVisibilityRangeBeginMargin(value Float.X)
- func (self Instance) SetVisibilityRangeEnd(value Float.X)
- func (self Instance) SetVisibilityRangeEndMargin(value Float.X)
- func (self Instance) SetVisibilityRangeFadeMode(value VisibilityRangeFadeMode)
- func (self Instance) Transparency() Float.X
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) VisibilityRangeBegin() Float.X
- func (self Instance) VisibilityRangeBeginMargin() Float.X
- func (self Instance) VisibilityRangeEnd() Float.X
- func (self Instance) VisibilityRangeEndMargin() Float.X
- func (self Instance) VisibilityRangeFadeMode() VisibilityRangeFadeMode
- type LightmapScale
- type ShadowCastingSetting
- type VisibilityRangeFadeMode
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 Extension ¶
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 (*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 ¶
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.
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 (Instance) AsGeometryInstance3D ¶
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 (Instance) GetInstanceShaderParameter ¶
Get the value of a shader parameter as set on this instance.
func (Instance) GiLightmapScale ¶
func (self Instance) GiLightmapScale() LightmapScale
func (Instance) GiLightmapTexelScale ¶
func (Instance) IgnoreOcclusionCulling ¶
func (Instance) MaterialOverlay ¶
func (Instance) MaterialOverride ¶
func (Instance) SetCastShadow ¶
func (self Instance) SetCastShadow(value ShadowCastingSetting)
func (Instance) SetCustomAabb ¶
func (self Instance) SetCustomAabb(value AABB.PositionSize)
func (Instance) SetExtraCullMargin ¶
func (Instance) SetGiLightmapScale ¶
func (self Instance) SetGiLightmapScale(value LightmapScale)
func (Instance) SetGiLightmapTexelScale ¶
func (Instance) SetIgnoreOcclusionCulling ¶
func (Instance) SetInstanceShaderParameter ¶
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 (Instance) SetMaterialOverlay ¶
func (Instance) SetMaterialOverride ¶
func (Instance) SetTransparency ¶
func (Instance) SetVisibilityRangeBegin ¶
func (Instance) SetVisibilityRangeBeginMargin ¶
func (Instance) SetVisibilityRangeEnd ¶
func (Instance) SetVisibilityRangeEndMargin ¶
func (Instance) SetVisibilityRangeFadeMode ¶
func (self Instance) SetVisibilityRangeFadeMode(value VisibilityRangeFadeMode)
func (Instance) Transparency ¶
func (Instance) VisibilityRangeBegin ¶
func (Instance) VisibilityRangeBeginMargin ¶
func (Instance) VisibilityRangeEnd ¶
func (Instance) VisibilityRangeEndMargin ¶
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 )