ShaderMaterial

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: 19 Imported by: 0

Documentation

Overview

Package ShaderMaterial provides methods for working with ShaderMaterial 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
	AsShaderMaterial() Instance
}

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 New

func New() Instance

func (Instance) AsMaterial

func (self Instance) AsMaterial() Material.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) AsShaderMaterial

func (self Instance) AsShaderMaterial() Instance

func (Instance) GetShaderParameter

func (self Instance) GetShaderParameter(param string) any

Returns the current value set for this material of a uniform in the shader.

func (Instance) SetShader

func (self Instance) SetShader(value [1]gdclass.Shader)

func (Instance) SetShaderParameter

func (self Instance) SetShaderParameter(param string, value any)

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.

func (Instance) Shader

func (self Instance) Shader() [1]gdclass.Shader

func (*Instance) UnsafePointer

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

func (Instance) Virtual

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

Jump to

Keyboard shortcuts

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