Render to Texture?

Hi all,

anyone used pbuffers to render to texture with jogl? I’m trying to follow the examples of pure OpenGL, concerning pbuffers, but when I use JoGL, I can’t find methods such as wglGetCurrentContext. Does anybody know where i can find some sample jogl code for pbuffer rendering?

TIA
N

There are two pbuffer “demos” here that you can look at. The short answer is that you don’t need to call wglMakeCurrent since Jogl takes care of that for you when you call the display method. The RTTDemo currently uses nVidias render to texture rectangle extension so it won’t work on any other type of videocard but you can easily change the parameters to power of two and it will work with any card that supports render to texture.

Render to texture in JOGL is not particularly logical in its thought processes and there are number of little gotchas to making it work properly. I finally got it all sorted out a month or so ago in the context of some scene graph work we do in Aviatrix3D. Send me an email and I’ll help you work your way through it. Our “example” code is not that simple so probably wouldn’t help you at all, but at least I can walk you through the issues.

Thank you all for your answers! GKW, I’ve tried the demos, and they work as you said, so I’ll try to learn from them. Mithrantir, I can’t find your e-mail address (where should I look?)

Ah, should be under my profile. Either way, try justin@vlc.com.au for me.