Documentation
¶
Overview ¶
Package Material provides methods for working with Material object instances.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Implementation
- type Instance
- func (self Instance) AsMaterial() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) CreatePlaceholder() Resource.Instance
- func (self Instance) ID() ID
- func (self Instance) InspectNativeShaderCode()
- func (self Instance) NextPass() Instance
- func (self Instance) RenderPriority() RenderPriority
- func (self Instance) SetNextPass(value Instance)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetRenderPriority(value RenderPriority)
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
- type RenderPriority
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]) AsMaterial ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
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 Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
[Material] is a base resource used for coloring and shading geometry. All materials inherit from it and almost all [VisualInstance3D] derived nodes carry a [Material]. A few flags and parameters are shared between all material types and are configured here. Importantly, you can inherit from [Material] to create your own custom material type in script or in GDExtension.
See [Interface] for methods that can be overridden by a [Class] that extends it.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsMaterial ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) CreatePlaceholder ¶
Creates a placeholder version of this resource ([PlaceholderMaterial]).
func (Instance) InspectNativeShaderCode ¶
func (self Instance) InspectNativeShaderCode()
Only available when running in the editor. Opens a popup that visualizes the generated shader code, including all variants and internal shader code. See also [method Shader.inspect_native_shader_code].
func (Instance) RenderPriority ¶
func (self Instance) RenderPriority() RenderPriority
func (Instance) SetNextPass ¶
func (Instance) SetRenderPriority ¶
func (self Instance) SetRenderPriority(value RenderPriority)
type Interface ¶
type Interface interface { //Only exposed for the purpose of overriding. You cannot call this function directly. Used internally by various editor tools. Used to access the RID of the [Material]'s [Shader]. GetShaderRid() RID.Any //Only exposed for the purpose of overriding. You cannot call this function directly. Used internally by various editor tools. GetShaderMode() Shader.Mode //Only exposed for the purpose of overriding. You cannot call this function directly. Used internally to determine if [member next_pass] should be shown in the editor or not. CanDoNextPass() bool //Only exposed for the purpose of overriding. You cannot call this function directly. Used internally to determine if [member render_priority] should be shown in the editor or not. CanUseRenderPriority() bool }
type RenderPriority ¶
type RenderPriority int
const RenderPriorityMax RenderPriority = 127 //gd:Material.RENDER_PRIORITY_MAX
const RenderPriorityMin RenderPriority = -128 //gd:Material.RENDER_PRIORITY_MIN