PDA

View Full Version : Multiple rendering passes on GPU


leo77
05-23-2005, 08:12 PM
Hi...

I'm building a program (on the GPU, pixel shader) that will need to have multiple rendering passes. How do I do that without downloading the result to the CPU?

(someone told me to use PBuffers, how do I do that?)

thanks

Leo

ps: using openGL, CG, C++, windows (visual studio .NET)

arnecls
05-23-2005, 09:53 PM
I never used pbuffers but you can use the render to texture extension and combine your passes that way (fragmentshader). It's kind of slow I guess but the data stays on the gpu afaik.

mummey
05-23-2005, 11:17 PM
Step One: Google PBuffer (http://www.google.com/search?q=pbuffer&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official)

playmesumch00ns
05-24-2005, 09:28 AM
Depending on which card and which drivers you have you might be able to use render to texture or frame buffer objects.

The most-supported way is to use pbuffers.

You create a pbuffer, render to it as you would the framebuffer, then use glCopyTexSubImage2d to copy the contents into a texture. You can then bind that texture to another fragment shader or read it back into main memory.

ajm000
05-24-2005, 11:04 AM
I recently asked this similar question on another post and the advice given to me was to use CgFx since I was using Cg language in a shader project that I am currently doing. They say that we cannot implement multipass rendering using Cg alone. I'm also in the dark right now. i will send you an email on anything I can find. my email is altair@bulacan.ph you can send me additional info there too if you like. thanks.

playmesumch00ns
05-25-2005, 08:46 AM
They are talking out their behinds. CgFX is just a high-level wrapper for common shader-setup stuff.

Also, leo77, when you say multipass rendering, do you mean rendering passes as input to the final frame, or doing mean generating multiple output passes from the render?

leo77
05-30-2005, 02:31 PM
I mean rendering passes as input to the final frame.
I've already started to use Mark Harris' RenderTexture http://www.markmark.net/misc/rendertexture.html , but I got some strange errors with glew.h (this class uses to load the extensions, http://glew.sourceforge.net/ ) when I execute the program:
GLEW error: GL 1.1 and up are not supported

(just for the record, it IS supported, Im using an ATI 9600, but Ill also test it on NVIDIA 6800 and 6200...)
If someone could give me a clue of what is this error about (or some way to use pbuffers without using glew.h) will be very helpfull.

thanks

mummey
05-30-2005, 03:24 PM
I mean rendering passes as input to the final frame.
I've already started to use Mark Harris' RenderTexture http://www.markmark.net/misc/rendertexture.html , but I got some strange errors with glew.h (this class uses to load the extensions, http://glew.sourceforge.net/ ) when I execute the program:
GLEW error: GL 1.1 and up are not supported

(just for the record, it IS supported, Im using an ATI 9600, but Ill also test it on NVIDIA 6800 and 6200...)
If someone could give me a clue of what is this error about (or some way to use pbuffers without using glew.h) will be very helpfull.

thanks

Google pbuffers. (http://www.google.com/search?q=pbuffers)

playmesumch00ns
05-31-2005, 09:26 AM
If you download the nvsdk from developer.nvidia.com, there's a couple of examples of using pbuffers in there with classes to set them up. Personally I use GLEW and it works just fine for me.

leo77
05-31-2005, 02:54 PM
thanks guys...
this last problem was a Driver problem - apparently the Catalyst version I had wasn't fully compatible with glew 1.3.3, the program was fine when tested in NVIDIA 6800 with drivers up-to-date.

MRz
06-01-2005, 12:52 AM
Latest catalys supports OpenGL 2.0. Glew compares lowest version number, If it's lower than 1, glew thinks that OpenGL 1.1 is not supported.

CGTalk Moderation
06-01-2005, 12:52 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.