GeometryInstance3D

package
v0.0.0-...-ae8aae0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package GeometryInstance3D provides methods for working with GeometryInstance3D object instances.

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 GIMode

type GIMode = gdclass.GeometryInstance3DGIMode //gd:GeometryInstance3D.GIMode
const (
	/*Disabled global illumination mode. Use for dynamic objects that do not contribute to global illumination (such as characters). When using [VoxelGI] and SDFGI, the geometry will [i]receive[/i] 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 [VoxelGI], SDFGI and [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 [VoxelGI], but it has a higher performance impact than [constant GI_MODE_STATIC]. When using other GI methods, this will act the same as [constant GI_MODE_DISABLED]. When using [LightmapGI], the object will receive indirect lighting using lightmap probes instead of using the baked lightmap texture.*/
	GiModeDynamic GIMode = 2
)

type Instance

type Instance [1]gdclass.GeometryInstance3D

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

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 (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() gdclass.GeometryInstance3DLightmapScale

func (Instance) GiMode

func (Instance) IgnoreOcclusionCulling

func (self Instance) IgnoreOcclusionCulling() bool

func (Instance) LodBias

func (self Instance) LodBias() Float.X

func (Instance) MaterialOverlay

func (self Instance) MaterialOverlay() [1]gdclass.Material

func (Instance) MaterialOverride

func (self Instance) MaterialOverride() [1]gdclass.Material

func (Instance) SetCastShadow

func (self Instance) SetCastShadow(value gdclass.GeometryInstance3DShadowCastingSetting)

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 gdclass.GeometryInstance3DLightmapScale)

func (Instance) SetGiMode

func (self Instance) SetGiMode(value gdclass.GeometryInstance3DGIMode)

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 ([url=$DOCS_URL/tutorials/shaders/shader_reference/shading_language.html#per-instance-uniforms]per-instance uniform[/url]). See also [method ShaderMaterial.set_shader_parameter] to assign a uniform on all instances using the same [ShaderMaterial]. [b]Note:[/b] For a shader uniform to be assignable on a per-instance basis, it [i]must[/i] be defined with [code]instance uniform ...[/code] rather than [code]uniform ...[/code] in the shader code. [b]Note:[/b] [param name] is case-sensitive and must match the name of the uniform in the code exactly (not the capitalized name in the inspector). [b]Note:[/b] Per-instance shader uniforms are currently only available in 3D, so there is no 2D equivalent of this method.

func (Instance) SetLodBias

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

func (Instance) SetMaterialOverlay

func (self Instance) SetMaterialOverlay(value [1]gdclass.Material)

func (Instance) SetMaterialOverride

func (self Instance) SetMaterialOverride(value [1]gdclass.Material)

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 gdclass.GeometryInstance3DVisibilityRangeFadeMode)

func (Instance) Transparency

func (self Instance) Transparency() Float.X

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

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() gdclass.GeometryInstance3DVisibilityRangeFadeMode

type LightmapScale

type LightmapScale = gdclass.GeometryInstance3DLightmapScale //gd:GeometryInstance3D.LightmapScale
const (
	/*The standard texel density for lightmapping with [LightmapGI].*/
	LightmapScale1x LightmapScale = 0
	/*Multiplies texel density by 2× for lightmapping with [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 [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 [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 [enum LightmapScale] enum.*/
	LightmapScaleMax LightmapScale = 4
)

type ShadowCastingSetting

type ShadowCastingSetting = gdclass.GeometryInstance3DShadowCastingSetting //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 = gdclass.GeometryInstance3DVisibilityRangeFadeMode //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 [member visibility_range_begin] and [member Node3D.visibility_parent] for more information.*/
	VisibilityRangeFadeDisabled VisibilityRangeFadeMode = 0
	/*Will fade-out itself when reaching the limits of its own visibility range. This is slower than [constant VISIBILITY_RANGE_FADE_DISABLED], but it can provide smoother transitions. The fading range is determined by [member visibility_range_begin_margin] and [member visibility_range_end_margin].
	  [b]Note:[/b] Only supported when using the Forward+ rendering method. When using the Mobile or Compatibility rendering method, this mode acts like [constant VISIBILITY_RANGE_FADE_DISABLED] but with hysteresis disabled.*/
	VisibilityRangeFadeSelf VisibilityRangeFadeMode = 1
	/*Will fade-in its visibility dependencies (see [member Node3D.visibility_parent]) when reaching the limits of its own visibility range. This is slower than [constant VISIBILITY_RANGE_FADE_DISABLED], but it can provide smoother transitions. The fading range is determined by [member visibility_range_begin_margin] and [member visibility_range_end_margin].
	  [b]Note:[/b] Only supported when using the Forward+ rendering method. When using the Mobile or Compatibility rendering method, this mode acts like [constant VISIBILITY_RANGE_FADE_DISABLED] 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