   Post Processing Question
  Hey, I am trying to implement a post processing effect and am a little confused on two three points. As I understand, I need to render my scene to a texture(which has been set as a render target), then apply the effect on that texure, paint a quad over the buffer and finally apply the texture over the quad. I have got all this working and have implemented a blur effect based on the depth texture. Now what I want to do is try and cascade a few post processing effects together. Basically like they do in the Directx sample. So the result of one effect becomes the source texture for the second effect and so on. While I understood the theory I found the actual code to be a bit confusing. They way I am doing it now is : I do my pView->SetRenderTarget(RenderTarget) Then my Draw call which draws my scene on to the texture . Then set my texture in the effect g_effect>SetTexture("asdf", asdf) ; Following this I set my technique and then call g_effect->Begin etc.  What I want to know is how do I pass the result of my first effect file to a second file? Do I need to save it to a texture explicitly and then pass that texture to the secoond file? Thanks   
  How you apply the effect on the texture? You lock the texture and apply it in the CPU? You should do that on the GPU. First render the scene to a texture, then setup a quad which fits in the whole screen (with proper texture coords), set that texture as current, set other texture as render target, set you post processing shader, and render. Now you have a new texture with the image with the first effect applied. Now you can repeat the process setting this last texture as current and another one as render target(if you are not going to use that first one anymore, you can use it) and set the next post processing shader and render, and so on...   ;  hey thanks for the reply. Yes I am doing it on the GPU. When you say "first render scene to texture", I would have to set this texture as the rendertarget wouldn't I? So then should I have two textures set as the render targets?   ;  Your application code needs to completely manage your render targets, and make sure that the result of one pass gets gets set as the texture for the next pass (and so on).  This is typically done with a process known as "ping-ponging", where you render to one texture while sampling another, and then swap so that you're sampling the other texture and rendering to the other texture.  But of course to do this, they need to be the format and dimensions you need.What I usually do is keep a cache of render targets I've created, and when render target is needed for a post processing step I'll first check the cache to see if there's one not currently in use that I could use instead of creating a new one.  So of course the first frame you create a few render targets, but then for subsequent frames you'll keep reusing the same ones as long as your post processing chain doesn't change.  