3 using SiliconStudio.Core;
4 using SiliconStudio.Core.Mathematics;
5 using SiliconStudio.Paradox.Effects.Modules;
6 using SiliconStudio.Paradox.Graphics;
8 namespace SiliconStudio.
Paradox.Effects
22 ClearColor = Color.Black;
25 EnableClearTarget =
true;
26 EnableClearDepth =
true;
27 EnableClearStencil =
false;
28 EnableSetTargets =
true;
64 public Color ClearColor {
get; set; }
72 public float ClearDepth {
get; set; }
80 public byte ClearStencil {
get; set; }
88 public bool EnableClearTarget {
get; set; }
96 public bool EnableClearDepth {
get; set; }
104 public bool EnableClearStencil {
get; set; }
112 public bool EnableSetTargets {
get; set; }
116 var graphicsDevice = context.GraphicsDevice;
119 if ((EnableClearDepth || EnableClearStencil) &&
DepthStencil != null)
122 if (EnableClearDepth)
123 clearOptions |= DepthStencilClearOptions.DepthBuffer;
124 if (EnableClearStencil)
125 clearOptions |= DepthStencilClearOptions.Stencil;
127 graphicsDevice.Clear(
DepthStencil, clearOptions, ClearDepth, ClearStencil);
133 var pass = context.CurrentPass;
134 var viewParameters = pass.Parameters;
138 if (EnableSetTargets)
140 graphicsDevice.SetRenderTarget(
DepthStencil, RenderTarget);
143 graphicsDevice.SetViewport(viewPort);
SiliconStudio.Paradox.Games.Mathematics.Vector2 Vector2
A renderable texture view.
float Width
Gets or sets the width dimension of the viewport on the render-target surface, in pixels...
float Height
Gets or sets the height dimension of the viewport on the render-target surface, in pixels...
override void OnRendering(RenderContext context)
Performs render pipeline transformations attached to a specific RenderPass.
A service registry is a IServiceProvider that provides methods to register and unregister services...
Thread-local storage context used during rendering.
Defines the window dimensions of a render-target surface onto which a 3D volume projects.
Represents a 32-bit color (4 bytes) in the form of RGBA (in byte order: R, G, B, A).
static readonly Viewport Empty
Empty value for an undefined viewport.
RenderTargetSetter(IServiceRegistry services)
Initializes a new instance of the Renderer class.
A processor that setup a RenderTarget and a DepthStencil on a RenderPass.
DepthStencilClearOptions
Specifies the buffer to use when calling Clear.