Class EffectRenderer
Constructors
constructor
-
Creates an effect renderer
Parameters
- engine: AbstractEngine
the engine to use for rendering
- options: IEffectRendererOptions = DefaultOptions
defines the options of the effect renderer
Returns EffectRenderer
- engine: AbstractEngine
Methods
apply Effect Wrapper
-
applyEffectWrapper(
effectWrapper: EffectWrapper,
depthTest?: boolean,
stencilTest?: boolean,
): voidSets the current effect wrapper to use during draw. The effect needs to be ready before calling this api. This also sets the default full screen position attribute.
Parameters
- effectWrapper: EffectWrapper
Defines the effect to draw with
- depthTest: boolean = false
Whether to enable depth testing (default: false)
- stencilTest: boolean = false
Whether to enable stencil testing (default: false)
Returns void
- effectWrapper: EffectWrapper
bind Buffers
-
Binds the embedded attributes buffer to the effect.
Parameters
- effect: Effect
Defines the effect to bind the attributes for
Returns void
- effect: Effect
dispose
-
Disposes of the effect renderer
Returns void
draw
-
Draws a full screen quad.
Returns void
render
-
render(
effectWrapper: EffectWrapper,
outputTexture?: Nullable<RenderTargetWrapper | IRenderTargetTexture>,
): voidrenders one or more effects to a specified texture
Parameters
- effectWrapper: EffectWrapper
the effect to renderer
- outputTexture: Nullable<RenderTargetWrapper | IRenderTargetTexture> = null
texture to draw to, if null it will render to the currently bound frame buffer
Returns void
- effectWrapper: EffectWrapper
restore States
-
Restores engine states
Returns void
save States
-
Saves engine states
Returns void
set Viewport
-
Sets the current viewport in normalized coordinates 0-1
Parameters
- viewport: Viewport = ...
Defines the viewport to set (defaults to 0 0 1 1)
Returns void
- viewport: Viewport = ...
Helper class to render one or more effects. You can access the previous rendering in your shader by declaring a sampler named textureSampler