a good toturial for rendering to texture in directx???

Started by
6 comments, last by CadeF 18 years, 6 months ago
HI Is there a good toturial for post processing effects in directx??? I dont need the shader code i just want a toturial about how to set up the texture target and quad for rendering. i'm reading the book "shaders for game programmers and artist" and it does all its shader codes in rendermonkey and doesnt have any explanation on setting up DX for using its shaders.
Advertisement
Hi man,

You don't really need a wholu tutorial for this one. All you have to do is creating an ordinary texture with CreateTexture.
Then, you get its 0 level surface with GetSurfaceLevel, and you pass this surface to SetRendertarget. After finishing, you Release it, and set back your origninal render target, which you previously saved with GetRenderTarget.

Looking at the SDK pages for these functions, you will be able to do it, for sure.

kp
------------------------------------------------------------Neo, the Matrix should be 16-byte aligned for better performance!
Quote:Original post by kovacsp
All you have to do is creating an ordinary texture with CreateTexture.

Remember to use D3DUSAGE_RENDERTARGET flag, and use the D3DPOOL_DEFAULT pool.

A good little download showing you how to render to off screen surfaces. It does you D3DX calls, but if your with DX, I cant see that being a problem

Code Sampler

Spree
I'm using shaders for rendering. is there any difference in this case??? if there is any toturial about this please post the link or if there is not please describe for me in brief.
thx in advance
Well, it depends what you are doing with the shader. If you are using a shader to render to the texture, that probably will work, depending on the shader. If you are using a render-to-texture texture with a shader, that will work.
my shader does the regular texturing and lighting plus bump mapping and reflection and refraction. i want to render resulting image of these effects to texture and then use post processing effects with another effect file to achive effects like edge detection and sepia,...
RenderToTexture.BeginScene RenderedTexture
RenderScene
RenderToTexture.EndScene

D3DDevice.SetTexture 0, RenderedTexture
Render full screen box, fvfTL

Hope this helps :)

This topic is closed to new replies.

Advertisement