Class EffectAsset
Effect asset type. This asset is used to render sprites and text with special effects.
Implements
Inherited Members
Namespace: BonEngineSharp.Assets
Assembly: BonEngineSharp.dll
Syntax
public class EffectAsset : IAsset, IDisposable
Constructors
EffectAsset(IntPtr)
Create the asset.
Declaration
public EffectAsset(IntPtr handle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | handle | Asset handle inside the low-level engine. |
Properties
AssetType
Get asset type.
Declaration
public override AssetType AssetType { get; }
Property Value
| Type | Description |
|---|---|
| AssetType |
Overrides
IsValid
Return if this effect asset is properly loaded / valid.
Declaration
public override bool IsValid { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Overrides
UseTextures
Return if this effect uses textures.
Declaration
public bool UseTextures { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
UseVertexColor
Return if this effect uses vertex color.
Declaration
public bool UseVertexColor { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Methods
Finalize()
Dispose on destructor.
Declaration
protected override void Finalize()
Overrides
SetUniform(String, Color, Boolean)
Set color uniform (either vector3 or vector4, if using alpha).
Declaration
public void SetUniform(string name, Color color, bool includeAlpha)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Uniform name, as appear in shaders. |
| Color | color | Color to set. |
| System.Boolean | includeAlpha | If true, will also set alpha value (vector4). If false, will only set RGB (vector3). |
SetUniform(String, Int32)
Set int uniform.
Declaration
public void SetUniform(string name, int val)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Uniform name, as appear in shaders. |
| System.Int32 | val | Value to set. |
SetUniform(String, Int32, Int32)
Set vector2 uniform.
Declaration
public void SetUniform(string name, int x, int y)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Uniform name, as appear in shaders. |
| System.Int32 | x | X value. |
| System.Int32 | y | Y value. |
SetUniform(String, Int32, Int32, Int32)
Set vector3 uniform.
Declaration
public void SetUniform(string name, int x, int y, int z)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Uniform name, as appear in shaders. |
| System.Int32 | x | X value. |
| System.Int32 | y | Y value. |
| System.Int32 | z | Z value. |
SetUniform(String, Int32, Int32, Int32, Int32)
Set vector4 uniform.
Declaration
public void SetUniform(string name, int x, int y, int z, int w)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Uniform name, as appear in shaders. |
| System.Int32 | x | X value. |
| System.Int32 | y | Y value. |
| System.Int32 | z | Z value. |
| System.Int32 | w | W value. |
SetUniform(String, Single)
Set float uniform.
Declaration
public void SetUniform(string name, float val)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Uniform name, as appear in shaders. |
| System.Single | val | Value to set. |
SetUniform(String, Single, Single)
Set vector2 uniform.
Declaration
public void SetUniform(string name, float x, float y)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Uniform name, as appear in shaders. |
| System.Single | x | X value. |
| System.Single | y | Y value. |
SetUniform(String, Single, Single, Single)
Set vector3 uniform.
Declaration
public void SetUniform(string name, float x, float y, float z)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Uniform name, as appear in shaders. |
| System.Single | x | X value. |
| System.Single | y | Y value. |
| System.Single | z | Z value. |
SetUniform(String, Single, Single, Single, Single)
Set vector4 uniform.
Declaration
public void SetUniform(string name, float x, float y, float z, float w)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Uniform name, as appear in shaders. |
| System.Single | x | X value. |
| System.Single | y | Y value. |
| System.Single | z | Z value. |
| System.Single | w | W value. |
SetUniformMatrix2(String, Boolean, Single[])
Set matrix uniform.
Declaration
public void SetUniformMatrix2(string name, bool transpose, float[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Uniform name, as appear in shaders. |
| System.Boolean | transpose | Specifies whether to transpose the matrix as the values are loaded into the uniform variable. |
| System.Single[] | values | Matrix values. |
SetUniformMatrix3(String, Boolean, Single[])
Set matrix uniform.
Declaration
public void SetUniformMatrix3(string name, bool transpose, float[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Uniform name, as appear in shaders. |
| System.Boolean | transpose | Specifies whether to transpose the matrix as the values are loaded into the uniform variable. |
| System.Single[] | values | Matrix values. |
SetUniformMatrix4(String, Boolean, Single[])
Set matrix uniform.
Declaration
public void SetUniformMatrix4(string name, bool transpose, float[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Uniform name, as appear in shaders. |
| System.Boolean | transpose | Specifies whether to transpose the matrix as the values are loaded into the uniform variable. |
| System.Single[] | values | Matrix values. |