Documentation ¶
Overview ¶
Package ShaderMaterial provides methods for working with ShaderMaterial object instances.
Index ¶
- type Advanced
- type Any
- type Instance
- func (self Instance) AsMaterial() Material.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) AsShaderMaterial() Instance
- func (self Instance) GetShaderParameter(param string) any
- func (self Instance) SetShader(value [1]gdclass.Shader)
- func (self Instance) SetShaderParameter(param string, value any)
- func (self Instance) Shader() [1]gdclass.Shader
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
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 Instance ¶
type Instance [1]gdclass.ShaderMaterial
A material that uses a custom [Shader] program to render visual items (canvas items, meshes, skies, fog), or to process particles. Compared to other materials, [ShaderMaterial] gives deeper control over the generated shader code. For more information, see the shaders documentation index below. Multiple [ShaderMaterial]s can use the same shader and configure different values for the shader uniforms. [b]Note:[/b] For performance reasons, the [signal Resource.changed] signal is only emitted when the [member Resource.resource_name] changes. Only in editor, it is also emitted for [member shader] changes.
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) AsShaderMaterial ¶
func (Instance) GetShaderParameter ¶
Returns the current value set for this material of a uniform in the shader.
func (Instance) SetShaderParameter ¶
Changes the value set for this material of a uniform in the shader. [b]Note:[/b] [param param] 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] Changes to the shader uniform will be effective on all instances using this [ShaderMaterial]. To prevent this, use per-instance uniforms with [method GeometryInstance3D.set_instance_shader_parameter] or duplicate the [ShaderMaterial] resource using [method Resource.duplicate]. Per-instance uniforms allow for better shader reuse and are therefore faster, so they should be preferred over duplicating the [ShaderMaterial] when possible.