Infos about Render to Texutre in DX >= 8

Started by
4 comments, last by hansi pirman 21 years, 2 months ago
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
I am a signature virus. Please add me to your signature so that I may multiply... Resistance is futile.
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"
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
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
I am a signature virus. Please add me to your signature so that I may multiply... Resistance is futile.
Yes, the book should apply to DX9 with only very minor changes.

As for your pseudocode, yes, that''s a start. Take a look at the cube map example in the SDK. It should get you started on the basic approach.

Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces"
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
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.
It should also be pointed out that setting the render target causes DX to forget your viewport settings.

This topic is closed to new replies.

Advertisement