IGraphicsFactory

interface IGraphicsFactory : IGenerateFactory

The factory interface which is used to create render passes before they are added to the render pipeline.

Use these methods to construct render passes with the appropriate settings, and pass the resulting value into M:Protogame.IRenderPipeline.AddFixedRenderPass(Protogame.IRenderPass) or M:Protogame.IRenderPipeline.AppendTransientRenderPass(Protogame.IRenderPass).

I2DDirectRenderPass Create2DDirectRenderPass()

Creates a render pass in which graphics rendering is configured for an orthographic view. When this render pass is active, the X and Y positions of entities map directly to the X and Y positions of the game window, with (0, 0) being located in the top-left.

During this render pass, rendering operations are performed immediately on the rendering target. To batch multiple texture render calls, use an T:Protogame.I2DBatchedRenderPass instead or in addition to this render pass.

Returns:A 2D render pass where rendering is performed directly.
I2DBatchedRenderPass Create2DBatchedRenderPass()

Creates a render pass in which graphics rendering is configured for an orthographic view. When this render pass is active, the X and Y positions of entities map directly to the X and Y positions of the game window, with (0, 0) being located in the top-left.

During this render pass, all texture render calls are batched together with a T:Microsoft.Xna.Framework.Graphics.SpriteBatch, and flushed at the end of the render pass.

Returns:A 2D render pass where rendering is batched together.
I2DBatchedLoadingScreenRenderPass Create2DBatchedLoadingScreenRenderPass()

Creates a render pass in which graphics rendering is configured for an orthographic view. When this render pass is active, the X and Y positions of entities map directly to the X and Y positions of the game window, with (0, 0) being located in the top-left.

During this render pass, all texture render calls are batched together with a T:Microsoft.Xna.Framework.Graphics.SpriteBatch, and flushed at the end of the render pass.

This is a seperate render pass to T:Protogame.I2DBatchedRenderPass to allow optimal rendering of basic loading screens.

Returns:A 2D render pass where rendering is batched together.
ICanvasRenderPass CreateCanvasRenderPass()

Creates a render pass in which graphics rendering is configured for an orthographic view, and canvas entities will automatically render their canvases. When this render pass is active, the X and Y positions of entities map directly to the X and Y positions of the game window, with (0, 0) being located in the top-left.

During this render pass, all texture render calls are batched together with a T:Microsoft.Xna.Framework.Graphics.SpriteBatch, and flushed at the end of the render pass.

This render pass is identical to T:Protogame.I2DBatchedRenderPass, except it is given an explicit interface so that T:Protogame.CanvasEntity knows when to render.

Returns:A 2D render pass where canvases are rendered.
I3DForwardRenderPass Create3DRenderPass()
I3DForwardRenderPass Create3DForwardRenderPass()

Creates a render pass in which forward rendering is used.

Returns:A 3D render pass.
I3DDeferredRenderPass Create3DDeferredRenderPass()

Creates a render pass in which deferred rendering is used.

Returns:A 3D render pass.
Protogame.IDebugRenderPass CreateDebugRenderPass()

Creates a render pass in which calls to T:Protogame.IDebugRenderer and the state of physics objects are rendered to the screen.

Returns:A debug render pass.
Protogame.IConsoleRenderPass CreateConsoleRenderPass()

Creates a render pass which handles an in-game console. You need to include a console render pass if you want custom commands with T:Protogame.ICommand to work.

Returns:A console render pass.
IInvertPostProcessingRenderPass CreateInvertPostProcessingRenderPass()

Creates a post-processing render pass which inverts all of the colors on the screen.

Returns:A color inversion post-processing render pass.
IBlurPostProcessingRenderPass CreateBlurPostProcessingRenderPass()

Creates a post-processing render pass which applies a guassian blur filter to the screen.

Returns:A guassian blur post-processing render pass.
ICustomPostProcessingRenderPass CreateCustomPostProcessingRenderPass(string effectAssetName)

Creates a post-processing render pass that uses a custom effect (shader).

This method is a quick way of creating new post-processing render passes based on custom shaders, without implementing T:Protogame.IRenderPass. However, by using T:Protogame.ICustomPostProcessingRenderPass, you don’t obtain any strongly typed validation of shader usage, so it’s preferable to implement a render pass for each new post-processing render pass you want to create.

Parameters:
  • effectAssetName (string) – The name of the effect asset to use.
Returns:

A custom post-processing render pass using the shader you specified.

ICustomPostProcessingRenderPass CreateCustomPostProcessingRenderPass(Protogame.EffectAsset effectAsset)

Creates a post-processing render pass that uses a custom effect (shader).

This method is a quick way of creating new post-processing render passes based on custom shaders, without implementing T:Protogame.IRenderPass. However, by using T:Protogame.ICustomPostProcessingRenderPass, you don’t obtain any strongly typed validation of shader usage, so it’s preferable to implement a render pass for each new post-processing render pass you want to create.

Parameters:
  • effectAsset (Protogame.EffectAsset) – The effect asset to use.
Returns:

A custom post-processing render pass using the shader you specified.

ICustomPostProcessingRenderPass CreateCustomPostProcessingRenderPass(Effect effect)

Creates a post-processing render pass that uses a custom effect (shader).

This method is a quick way of creating new post-processing render passes based on custom shaders, without implementing T:Protogame.IRenderPass. However, by using T:Protogame.ICustomPostProcessingRenderPass, you don’t obtain any strongly typed validation of shader usage, so it’s preferable to implement a render pass for each new post-processing render pass you want to create.

Parameters:
  • effect (Microsoft.Xna.Framework.Graphics.Effect) – The effect to use.
Returns:

A custom post-processing render pass using the shader you specified.

ICaptureCopyPostProcessingRenderPass CreateCaptureCopyPostProcessingRenderPass()

Creates a post-processing render pass which captures the current state of the render pipeline as a separate render target. This is more expensive than T:Protogame.ICaptureInlinePostProcessingRenderPass, but allows you to access the result at any time between the end of this render pass, and the begin of this render pass in the next frame.

ICaptureInlinePostProcessingRenderPass CreateCaptureInlinePostProcessingRenderPass()

Creates a post-processing render pass which captures the current state of the render pipeline as a separate render target. This is cheaper than T:Protogame.ICaptureCopyPostProcessingRenderPass, but you can only access the render target state in the action callback set on the render pass. Modifying the render target, e.g. by performing any rendering at all, will modify the result of the render pipeline.