Table of Contents

Class EffectSystem

Namespace
Stride.Rendering
Assembly
Stride.Rendering.dll

The effect system.

public class EffectSystem : GameSystemBase, IDisposable, ICollectorHolder, IGameSystemBase, IComponent, IReferencable, IUpdateable, IDrawable, IContentable
Inheritance
object
EffectSystem
Implements
Inherited Members
Extension Methods

Constructors

EffectSystem(IServiceRegistry)

Initializes a new instance of the EffectSystem class.

public EffectSystem(IServiceRegistry services)

Parameters

services IServiceRegistry

The services.

Properties

Compiler

public IEffectCompiler Compiler { get; set; }

Property Value

IEffectCompiler

FileProvider

Gets or sets the database file provider, to use for loading effects and shader sources.

public IVirtualFileProvider FileProvider { get; }

Property Value

IVirtualFileProvider

The database file provider.

Methods

Destroy()

Disposes the object's resources.

protected override void Destroy()

Remarks

Override in a derived class to implement disposal logic specific to it.

This method is automatically called whenever a call to Dispose() (or to Release()) has decreased the internal reference count to zero, meaning no other objects (hopefully) hold a reference to this one and its resources can be safely released.

GetShaderFromParameters(string, CompilerParameters)

Get the shader from the database based on the parameters used for its compilation.

protected CompilerResults GetShaderFromParameters(string effectName, CompilerParameters parameters)

Parameters

effectName string

Name of the effect.

parameters CompilerParameters

The parameters.

Returns

CompilerResults

The EffectBytecode if found.

Initialize()

Initializes the Game System.

public override void Initialize()

Remarks

This method is called when the component is added to the Game. This can be used for tasks like querying for services the component needs and setting up non-graphics resources (as here the Graphics Device may have not been initialized yet).

IsValid(Effect)

public bool IsValid(Effect effect)

Parameters

effect Effect

Returns

bool

LoadEffect(string, CompilerParameters)

Loads the effect.

public TaskOrResult<Effect> LoadEffect(string effectName, CompilerParameters compilerParameters)

Parameters

effectName string

Name of the effect.

compilerParameters CompilerParameters

The compiler parameters.

Returns

TaskOrResult<Effect>

A new instance of an effect.

Exceptions

InvalidOperationException

Could not compile shader. Need fallback.

SetCompilationMode(CompilationMode)

public void SetCompilationMode(CompilationMode compilationMode)

Parameters

compilationMode CompilationMode

Update(GameTime)

This method is called when this game component is updated.

public override void Update(GameTime gameTime)

Parameters

gameTime GameTime

The current timing.