Material

package
v0.0.0-...-568b220 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package Material provides methods for working with Material 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
	AsMaterial() 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]) AsMaterial

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

func (*Extension[T]) AsObject

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

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

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 Implementation

type Implementation = implementation

Implementation implements Interface with empty methods.

type Instance

type Instance [1]gdclass.Material

[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 New

func New() Instance

func (Instance) AsMaterial

func (self Instance) AsMaterial() Instance

func (Instance) AsObject

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

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) CreatePlaceholder

func (self Instance) CreatePlaceholder() Resource.Instance

Creates a placeholder version of this resource ([PlaceholderMaterial]).

func (Instance) ID

func (self Instance) ID() ID

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) NextPass

func (self Instance) NextPass() Instance

func (Instance) RenderPriority

func (self Instance) RenderPriority() RenderPriority

func (Instance) SetNextPass

func (self Instance) SetNextPass(value Instance)

func (*Instance) SetObject

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

func (Instance) SetRenderPriority

func (self Instance) SetRenderPriority(value RenderPriority)

func (Instance) Virtual

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

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

Jump to

Keyboard shortcuts

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