DX11 - Multiple Render Targets

Started by
22 comments, last by Migi0027 10 years, 9 months ago

Just so you know, the render targets are valid, as when I clear them with, e.g. a red or a green color, it appears in the output, even in pix.

But it still appears as if the second and third render targets aren't being written to...

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

Advertisement

Look at the render targets while having selected the draw call that should render to them. what shows up there? Right-click any pixel, and press "debug pixel". Also, try to output explicitely float4(1.0f, 1.0f, 1.0f, 1.0f) to the second and third render target - there might be some issue with your calculations here.

When debuggin the first RT, the pixel is written to correctly:

Pixel History
Pixel (427, 298) of Render Target 0x069F85B8, Frame 616

Initial framebuffer value Alpha: 0.000 Red: 0.000 Green: 0.000 Blue: 0.000 Event 315: ID3D11DeviceContext::ClearRenderTargetView(0x0BAA5F98, 0x0017F1EC) Alpha: 1.000 Red: 0.000 Green: 1.000 Blue: 0.000 Event 329: ID3D11DeviceContext::DrawIndexed(36, 0, 0) Primitive 1 of 12

Vertex Shader:0x0BAA5EE8
Debug Vertex 0
Debug Vertex 1
Debug Vertex 2

Geometry Shader:(none)

Pixel Shader:0x0BAA5F40
Debug Pixel (427, 298)
Pixel shader output: Alpha: 1.000 Red: 0.988 Green: 0.988 Blue: 0.988
Final framebuffer color: Alpha: 0.000 Red: 0.000 Green: 0.000 Blue: 0.000 Event 329: ID3D11DeviceContext::DrawIndexed(36, 0, 0) Primitive 11 of 12

Vertex Shader:0x0BAA5EE8
Debug Vertex 0
Debug Vertex 1
Debug Vertex 2

Geometry Shader:(none)

Pixel Shader:0x0BAA5F40
Debug Pixel (427, 298)
Pixel shader output: Alpha: 1.000 Red: 0.988 Green: 0.988 Blue: 0.988
Final framebuffer color: Alpha: 0.000 Red: 0.000 Green: 0.000 Blue: 0.000 Final framebuffer value Alpha: 1.000 Red: 1.000 Green: 0.000 Blue: 0.000

But then in the 2nd render target, nothing is there!

Same pixel location as in the 1st RT:

Pixel History
Pixel (427, 298) of Render Target 0x069F8658, Frame 616

Initial framebuffer value Alpha: 0.000 Red: 0.000 Green: 0.000 Blue: 0.000 Event 317: ID3D11DeviceContext::ClearRenderTargetView(0x0BAA6048, 0x0017F1EC) Alpha: 1.000 Red: 1.000 Green: 0.000 Blue: 0.000 Final framebuffer value Alpha: 1.000 Red: 1.000 Green: 0.000 Blue: 0.000

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

Thats odd. On that same draw-call, look at the device, and inspect its states till you have found the render-target section (don't know which category its under, you should easily find it). Are all render targets still bound at this point in time?

Render Targets

Slot Buffer

0 0x069F85B8

1 0x069F8658

2 0x069F86F8

(3-7) NULL

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

And all of those pointers are valid, they point to the right render targets!

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

316oml2.png

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

I dont know if this is too much to ask for, but maybe one of you guys can write a small mini tutorial with all the steps to create a directx 11 app with multiple render targets, like a small step based tutorial, e.g.:

  • Do this...
  • ...
  • Then that

To see if I've done everything right... wacko.png

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

I do believe that all my render targets are valid, as if I change the order of the render targets, it's still the first render target that works.

Btw, how can you check the maximum render targets your graphics card supports?

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

The output signature of the pixel shader:


// Output signature:
//
// Name                 Index   Mask Register SysValue Format   Used
// -------------------- ----- ------ -------- -------- ------ ------
// SV_Target                0   xyzw        0   TARGET  float   xyzw
// SV_Target                1   xyzw        1   TARGET  float   xyzw
// SV_Target                2   xyzw        2   TARGET  float   xyzw

After hours in PIX, all the render targets seems to be connected correctly, but when rendering the mesh (PIX has the quite amazing feature where you can see the resources change over time!), still only the first render target gets written to!

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

This topic is closed to new replies.

Advertisement