Jump to content
  • Advertisement
Sign in to follow this  
Thrawn80

Direct3D 9 Render Target issues

This topic is 2482 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Dear all,

I've been trying to render sprites onto a new render target. The sprites aren't the standard point sprites though.

What happened was, even after following the steps correctly, ie,

=== Render-to-texture stage ===
1) Back up the old render target surface
2) Get a pointer to the new render target surface
3) Set this pointer as the render target
4) Clear render target with color
5) begin scene
6) render by pumping vertex data
7) end scene

The results are set as the texture in stage 0 of a mesh to see its results. However, the only thing I got was an empty sheet, which takes on whatever color I passed into the Clear() call.

I've ran using Debug Runtimes, set logging to the max, stepped through the codes to examine HRESULT return values, but they're all S_OK...

The sprite is using a texture which resembles a hole; has alpha channel but is entirely 100%.

Thus I'd expect the render target to contain the holes, however, the results are just not appearing. I really just need to render the holes onto this render target as though as it's the old DirectDraw blt() method... just not getting the results...

Can anyone help me please?

I've read from somewhere that I have to set an alternative perspective projection to the new render target, but is it necessary if I'm just rendering transformed vertices directly onto the render target?

Any help will be greatly appreciated!

thrawn80.

Share this post


Link to post
Share on other sites
Advertisement
Ah shucks! Please ignore my post as I've found the actual cause of the sprites not rendered. It's a fault on my part and I'm sorry to have caused any confusion.

For the benefit of those who might view this post in search for answers - the abovementioned steps are generally correct. There's a need to process the render target as a separate scene usually. However, depending on how the rendering is done, if it's done directly via D3D codes, then it should be ok. However, if there's a proxy or interface, one has to take note of the possible vertex manager handling the entire rendering process.

Point is, I won't wanna have primitives dangling around in the vertex manager while processing the render target separately..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!