DarkBASIC Professional Help File

DX11 SET CAMERA RENDER TARGET

Sets the current render target that the specified camera should use for drawing to.
Unlike DX11 SET NEW CAMERA RENDER TARGET, this function expects the render target image to already exist and can for example be used to quickly change render targets
for the same camera at runtime. It also supports more complex render targets such as individual images in a texture array or cubemap / cubemap array.
The render target image provided to this function must have been created using one of the following functions:

- DX11 CREATE RENDER TARGET
- DX11 SET NEW CAMERA RENDER TARGET

You can optionally provide what stage to set the render target for; if using DXVERSION_11_0 you can have up to 8 render targets bound to the same camera at once.
See the documentation for DX11 SET NEW CAMERA RENDER TARGET for further details.
Also take note that this doesn't set any depth stencil state for the camera, unlike DX11 SET NEW CAMERA RENDER TARGET which creates a corresponding D24_S8 buffer.
If the camera had a previous depth / stencil buffer that one will be retained, but a newly created camera will not have any. For most normal situations you'll want a depth-stencil buffer
for proper fragment sorting so you should remember to also set up a depth-stencil buffer and associate it with any newly created cameras using DX11 SET CAMERA DEPTH STENCIL BUFFER.

Syntax

    DX11 SET CAMERA RENDER TARGET camera, rtImage, [arrayIndex], [stage]

Parameters

    camera

> Dword
> The camera to set / replace the render target of.

    rtImage

> Dword
> The render target image to make the specified camera draw to. If you set this to nullptr (zero) the specified render target stage will be removed from the camera.

    [Optional] arrayIndex

> Dword
> If the render target image is a render target array you can set this to determine what image in the array to set as the render target. The array count starts at zero.

    [Optional] stage

> Dword
> The render target stage. Valid values are 0..7. Refer to them in your pixel shader output as SV_TARGETX where X is this id. Defaults to 0.

Returns

This function does not return a value.

See also

CAMERA Functions Menu
DX11 Function Categories