Sign in to follow this  
ehsan_the_tiamat

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

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
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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this