Class EffectFromCode
Effect from the shader code.
Inherited Members
Namespace: Evergine.Framework.Graphics.Effects
Assembly: Evergine.Framework.dll
Syntax
public class EffectFromCode : Effect, ILoadable, IDependencyObject
Constructors
EffectFromCode(GraphicsContext, string)
Initializes a new instance of the EffectFromCode class.
Declaration
public EffectFromCode(GraphicsContext graphicsContext, string shaderSource)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphicsContext | graphicsContext | Graphics context. |
| string | shaderSource | Shader source. |
EffectFromCode(GraphicsContext, string, string, string[], bool)
Initializes a new instance of the EffectFromCode class.
Declaration
public EffectFromCode(GraphicsContext graphicsContext, string shaderSource, string passName = null, string[] activeDirectives = null, bool lazyInitialization = false)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphicsContext | graphicsContext | Graphics context. |
| string | shaderSource | Shader source. |
| string | passName | Active pass. |
| string[] | activeDirectives | Active directives. |
| bool | lazyInitialization | Lazy initialization. Compiles shaders during initialization or on-demand. |
Fields
analyzer
The analyzer.
Declaration
protected ShaderAnalyzer analyzer
Field Value
| Type | Description |
|---|---|
| ShaderAnalyzer |
compiler
The compiler.
Declaration
protected ShaderCompiler compiler
Field Value
| Type | Description |
|---|---|
| ShaderCompiler |
shaderSource
The source of the shader.
Declaration
protected string shaderSource
Field Value
| Type | Description |
|---|---|
| string |
Properties
EffectType
Gets the effect type.
Declaration
public override ShaderAnalyzer.EffectTypes EffectType { get; }
Property Value
| Type | Description |
|---|---|
| ShaderAnalyzer.EffectTypes |
Overrides
Methods
CollectDirectives()
Gets if the pass is required with the current active directives.
Declaration
protected override DirectivesGroup[] CollectDirectives()
Returns
| Type | Description |
|---|---|
| DirectivesGroup[] | Directives group array. |
Overrides
Destroy()
Destroys all resources of this instance.
Declaration
protected override void Destroy()
Overrides
GetEffectTechnique(string, string[])
Gets the Effect Technique with a specific directives group.
Declaration
public override EffectTechnique GetEffectTechnique(string passName, string[] activeDirectives)
Parameters
| Type | Name | Description |
|---|---|---|
| string | passName | The pass name. |
| string[] | activeDirectives | The active directives. |
Returns
| Type | Description |
|---|---|
| EffectTechnique | The effect technique. |
Overrides
GetIncludes()
Return the includes detected on the effect.
Declaration
public HashSet<IncludeLibrary> GetIncludes()
Returns
| Type | Description |
|---|---|
| HashSet<IncludeLibrary> | The IncludeLibrary collection. |
GetLibrarySection()
Return the librarySection on the effect (Only valid when the effect is library type).
Declaration
public LibrarySection GetLibrarySection()
Returns
| Type | Description |
|---|---|
| LibrarySection | The librarySection. |
IsPassRequiredWithDirectives(string, string[])
Gets if the pass is required with current active directives.
Declaration
public override bool IsPassRequiredWithDirectives(string passName, string[] activeDirectives)
Parameters
| Type | Name | Description |
|---|---|---|
| string | passName | Pass name. |
| string[] | activeDirectives | Active directives. |
Returns
| Type | Description |
|---|---|
| bool | Whether the pass is required. |
Overrides
SelectPass(string)
Selects the pass.
Declaration
protected PassSection SelectPass(string passName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | passName | The name of the pass. |
Returns
| Type | Description |
|---|---|
| PassSection | The selected pass section. |