wglbind, floating point pbuffers and fragment shaders

Tearing my hair out:
http://www.cgshaders.org/forums/viewtopic.php?t=386

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 ??

Rob

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 .

– Zeno

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

pocketmoon and Zeno: If you have a repro that you could send me, I’d be happy to take a look.

Pat

Pat,

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.

Rob.

Originally posted by pocketmoon:
[b]Pat,

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.

Rob.[/b]

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.

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.

And just to be specific, I was calling glTrackMatrixNV in my main context but not in my pbuffer context.

Thanks for the education Pat

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…