Class SurfaceEffectBase
A surface effect contains information to build a shader program. This is an abstract base class.
Inherited Members
Namespace: Fusee.Engine.Core.Effects
Assembly: Fusee.Engine.Core.dll
Syntax
public abstract class SurfaceEffectBase : Effect, IComponent, IDisposable
Constructors
SurfaceEffectBase(SurfaceEffectInput, RenderStateSet)
Creates a new Instance of type SurfaceEffect.
Declaration
public SurfaceEffectBase(SurfaceEffectInput surfaceInput, RenderStateSet renderStateSet = null)
Parameters
| Type | Name | Description |
|---|---|---|
| SurfaceEffectInput | surfaceInput | SurfaceInput. Provides the values used to modify the SurfaceOut. |
| RenderStateSet | renderStateSet | Optional. If no RenderStateSet is given a default one will be added. |
Fields
Pi
The shader shard containing the definition of PI.
Declaration
[FxShader(ShaderCategory.Vertex | ShaderCategory.Fragment)]
[FxShard(ShardCategory.Header)]
public string Pi
Field Value
| Type | Description |
|---|---|
| System.String |
Precision
The shader shard containing the float precision.
Declaration
[FxShader(ShaderCategory.Vertex | ShaderCategory.Fragment)]
[FxShard(ShardCategory.Header)]
public string Precision
Field Value
| Type | Description |
|---|---|
| System.String |
SurfaceOutput
Struct declaration in the shader code that provides the values for the position calculation of the vertex shader and lighting calculation of the fragment shader. Values of this struct can be modified by the user using SurfOutFragMethod (fragment shader). The value is filled in the constructor using the chosen lighting setup.
Declaration
[FxShader(ShaderCategory.Vertex | ShaderCategory.Fragment)]
[FxShard(ShardCategory.SurfOutStruct)]
public string SurfaceOutput
Field Value
| Type | Description |
|---|---|
| System.String |
SurfOutFragMethod
Shader Shard Method to modify the SurfaceOutput.
Declaration
[FxShader(ShaderCategory.Fragment)]
[FxShard(ShardCategory.SurfOut)]
public string SurfOutFragMethod
Field Value
| Type | Description |
|---|---|
| System.String |
SurfOutVertMethod
Shader Shard Method to modify the SurfaceOutput.
Declaration
[FxShader(ShaderCategory.Vertex)]
[FxShard(ShardCategory.SurfOut)]
public string SurfOutVertMethod
Field Value
| Type | Description |
|---|---|
| System.String |
SurfVaryingFrag
Fragment shader "in" declaration of the SurfaceOutput.
Declaration
[FxShader(ShaderCategory.Fragment)]
[FxShard(ShardCategory.Property)]
public string SurfVaryingFrag
Field Value
| Type | Description |
|---|---|
| System.String |
SurfVaryingVert
Vertex shader "out" declaration of the SurfaceOutput.
Declaration
[FxShader(ShaderCategory.Vertex)]
[FxShard(ShardCategory.Property)]
public string SurfVaryingVert
Field Value
| Type | Description |
|---|---|
| System.String |
TBNIn
Fragment shader "in" declaration for the TBN matrix.
Declaration
[FxShader(ShaderCategory.Fragment)]
[FxShard(ShardCategory.Property)]
public string TBNIn
Field Value
| Type | Description |
|---|---|
| System.String |
TBNOut
Vertex shader "out" declaration for the TBN matrix.
Declaration
[FxShader(ShaderCategory.Vertex)]
[FxShard(ShardCategory.Property)]
public string TBNOut
Field Value
| Type | Description |
|---|---|
| System.String |
UvIn
Fragment shader "in" declaration for the uv coordinates.
Declaration
[FxShader(ShaderCategory.Fragment)]
[FxShard(ShardCategory.Property)]
public string UvIn
Field Value
| Type | Description |
|---|---|
| System.String |
UvOut
Vertex shader "out" declaration for the uv coordinates.
Declaration
[FxShader(ShaderCategory.Vertex)]
[FxShard(ShardCategory.Property)]
public string UvOut
Field Value
| Type | Description |
|---|---|
| System.String |
Version
The shader shard containing the shader version.
Declaration
[FxShader(ShaderCategory.Vertex | ShaderCategory.Fragment)]
[FxShard(ShardCategory.Header)]
public string Version
Field Value
| Type | Description |
|---|---|
| System.String |
VertColor1In
Fragment shader "in" declaration for the vertex colors.
Declaration
[FxShader(ShaderCategory.Fragment)]
[FxShard(ShardCategory.Property)]
public string VertColor1In
Field Value
| Type | Description |
|---|---|
| System.String |
VertColor1Out
Vertex shader "out" declaration for the vertex colors.
Declaration
[FxShader(ShaderCategory.Vertex)]
[FxShard(ShardCategory.Property)]
public string VertColor1Out
Field Value
| Type | Description |
|---|---|
| System.String |
VertColor2In
Fragment shader "in" declaration for the vertex colors.
Declaration
[FxShader(ShaderCategory.Fragment)]
[FxShard(ShardCategory.Property)]
public string VertColor2In
Field Value
| Type | Description |
|---|---|
| System.String |
VertColor2Out
Vertex shader "out" declaration for the vertex colors.
Declaration
[FxShader(ShaderCategory.Vertex)]
[FxShard(ShardCategory.Property)]
public string VertColor2Out
Field Value
| Type | Description |
|---|---|
| System.String |
VertColorIn
Fragment shader "in" declaration for the vertex colors.
Declaration
[FxShader(ShaderCategory.Fragment)]
[FxShard(ShardCategory.Property)]
public string VertColorIn
Field Value
| Type | Description |
|---|---|
| System.String |
VertColorOut
Vertex shader "out" declaration for the vertex colors.
Declaration
[FxShader(ShaderCategory.Vertex)]
[FxShard(ShardCategory.Property)]
public string VertColorOut
Field Value
| Type | Description |
|---|---|
| System.String |
VertIn
The shader shard containing "fu" variables (in and out parameters) like fuVertex, fuNormal etc. The value is filled in the constructor using the chosen lighting setup.
Declaration
[FxShader(ShaderCategory.Vertex)]
[FxShard(ShardCategory.Property)]
public string VertIn
Field Value
| Type | Description |
|---|---|
| System.String |
Properties
SurfaceInput
User-defined input struct. Must derive from DiffuseInput. Used in the SurfOutFragMethod to modify the parameters of the chosen SurfaceOutput.
Declaration
public SurfaceEffectInput SurfaceInput { get; set; }
Property Value
| Type | Description |
|---|---|
| SurfaceEffectInput |
Methods
HandleFieldsAndProps()
Reads all Fields an Properties from this type and builds IFxParamDeclarations and shader code snippets from them.
Declaration
protected void HandleFieldsAndProps()
PropertyChangedHandler(Object, SurfaceEffectEventArgs, String)
Event Handler that is called on PropertyChanged.
Declaration
protected void PropertyChangedHandler(object sender, SurfaceEffectEventArgs args, string memberName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | The sender object. |
| SurfaceEffectEventArgs | args | The event arguments. |
| System.String | memberName | The name of the member which this event originated from. |