Skip to main content
gamedev.net
🔒 Locked

MRT issues

Started by Phantom Sage Apr 15, 2009 at 6:06 PM 3 replies 1.7k views
Original Post
Phantom Sage
Phantom Sage
I'm in D3D9 and trying to set up multiple render targets and I'm having a hell of a time. I can render to the first target at index 0 just fine, but the other target at index 1 just shows as empty. It's definitely clearing both targets, so I know that much is working. Both targets are the same width and height, and have the same format (D3DFMT_X8R8G8B8) and there is no depth buffer attached. Is there something I might be missing? I've never really tried using MRT before so be gentle. Oh and I've tried the refrast and it's doing the same thing so it's definitely my issue.
nuvem
nuvem
Can't think of anything off the top; can you share the relevant code bits (shader output, MRT setup)?
Phantom Sage
Phantom Sage
I haven't got any shaders set up. Could that be the issue? Again, I've never used MRT before so I have no idea (I certainly didn't see anything specific in the documentation)

The code isn't terribly complex:
SetAdditionalRenderTarget(0, _normalTarget);SetAdditionalRenderTarget(1, _specTarget);RenderSprites();SetAdditionalRenderTarget(0, Screen);  // Where screen is just the primary render target.SetAdditionalRenderTarget(1, null);
Set AdditionalRenderTarget is just this:
Screen.Device.SetRenderTarget(index, target.SurfaceBuffer);
The actual rendering code is just filling a dynamic vertex buffer and calling Begin/EndScene and the usual DrawPrimitive stuff in between.

The render targets are both 640x480 and as I said before, use D3DFMT_X8R8G8B8 for their format.

It's so weird. Clear works just fine, but I can't seem to get anything else to show up.
nuvem
nuvem
Quote:
Original post by Tape_Worm
I haven't got any shaders set up. Could that be the issue? Again, I've never used MRT before so I have no idea (I certainly didn't see anything specific in the documentation)


That would do it! The documentation could use some improvement on that note, but as you might have noticed there's no way to specify the output to each target using the FFP.
Phantom Sage
Phantom Sage
Quote:
Original post by nuvem
Quote:
Original post by Tape_Worm
I haven't got any shaders set up. Could that be the issue? Again, I've never used MRT before so I have no idea (I certainly didn't see anything specific in the documentation)


That would do it! The documentation could use some improvement on that note, but as you might have noticed there's no way to specify the output to each target using the FFP.


Yep, that did it. Thanks for the help. Rate++ for you.

Yeah you'd think they'd be a little more explicit about this in the documentation.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.