Table of Contents

Class RenderTarget3D

Namespace
Microsoft.Xna.Framework.Graphics
Assembly
MonoGame.Framework.dll

Represents a 3D texture resource that will be written to at the end of a render pass.

public class RenderTarget3D : Texture3D, IDisposable
Inheritance
RenderTarget3D
Implements
Inherited Members

Remarks

After a render pass the render target contains the color information of a rendered image.

Render targets represent a linear area of display memory and usually resides in the display memory of the display card. Because of this, objects must be recreated when the device is reset.

Constructors

RenderTarget3D(GraphicsDevice, int, int, int)

Creates a new RenderTarget3D instance with the specified parameters.

public RenderTarget3D(GraphicsDevice graphicsDevice, int width, int height, int depth)

Parameters

graphicsDevice GraphicsDevice

The graphics device to associate with this render target resource.

width int

Width, in pixels, of the render target.

height int

Height, in pixels, of the render target.

depth int

Depth, in pixels, of the render target.

Exceptions

ArgumentNullException

The graphicsDevice parameter is null.

ArgumentOutOfRangeException

The width and/or height and/or depth parameters less than or equal to zero.

RenderTarget3D(GraphicsDevice, int, int, int, bool, SurfaceFormat, DepthFormat)

Creates a new RenderTarget3D instance with the specified parameters.

public RenderTarget3D(GraphicsDevice graphicsDevice, int width, int height, int depth, bool mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat)

Parameters

graphicsDevice GraphicsDevice

The graphics device to associate with this render target resource.

width int

Width, in pixels, of the render target.

height int

Height, in pixels, of the render target.

depth int

Depth, in pixels, of the render target.

mipMap bool

true if mipmapping is enabled; otherwise, false.

preferredFormat SurfaceFormat

The preferred surface format of the render target.

preferredDepthFormat DepthFormat

The preferred depth format of the render target.

Exceptions

ArgumentNullException

The graphicsDevice parameter is null.

ArgumentOutOfRangeException

The width and/or height and/or depth parameters less than or equal to zero.

RenderTarget3D(GraphicsDevice, int, int, int, bool, SurfaceFormat, DepthFormat, int, RenderTargetUsage)

Creates a new RenderTarget3D instance with the specified parameters.

public RenderTarget3D(GraphicsDevice graphicsDevice, int width, int height, int depth, bool mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage)

Parameters

graphicsDevice GraphicsDevice

The graphics device to associate with this render target resource.

width int

Width, in pixels, of the render target.

height int

Height, in pixels, of the render target.

depth int

Depth, in pixels, of the render target.

mipMap bool

true if mipmapping is enabled; otherwise, false.

preferredFormat SurfaceFormat

The preferred surface format of the render target.

preferredDepthFormat DepthFormat

The preferred depth format of the render target.

preferredMultiSampleCount int

The preferred number of samples per pixel when multisampling.

usage RenderTargetUsage

The behavior to use when binding the render target to the graphics device.

Properties

DepthStencilFormat

Gets the depth format used by this RenderTarget3D

public DepthFormat DepthStencilFormat { get; }

Property Value

DepthFormat

IsContentLost

Gets a value that indicates whether the contents of this RenderTarget3D has been lost due to a lost device event.

[Obsolete("This is provided for XNA compatibility only and will always return false")]
public bool IsContentLost { get; }

Property Value

bool

Remarks

This property will always return false. It is included for XNA compatibility.

MultiSampleCount

Gets the number of samples taken per pixel

public int MultiSampleCount { get; }

Property Value

int

RenderTargetUsage

Gets or Sets the usage type used by this RenderTarget3D

public RenderTargetUsage RenderTargetUsage { get; }

Property Value

RenderTargetUsage

Methods

QuerySelectedFormat(GraphicsDevice, SurfaceFormat)

protected static SurfaceFormat QuerySelectedFormat(GraphicsDevice graphicsDevice, SurfaceFormat preferredFormat)

Parameters

graphicsDevice GraphicsDevice
preferredFormat SurfaceFormat

Returns

SurfaceFormat

Events

ContentLost

Occurs when a graphics device lost event is triggered.

[Obsolete("This is provided for XNA compatibility is never called by MonoGame")]
public event EventHandler<EventArgs> ContentLost

Event Type

EventHandler<EventArgs>

Remarks

This event is never called. It is included for XNA compatibility.

latest ▼