Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

hansi pirman

Infos about Render to Texutre in DX >= 8

This topic is 5666 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

hi I''m searching websites or papers about rendering to textures in DX8. i think there must be other ways then ID3DXRenderToSurface. maybe someone has some infos/urls which sompare different approaches, etc... I allready did a google search, but most of the stuff i found was for DX7.. thanks in advance hansi pirman

Share this post


Link to post
Share on other sites
Advertisement
I have a couple of chapters about this in the first book below.

The short answer is that you can create a texture with the correct flags and get the underlying surface for that texture. Then, set that surface as your back buffer and render. There are a few more pieces (such as dealing with the depth buffer and the changing viewports), but it can be done without the D3DX functions.

Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces"

Share this post


Link to post
Share on other sites
thanks for the answers!
i bought 3 books last month, so i have do make a little "buy-stop" for now but a buddy of mine said this is an excellent book. maybe i gonna buy it anyway later.. ?!?
does most of the stuff in the book also apply to DX9?

you mean i should try something like this:

// save back buffer first
dev->GetBackBuffer(..,..,..,&savedBackBuffer);

dev->SetRenderTarget(0,surfaceOfMyTexture);
drawStuff();
dev->Present(..);

// restore BackBuffer
dev->SetRenderTarget(0,savedBackBuffer);

?

kind regards
hansi pirman

Share this post


Link to post
Share on other sites
Or have a look at my website (www.wolfnight.org): I''ve done a ''Render To Texture''-Sample some time ago. You can download the source (Delphi - but actually not hard to read) in the download-section.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!