-
Notifications
You must be signed in to change notification settings - Fork 0
ShaderMaterial
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.ShaderMaterial |
| Namespace | Electron2D |
| Kind | class |
| Category | Rendering |
Provides the Electron2D material resource backed by a custom Electron2D.ShaderMaterial.Shader.
public sealed class Electron2D.ShaderMaterial : Electron2D.MaterialShaderMaterial stores a shader resource and a case-sensitive map of shader
parameter values. Electron2D 0.1.0 Preview supports scalar 2D uniforms and
Electron2D.Texture2D sampler values.
Unsupported values are rejected when set. This prevents the renderer from silently replacing invalid parameters later in the frame.
This type is not synchronized. Mutate shader material state on the main thread or from a single import/tooling worker.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.MaterialElectron2D.ShaderMaterial.ShaderElectron2D.Texture2D
| Member | Kind | Summary |
|---|---|---|
Shader |
Property | Gets or sets the shader program used by this material. |
Electron2D.ShaderMaterial() |
Constructor | Initializes a new instance of the ShaderMaterial type. |
GetShaderParameter(Electron2D.StringName) |
Method | Returns the current value set for a shader uniform parameter. |
SetShaderParameter(Electron2D.StringName, Electron2D.Variant) |
Method | Changes the value set for a shader uniform parameter. |
Kind: Property
public Electron2D.Shader Shader { get; set; }Gets or sets the shader program used by this material.
This property follows the validation and lifetime rules of its declaring type.
The current shader value.
This property is not synchronized. Mutate it on the main thread or from a single import/tooling worker.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.ShaderMaterial
Kind: Constructor
public Electron2D.ShaderMaterial()Initializes a new instance of the ShaderMaterial type.
The new instance follows the lifetime and validation rules of its declaring type.
This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.
This API is available since Electron2D 0.1.0 Preview.
Electron2D.ShaderMaterial
Kind: Method
public Electron2D.Variant GetShaderParameter(Electron2D.StringName)(Electron2D.StringName param)Returns the current value set for a shader uniform parameter.
This method follows the validation and lifetime rules of its declaring type.
-
param: The exact case-sensitive parameter name.
The stored parameter value, or a nil Electron2D.Variant when no
value is set for param.
-
System.ArgumentException: Thrown whenparamis empty.
This method is not synchronized. Call it on the main thread or from a single import/tooling worker.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ShaderMaterial.SetShaderParameter(Electron2D.StringName,Electron2D.Variant)
Kind: Method
public System.Void SetShaderParameter(Electron2D.StringName, Electron2D.Variant)(Electron2D.StringName param, Electron2D.Variant value)Changes the value set for a shader uniform parameter.
In Electron2D 0.1.0 Preview the supported value subset is
System.Boolean, integer values, floating-point values,
Electron2D.Vector2, Electron2D.Color,
Electron2D.Transform2D and Electron2D.Texture2D references.
-
param: The exact case-sensitive parameter name. -
value: The new value. A nilElectron2D.Variantremoves the stored parameter value.
-
System.ArgumentException: Thrown whenparamis empty, uses a reserved canvas shader built-in name, orvalueis not a supported shader parameter value.
This method is not synchronized. Call it on the main thread or from a single import/tooling worker.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.ShaderMaterial.GetShaderParameter(Electron2D.StringName)
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.