Jump to content
  • Advertisement
Sign in to follow this  
ehsan_the_tiamat

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

This topic is 4610 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 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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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,...

Share this post


Link to post
Share on other sites
RenderToTexture.BeginScene RenderedTexture
RenderScene
RenderToTexture.EndScene

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

Hope this helps :)

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!