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
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 of object resources.

protected override void Destroy()

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()

This method is called when the component is added to the game.

public override void Initialize()

Remarks

This method can be used for tasks like querying for services the component needs and setting up non-graphics resources.

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.