Class Effect
Abstract base class for effects.
Inherited Members
Namespace: Evergine.Framework.Graphics.Effects
Assembly: Evergine.Framework.dll
Syntax
public abstract class Effect : DisposableObject, ILoadable, IDependencyObject
Constructors
Effect()
Initializes a new instance of the Effect class.
Declaration
public Effect()
Fields
ConstantBufferPool
The effect constant buffer pool.
Declaration
public ConstantBufferPool ConstantBufferPool
Field Value
| Type | Description |
|---|---|
| ConstantBufferPool |
directivesGroups
The directive groups.
Declaration
protected DirectivesGroup[] directivesGroups
Field Value
| Type | Description |
|---|---|
| DirectivesGroup[] |
graphicsContext
The graphics context.
Declaration
public GraphicsContext graphicsContext
Field Value
| Type | Description |
|---|---|
| GraphicsContext |
graphicsResourcesInfo
The graphics resources' information.
Declaration
protected GraphicsResourceInfo[] graphicsResourcesInfo
Field Value
| Type | Description |
|---|---|
| GraphicsResourceInfo[] |
passes
The pass.
Declaration
protected string[] passes
Field Value
| Type | Description |
|---|---|
| string[] |
sharedCBufferBySlot
The shared constant buffer by slot.
Declaration
protected Dictionary<int, ConstantBuffer> sharedCBufferBySlot
Field Value
| Type | Description |
|---|---|
| Dictionary<int, ConstantBuffer> |
techniquesCached
The cached techniques.
Declaration
protected Dictionary<int, EffectTechnique> techniquesCached
Field Value
| Type | Description |
|---|---|
| Dictionary<int, EffectTechnique> |
Properties
Dependencies
Gets the list of dependencies.
Declaration
public Lazy<List<IDependencyLink>> Dependencies { get; }
Property Value
| Type | Description |
|---|---|
| Lazy<List<IDependencyLink>> |
Directives
Gets the list of directives.
Declaration
public DirectivesGroup[] Directives { get; }
Property Value
| Type | Description |
|---|---|
| DirectivesGroup[] |
EffectType
Gets the effect type.
Declaration
public abstract ShaderAnalyzer.EffectTypes EffectType { get; }
Property Value
| Type | Description |
|---|---|
| ShaderAnalyzer.EffectTypes |
GraphicsResourcesInfo
Gets the Resource Layout information.
Declaration
public GraphicsResourceInfo[] GraphicsResourcesInfo { get; }
Property Value
| Type | Description |
|---|---|
| GraphicsResourceInfo[] |
Id
Gets or sets the asset ID.
Declaration
public Guid Id { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid | The asset path. |
Passes
Gets the passes.
Declaration
public string[] Passes { get; }
Property Value
| Type | Description |
|---|---|
| string[] |
ReaderVersion
Gets the reader version.
Declaration
public Version ReaderVersion { get; }
Property Value
| Type | Description |
|---|---|
| Version | The reader version. |
SharedCBufferBySlot
Gets the shared constant buffer by slot.
Declaration
public Dictionary<int, ConstantBuffer> SharedCBufferBySlot { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<int, ConstantBuffer> |
Methods
CollectDirectives()
Gets if the pass is required with the current active directives.
Declaration
protected virtual DirectivesGroup[] CollectDirectives()
Returns
| Type | Description |
|---|---|
| DirectivesGroup[] | Directives group array. |
CreateSharedResources()
This method must be called after obtaining graphicsResourcesInfo, and it creates the shared cbuffers.
Declaration
protected void CreateSharedResources()
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 abstract 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. |
GetResourceLayout(GraphicsResourceUsage[])
Gets a resource layout.
Declaration
protected ResourceLayout GetResourceLayout(GraphicsResourceUsage[] resourceLayoutUsage)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphicsResourceUsage[] | resourceLayoutUsage | The resource layout usage. |
Returns
| Type | Description |
|---|---|
| ResourceLayout | The resource layout. |
Invalidate(ILoadable)
Invalidates this instance and raises the Invalidated event with the new ILoadable instance.
Declaration
public void Invalidate(ILoadable newInstance)
Parameters
| Type | Name | Description |
|---|---|---|
| ILoadable | newInstance | The new ILoadable instance. |
IsPassRequiredWithDirectives(string, string[])
Gets if the pass is required with current active directives.
Declaration
public abstract 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. |
ReleaseUnusedMemory()
Releases unused memory.
Declaration
public void ReleaseUnusedMemory()
Events
Invalidated
Occurs when this instance is invalidated and all references must be reloaded.
Declaration
public event EventHandler<ILoadable> Invalidated
Event Type
| Type | Description |
|---|---|
| EventHandler<ILoadable> |