Use Multiple Render Targets for Differing Primitive Projections?

Started by
4 comments, last by kauna 11 years, 5 months ago
I have a point list of vertices(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST) that I wish to render to two render targets. I was hoping I'd be able to set both render targets simultaneously using OMSetRenderTargets. However, my situation is unique in that I want each point (Vertex) to be projected differently onto the two render targets.

If I'm understanding the use of multiple render targets correctly, you can only specify different output COLORS for each render target from the Pixel Shader using the SV_Target semantic - using an index suffix to specify the render target (SV_Target0, SV_Target1). But by this stage in the pipeline, the projection position of the pixel has already been determined.

It appears that the SV_Position semantic doesn't give you the same option to specify multiple projection positions for a vertex from the Vertex Shader. Is that correct?

Can anyone think of another way I could do pull this off? Or will I need to perform two separate draw calls on this set of vertices?

Thanks in advance for any help and suggestions.

Tim
Advertisement
You can do this with a geometry shader and render target array index. Check out for example the CubeMapGS sample in the Direct3D 10 samples in the DX SDK.

You can do this with a geometry shader and render target array index. Check out for example the CubeMapGS sample in the Direct3D 10 samples in the DX SDK.


Thanks for the suggestion. I looked this over, but it will not work for me as my render targets are not an array type (and can't be as they are different dimensions). Any other ideas?
You might be out of luck then, unfortunately.
From http://msdn.microsoft.com/en-us/library/windows/desktop/ff476464%28v=vs.85%29.aspx:

The pixel shader must be able to simultaneously render to at least eight separate render targets. All of these render targets must access the same type of resource: Buffer, Texture1D, Texture1DArray, Texture2D, Texture2DArray, Texture3D, or TextureCube. All render targets must have the same size in all dimensions (width and height, and depth for 3D or array size for *Array types). If render targets use multisample anti-aliasing, all bound render targets and depth buffer must be the same form of multisample resource (that is, the sample counts must be the same). Each render target can have a different data format. These render target formats are not required to have identical bit-per-element counts.
[/quote]

You might be out of luck then, unfortunately.


No problem. I can do it in two separate draw calls, I was just wondering if I could improve efficiency since the input data is exactly the same. Thanks for the info!
If your drawing code is as efficient as it can be, not using Geometry Shader won't slow down a much. GS may help you to reduce the draw calls, but the overall efficiency gain may be close to 0.

Cheers!

This topic is closed to new replies.

Advertisement