Advertisement

Using pbuffers troubles

Started by November 20, 2004 06:22 PM
3 comments, last by skow 20 years ago
This is my first time using a p buffer and am having some problems. My code is based off the ATI paper on pbuffers. First of all, I know that each pbuffer has it's own states, so I need to do all my glEnable()'s after I make the pbuffer active. Does it use the same view/model/projection matrices that my normal frame buffer uses? Here is basicly what I'm doing, with the end result of when I draw the quad with pbuffer bound as a texture, it's all white. Does this sound right? (the pbuffer is init'd already) Render loop:

-Enable my pbuffer- (wglMakeContextCurrentARB to pbuffer)
gluLookAt()
draw()
-Disable my pbuffer- (wglMakeContextCurrentARB to frame buffer)
OrthoMode()
-Bind pbuffer to thexture- (wglBindTexImageARB)
drawQuad()
-Release the pbuffer from texture- (wglReleaseTexImageARB)
Does this sound right? I can post code if this sounds fine. Thanks for any help
Sounds good to me but you may be missing a step or two. Make sure your setting up your projection matrix for the pbuffer. Also if you are using it to render to a texture make sure you call wglsharelists. For pbuffers you need to set it up just like you normally would an opengl window. I wrote a tutorial on them about 2-3 weeks ago and sent it to Jeff but he has been too busy to post it yet. It should be online soon though :)

- Cheers
Vic
Advertisement
wglShareLists, thats it! Thanks!

I have one last question: I wish to use GL_TEXTURE_RECTANGLE_ARB with the pbuffer as a texture. But I can't seem to find what attribue needs to be passed to wglCreatePbufferARB for that to happen, and for the life of me can't google up a spec on it.

[Edited by - skow on November 21, 2004 12:04:06 PM]
Check out the p-buffer tutorial at Code Sampler ( http://www.codesampler.com/oglsrc.htm ) for some more info if you aren't finding anything on google. That's where I learned to do my p-buffers.
I looked on the tutorial and I saw nothing on using GL_TEXTURE_RECTANGLE_ARB, I did find an nvidia paper saying I can do the GL_TEXTURE_RECTANGLE_NV, but that doesn't help me as I need it to work with ATI cards.

Any one know if this currently is impossible?

This topic is closed to new replies.

Advertisement