Interface IRenderQueue
Builds the rendering queue Each call to this object will add a step to the queue
Namespace: Yak2D
Assembly: Yak2D.Api.dll
Syntax
public interface IRenderQueue
Methods
Bloom(UInt64, UInt64, UInt64)
Apply bloom effect to a texture source and render to a target Brightness threshold, additive mix amount with source and number of blur component samples can be configured for the stage
Declaration
void Bloom(ulong stage, ulong source, ulong target)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | stage | The Bloom stage id |
| System.UInt64 | source | The Texture id of the source surface the effect will use |
| System.UInt64 | target | The render target surface id that the post-effect result will be drawn too |
Bloom(IBloomStage, ITexture, IRenderTarget)
Apply bloom effect to a texture source and render to a target Brightness threshold, additive mix amount with source and number of blur component samples can be configured for the stage
Declaration
void Bloom(IBloomStage stage, ITexture source, IRenderTarget target)
Parameters
| Type | Name | Description |
|---|---|---|
| IBloomStage | stage | The Bloom stage reference |
| ITexture | source | The Texture reference of the source surface the effect will use |
| IRenderTarget | target | The render target surface reference that the post-effect result will be drawn too |
Blur(UInt64, UInt64, UInt64)
Apply a blur effect to a texture source and render to a target The blur is applied in both x and y texture coordinate directions, it is not a directional blur - use Blur1D effect instead in that scenario Fractional mix amount with source and number of blur component samples can be configured for the stage
Declaration
void Blur(ulong stage, ulong source, ulong target)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | stage | The Blur stage id |
| System.UInt64 | source | The Texture id of the source surface the effect will use |
| System.UInt64 | target | The render target surface id that the post-effect result will be drawn too |
Blur(IBlurStage, ITexture, IRenderTarget)
Apply a blur effect to a texture source and render to a target The blur is applied in both x and y texture coordinate directions, it is not a directional blur - use Blur1D effect instead in that scenario Fractional mix amount with source and number of blur component samples can be configured for the stage
Declaration
void Blur(IBlurStage stage, ITexture source, IRenderTarget target)
Parameters
| Type | Name | Description |
|---|---|---|
| IBlurStage | stage | The Blur stage reference |
| ITexture | source | The Texture reference of the source surface the effect will use |
| IRenderTarget | target | The render target surface reference that the post-effect result will be drawn too |
Blur1D(UInt64, UInt64, UInt64)
Apply a directional (1d) blur effect to a texture source and render to a target For non-directional blur, use the standard Blur effect instead Blur direction, fractional mix amount with source and number of blur component samples can be configured for the stage
Declaration
void Blur1D(ulong stage, ulong source, ulong target)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | stage | The Blur1D stage id |
| System.UInt64 | source | The Texture id of the source surface the effect will use |
| System.UInt64 | target | The render target surface id that the post-effect result will be drawn too |
Blur1D(IBlur1DStage, ITexture, IRenderTarget)
Apply a directional (1d) blur effect to a texture source and render to a target For non-directional blur, use the standard Blur effect instead Blur direction, fractional mix amount with source and number of blur component samples can be configured for the stage
Declaration
void Blur1D(IBlur1DStage stage, ITexture source, IRenderTarget target)
Parameters
| Type | Name | Description |
|---|---|---|
| IBlur1DStage | stage | The Blur1D stage reference |
| ITexture | source | The Texture reference of the source surface the effect will use |
| IRenderTarget | target | The render target surface reference that the post-effect result will be drawn too |
ClearColour(UInt64, Colour)
Sets all the pixels on render target to the chosen colour
Declaration
void ClearColour(ulong target, Colour colour)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | target | Render Target id |
| Colour | colour | Clear colour |
ClearColour(IRenderTarget, Colour)
Sets all the pixels on render target to the chosen colour
Declaration
void ClearColour(IRenderTarget target, Colour colour)
Parameters
| Type | Name | Description |
|---|---|---|
| IRenderTarget | target | Render Target reference |
| Colour | colour | Clear colour |
ClearDepth(UInt64)
Clears each depth buffer pixel to 1.0 on a render target
Declaration
void ClearDepth(ulong target)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | target | Render Target reference |
ClearDepth(IRenderTarget)
Clears each depth buffer pixel to 1.0 on a render target
Declaration
void ClearDepth(IRenderTarget target)
Parameters
| Type | Name | Description |
|---|---|---|
| IRenderTarget | target | Render Target reference |
ColourEffects(UInt64, UInt64, UInt64)
Apply simple colour modification effects to a texture source and render to a target Effects are: single colour mix, grayscale, negative, colourise and opacity A combination of all the effects can be applied together
Declaration
void ColourEffects(ulong stage, ulong source, ulong target)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | stage | The ColourEffects stage id |
| System.UInt64 | source | The Texture id of the source surface the effects will use |
| System.UInt64 | target | The render target surface id that the post-effect result will be drawn too |
ColourEffects(IColourEffectsStage, ITexture, IRenderTarget)
Apply simple colour modification effects to a texture source and render to a target Effects are: single colour mix, grayscale, negative, colourise and opacity A combination of all the effects can be applied together
Declaration
void ColourEffects(IColourEffectsStage stage, ITexture source, IRenderTarget target)
Parameters
| Type | Name | Description |
|---|---|---|
| IColourEffectsStage | stage | The ColourEffects stage reference |
| ITexture | source | The Texture reference of the source surface the effects will use |
| IRenderTarget | target | The render target surface that the post-effect result will be drawn too |
Copy(UInt64, UInt64)
Copies colour data from one texture source to a render target The surfaces do not need to be the same dimensions
Declaration
void Copy(ulong source, ulong target)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | source | The Texture id of the source to copy colour data from |
| System.UInt64 | target | The render target surface id to copy too |
Copy(ITexture, IRenderTarget)
Copies colour data from one texture source to a render target The surfaces do not need to be the same dimensions
Declaration
void Copy(ITexture source, IRenderTarget target)
Parameters
| Type | Name | Description |
|---|---|---|
| ITexture | source | The Texture reference of the source to copy colour data from |
| IRenderTarget | target | The render target surface reference to copy too |
CopySurfaceData(UInt64, UInt64)
Transfer surface (Texture or RenderTarget) pixel data from GPU to CPU The Main window swapchain backbuffer target cannot be copied A single copy stage must only be used once per render queue (as allowing a second use would either require overwriting data or more temporary possible heap allocation)
Declaration
void CopySurfaceData(ulong stage, ulong source)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | stage | Stage id. Holds callback delegates used to pass pixel data back to user |
| System.UInt64 | source | Surface id. The surface (RenderTarget or Texture) to copy pixel data from |
CopySurfaceData(ISurfaceCopyStage, ITexture)
Transfer surface (Texture or RenderTarget) pixel data from GPU to CPU The Main window swapchain backbuffer target cannot be copied A single copy stage must only be used once per render queue (as allowing a second use would either require overwriting data or more temporary possible heap allocation)
Declaration
void CopySurfaceData(ISurfaceCopyStage stage, ITexture source)
Parameters
| Type | Name | Description |
|---|---|---|
| ISurfaceCopyStage | stage | Stage Reference. Holds callback delegates used to pass pixel data back to user |
| ITexture | source | Surface Reference. The surface (RenderTarget or Texture) to copy pixel data from |
CustomShader(UInt64, UInt64, UInt64, UInt64, UInt64, UInt64)
Applies a user defined custom shader effect The user defines the shader code, constrained by a set maximum number of texture and uniform configuration variable inputs
Declaration
void CustomShader(ulong stage, ulong tex0, ulong tex1, ulong tex2, ulong tex3, ulong target)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | stage | The CustomShader stage id |
| System.UInt64 | tex0 | An input Texture id |
| System.UInt64 | tex1 | An input Texture id |
| System.UInt64 | tex2 | An input Texture id |
| System.UInt64 | tex3 | An input Texture id |
| System.UInt64 | target | The render target surface id that the shader result will be drawn too |
CustomShader(ICustomShaderStage, ITexture, ITexture, ITexture, ITexture, IRenderTarget)
Applies a user defined custom shader effect The user defines the shader code, constrained by a set maximum number of texture and uniform configuration variable inputs
Declaration
void CustomShader(ICustomShaderStage stage, ITexture tex0, ITexture tex1, ITexture tex2, ITexture tex3, IRenderTarget target)
Parameters
| Type | Name | Description |
|---|---|---|
| ICustomShaderStage | stage | The CustomShader stage reference |
| ITexture | tex0 | An input Texture reference |
| ITexture | tex1 | An input Texture reference |
| ITexture | tex2 | An input Texture reference |
| ITexture | tex3 | An input Texture reference |
| IRenderTarget | target | The render target surface reference that the shader result will be drawn too |
CustomVeldrid(UInt64, UInt64, UInt64, UInt64, UInt64, UInt64)
Applies a user defined custom piece of veldrid logic, enabling operations or integrations that require complete access to veldrid library functions
Declaration
void CustomVeldrid(ulong stage, ulong tex0, ulong tex1, ulong tex2, ulong tex3, ulong target)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | stage | The CustomVeldrid stage id |
| System.UInt64 | tex0 | An input Texture id |
| System.UInt64 | tex1 | An input Texture id |
| System.UInt64 | tex2 | An input Texture id |
| System.UInt64 | tex3 | An input Texture id |
| System.UInt64 | target | The render target surface id that the custom veldrid code may draw too, to enable use in wider yak2D rendering |
CustomVeldrid(ICustomVeldridStage, ITexture, ITexture, ITexture, ITexture, IRenderTarget)
Applies a user defined custom piece of veldrid logic, enabling operations or integrations that require complete access to veldrid library functions
Declaration
void CustomVeldrid(ICustomVeldridStage stage, ITexture tex0, ITexture tex1, ITexture tex2, ITexture tex3, IRenderTarget target)
Parameters
| Type | Name | Description |
|---|---|---|
| ICustomVeldridStage | stage | The CustomVeldrid stage reference |
| ITexture | tex0 | An input Texture reference |
| ITexture | tex1 | An input Texture reference |
| ITexture | tex2 | An input Texture reference |
| ITexture | tex3 | An input Texture reference |
| IRenderTarget | target | The render target surface reference that the custom veldrid code may draw too, to enable use in wider yak2D rendering |
Distortion(UInt64, UInt64, UInt64, UInt64)
Applies a distortion effect to a texture source and render to a target The per-pixel distortion amount is generated from a distortion height map The distortion height map is drawn each frame, in a similar way that DrawStage draw requests are generated, queued and sorted The final distortion amount per-pixel is scaled by a configurable scalar quantity
Declaration
void Distortion(ulong stage, ulong camera, ulong source, ulong target)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | stage | The Distortion stage id |
| System.UInt64 | camera | The 2D camera id used to transform and position the draw vertices |
| System.UInt64 | source | The Texture id of the source surface the effect will use |
| System.UInt64 | target | The render target surface id that the post-effect result will be drawn too |
Distortion(IDistortionStage, ICamera2D, ITexture, IRenderTarget)
Applies a distortion effect to a texture source and render to a target The per-pixel distortion amount is generated from a distortion height map The distortion height map is drawn each frame, in a similar way that DrawStage draw requests are generated, queued and sorted The final distortion amount per-pixel is scaled by a configurable scalar quantity
Declaration
void Distortion(IDistortionStage stage, ICamera2D camera, ITexture source, IRenderTarget target)
Parameters
| Type | Name | Description |
|---|---|---|
| IDistortionStage | stage | The Distortion stage reference |
| ICamera2D | camera | The 2D camera reference used to transform and position the draw vertices |
| ITexture | source | The Texture reference of the source surface the effect will use |
| IRenderTarget | target | The render target surface reference that the post-effect result will be drawn too |
Draw(UInt64, UInt64, UInt64)
Render a draw stage to a target surface
Declaration
void Draw(ulong stage, ulong camera, ulong target)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | stage | The DrawStage id |
| System.UInt64 | camera | The 2D camera id used to transform and position the draw vertices |
| System.UInt64 | target | The render target surface id upon which to draw |
Draw(IDrawStage, ICamera2D, IRenderTarget)
Render a draw stage to a target surface
Declaration
void Draw(IDrawStage stage, ICamera2D camera, IRenderTarget target)
Parameters
| Type | Name | Description |
|---|---|---|
| IDrawStage | stage | The DrawStage reference |
| ICamera2D | camera | The 2D camera reference used to transform and position the draw vertices |
| IRenderTarget | target | The render target reference surface upon which to draw |
MeshRender(UInt64, UInt64, UInt64, UInt64)
Render a 3D Textured Mesh Ambient, Directional and Spotlights can be configured for the stage, along with the Mesh to render
Declaration
void MeshRender(ulong stage, ulong camera, ulong source, ulong target)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | stage | The MeshRender stage id |
| System.UInt64 | camera | The Camera (3D) id that will transform and project the 3D mesh |
| System.UInt64 | source | The Texture id of the source surface the mesh will be texture mapped with |
| System.UInt64 | target | The render target surface id that the result will be drawn too |
MeshRender(IMeshRenderStage, ICamera3D, ITexture, IRenderTarget)
Render a 3D Textured Mesh Ambient, Directional and Spotlights can be configured for the stage, along with the Mesh to render
Declaration
void MeshRender(IMeshRenderStage stage, ICamera3D camera, ITexture source, IRenderTarget target)
Parameters
| Type | Name | Description |
|---|---|---|
| IMeshRenderStage | stage | The MeshRender stage reference |
| ICamera3D | camera | The Camera (3D) reference that will transform and project the 3D mesh |
| ITexture | source | The Texture reference of the source surface the mesh will be texture mapped with |
| IRenderTarget | target | The render target surface reference that the result will be drawn too |
Mix(UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64)
Enables the mixing of up to four textures together The general mix factors per texture are defined in the configuration A further 'per-pixel' mixing scalar can be defined using mixTexture
Declaration
void Mix(ulong stage, ulong mixTexture, ulong tex0, ulong tex1, ulong tex2, ulong tex3, ulong target)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | stage | The Mix stage id |
| System.UInt64 | mixTexture | Optional texture id providing 'per-pixel' mixing factors. R, G, B, A components represents textures 0, 1, 2, 3. The textures do not need to be the same dimensions, hence per-pixel is only an accurate description when they are all the same size |
| System.UInt64 | tex0 | An input Texture id |
| System.UInt64 | tex1 | An input Texture id |
| System.UInt64 | tex2 | An input Texture id |
| System.UInt64 | tex3 | An input Texture id |
| System.UInt64 | target | The render target surface id that the post-effect result will be drawn too |
Mix(IMixStage, ITexture, ITexture, ITexture, ITexture, ITexture, IRenderTarget)
Enables the mixing of up to four textures together The general mix factors per texture are defined in the configuration A further 'per-pixel' mixing scalar can be defined using mixTexture
Declaration
void Mix(IMixStage stage, ITexture mixTexture, ITexture tex0, ITexture tex1, ITexture tex2, ITexture tex3, IRenderTarget target)
Parameters
| Type | Name | Description |
|---|---|---|
| IMixStage | stage | The Mix stage reference |
| ITexture | mixTexture | Optional texture reference providing 'per-pixel' mixing factors. R, G, B, A components represents textures 0, 1, 2, 3. The textures do not need to be the same dimensions, hence per-pixel is only an accurate description when they are all the same size |
| ITexture | tex0 | An input Texture reference |
| ITexture | tex1 | An input Texture reference |
| ITexture | tex2 | An input Texture reference |
| ITexture | tex3 | An input Texture reference |
| IRenderTarget | target | The render target surface reference that the post-effect result will be drawn too |
RemoveViewport()
Clears any set viewport, allowing subsequent rendering operations to draw to entire surfaces
Declaration
void RemoveViewport()
SetViewport(UInt64)
Sets the portion of the render surfaces that subsequent redner operations will draw too The user must clear the viewport if subsequent rendering operations wish to draw to entire surfaces
Declaration
void SetViewport(ulong viewport)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | viewport | The Viewport id to apply to subsequent rendering operations |
SetViewport(IViewport)
Sets the portion of the render surfaces that subsequent redner operations will draw too The user must clear the viewport if subsequent rendering operations wish to draw to entire surfaces
Declaration
void SetViewport(IViewport viewport)
Parameters
| Type | Name | Description |
|---|---|---|
| IViewport | viewport | The Viewport reference to apply to subsequent rendering operations |
StyleEffects(UInt64, UInt64, UInt64)
Apply stylised effects to a texture source and render to a target Effects are: Pixellate, Edge Detection, Cathode Ray Tube and Old Movie Reel, A combination of all the effects can be applied together
Declaration
void StyleEffects(ulong stage, ulong source, ulong target)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | stage | The StyleEffects stage id |
| System.UInt64 | source | The Texture id of the source surface the effects will use |
| System.UInt64 | target | The render target surface id that the post-effect result will be drawn too |
StyleEffects(IStyleEffectsStage, ITexture, IRenderTarget)
Apply stylised effects to a texture source and render to a target Effects are: Pixellate, Edge Detection, Cathode Ray Tube and Old Movie Reel, A combination of all the effects can be applied together
Declaration
void StyleEffects(IStyleEffectsStage stage, ITexture source, IRenderTarget target)
Parameters
| Type | Name | Description |
|---|---|---|
| IStyleEffectsStage | stage | The StyleEffects stage reference |
| ITexture | source | The Texture reference of the source surface the effects will use |
| IRenderTarget | target | The render target surface reference that the post-effect result will be drawn too |