Sign in to follow this  

Shaders and Backbuffer

This topic is 4837 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

Hola to everyone, just for knowledge, is there a way to access within the pixel shaders the backbuffer as if it was a simple texture so that i can test some image post-processes, or a way to do something similar(without render the scene in a texture or blitting da bb into it :)? Thanx in advance to all !!! [Edited by - giuseppeCT on September 14, 2004 6:16:31 AM]

Share this post


Link to post
Share on other sites
Don't think so. I'm pretty confident that the best way is to render your scene to a texture, and then read from that texture in the pixel shader.

Share this post


Link to post
Share on other sites
Sure, looking to the 3d render pipeline there are not chances to do that other than draw to a render target texture, it were obvious, anyway pretty wasteful !!! thanx for the answer dude !!

Share this post


Link to post
Share on other sites
You may render to the backbuffer and then copy that surface to your own texture and use that texture as a source for the pixel shader. (IDirect3DDevice9::GetBackBuffer and IDirect3DDevice9::UpdateSurface) This is also a waste of time but at least antialiasing will work. (AFAIK if you are rendering to a rendertarget AA will be disabled)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I may be completly offbase and I don;t know what you are trying to accomplish but if alphablending where enabled you could simply never clear the backbuffer and do things in a multipass way.

Share this post


Link to post
Share on other sites
Reading the backBuffer is very slow and stops the parallelism between the CPU and the GPU unless you use the D3DLOCK_DONOTWAIT Flag (Sorry if the spelling is wrong). Generally locking the back buffer is something that Causes the driver to flush the pipeline, and I think it is not good to lock the whole back buffer. this will cause the back buffer to be copied to the memory which depends on your bus speed.

Share this post


Link to post
Share on other sites
So, how's made the fullscreen filter effect in prince of persia ? i remeber one of my friends had a bug in its video card driver where it was very evident, a kind of filter upon all the screen but wrong aligned.....

Share this post


Link to post
Share on other sites
Render to texture, then draw a quad to the backbuffer with one texture being your rendertarget containing the scene and another the effect to overlay. Or whatever - depends on the effect.
The effect would probably be a result of some function on your scene rendertarget.

Share this post


Link to post
Share on other sites
As supposed, anyway i remember that create textures with size other than power x with base 2 does'nt works with all videocards, so i think i could create a texture of size power x with base 2 and play with texcoords......right?

Share this post


Link to post
Share on other sites

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

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