From bfacdc8f9573a85dccf4a366ae2fc94915a1a27e Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Wed, 17 Mar 2021 12:45:32 -0700 Subject: [PATCH] update the backed render target docs --- content/Graphics/Resources/RenderTarget.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/content/Graphics/Resources/RenderTarget.md b/content/Graphics/Resources/RenderTarget.md index 06cf744..e133b2a 100644 --- a/content/Graphics/Resources/RenderTarget.md +++ b/content/Graphics/Resources/RenderTarget.md @@ -28,7 +28,7 @@ When we use a texture slice to create a render target, we say that the render ta A lot of the time you will be creating render targets and textures at the same time. We have a nice shortcut for that. ```cs -var myRenderTarget = RenderTarget.CreateBackedColorTarget2D( +var myRenderTarget = RenderTarget.CreateBackedRenderTarget( GraphicsDevice, 1280, 720, @@ -64,13 +64,15 @@ var depthBuffer = new RenderTarget( ); ``` -This sets up a 1280x720 32-bit depth buffer. Guess what - we have a shortcut for that too! +This sets up a 1280x720 32-bit depth buffer. We can also use our above-mentioned method to do the same thing. ```cs -var depthBuffer = RenderTarget.CreateDepthBuffer( +var depthBuffer = RenderTarget.CreateBackedRenderTarget( GraphicsDevice, 1280, - 720 + 720, + TextureFormat.D32, + false ); ``` @@ -80,6 +82,8 @@ One last thing to note - depth buffers can also contain a "stencil buffer". Sten var depthStencilBuffer = RenderTarget.CreateDepthStencilBuffer( GraphicsDevice, 1280, - 720 + 720, + TextureFormat.D32S8, + false ); ```