Jump to content
  • Advertisement
Sign in to follow this  
Majestik_666

OpenGL render to texture (pBuffer) with fragment shader ?

This topic is 4139 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, I'm trying to render to a pBuffer using a fragment shader and I end up having a crash ... I do the following : create pBuffer some openGL calls copy pBuffer to ram using glReadPixels that works fine without the fragment shader, but if i add glUseFragmentProgram(_shader_Fragment_Program); before my openGL calls, the glReadPixel crashes ... I reduced my fragment shader to a simple gl_FragColor = vec4(0,1,0,1); for test purposes ... I also use rectangle texture via the NV/ARB extension. anyone has any idea ? Thanks a lot !

Share this post


Link to post
Share on other sites
Advertisement
If you are going to use a lot of render to texture, shaders and various buffer objects, then i suggest that you drop the p-buffer and use FBO instead.
It's much more flexible and you don't have to worry about textures and programs being attached to the right context.

Share this post


Link to post
Share on other sites

thanks for the answers,
it was my problem didn't share my program...
works fine now with wglShareLists in it

is the FBO supported by NV and ATI ?
and what speed can i expect when copying from
an FBO to cpu memory ?

Thanks a lot !

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
glReadPixels is like the slowest call there is so FBOs should be faster period.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!