View Full Version : wglbind, floating point pbuffers and fragment shaders

09-19-2002, 11:27 AM
Tearing my hair out:

Using the latest Cg and NV30 emulation drivers.

To Task In Hand:

Start with the simple_float_pbuffer example and convert it to use wglbind... and a fragment shader to sample the pbuffer texture.

I just cant get it to work. Any ideas ??


09-19-2002, 11:41 AM
Pocketmoon -

If I understand you're problem correctly, it looks like the same thing that I mentioned here: http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/007441.html

Basically, my program seems to just stall if I try to apply a pbuffer as a texture inside a fragment program.

Unfortunately, no one has responded and I haven't had time to revisit the problem yet http://www.opengl.org/discussion_boards/ubb/frown.gif.

-- Zeno

[This message has been edited by Zeno (edited 09-19-2002).]

09-20-2002, 07:10 PM
pocketmoon and Zeno: If you have a repro that you could send me, I'd be happy to take a look.


09-23-2002, 02:30 PM

did you have a chance to look at the code I sent you ?

I've narrowed it down to the pbuffer/copytex not liking an active vertex program.


09-23-2002, 09:04 PM
Originally posted by pocketmoon:

did you have a chance to look at the code I sent you ?

I've narrowed it down to the pbuffer/copytex not liking an active vertex program.


I think we are running with different (incompatible?) SDK versions. I had to hack on it a couple different ways to compile/link, and after I did, it cratered on create() with "this" set to NULL. As far as I can tell, you are using only fragment programs, probably that's what you meant above. I'll see if I can dig up some example code that works and maybe we can figure out the differences.

09-24-2002, 07:41 PM
Just to follow up -- we got to the bottom of pocketmoon's problem. The issue was that the program was using multiple contexts sharing program objects.

Even though vertex or fragment programs are shared, it doesn't necessarily mean that the underlying program parameters are. If your program references state belonging to a context, including those in "program environment parameters" (same as NV_vertex_program "program parameters"), those program constants need to be set up appropriately in every context using the program.

Constants declared inside a program or "program local parameters" are properties of the program itself, so should apply to all contexts using the program. Note that modifying constants in one context while a program is bound in another context is a dangerous proposition (since there's no convenient way to synchronize between multiple contexts). There is a small warning to this effect in the ARB program specs.

09-25-2002, 12:06 AM
And just to be specific, I was calling glTrackMatrixNV in my main context but not in my pbuffer context.

Thanks for the education Pat http://www.opengl.org/discussion_boards/ubb/smile.gif

09-26-2002, 01:22 AM
mind your - It STILL only works if I use copytex and not wglbind....

I still think there *may* be a problem with wglbind and floating point buffers

off to check the 1.4 specs anyway...