OK, I’m hoping I can find a kind soul with some patience – what I am trying to do fits in with “Advanced GL”, even if I don’t
I am trying to do a generic ping-pong simulation. Let me describe how it would work on a CPU, and then move on to my GPU problems:
- Two arrays represent the current and previous state of the system. These are flipped at each stage.
- Four other arrays carry information about the environment – used in calculation of the current state. These arrays do not change.
This looked like a pretty straightforward thing to move to GPU/fragment program/OpenGL.
All of the arrays can be floating point pbuffers bound into textures with the render-to-texture extensions.
I feel at this point that I should point out that when I started this project I was not aware of the new wglChoosePixelFormatARB() function and the attribute list system. It
took me quite awhile to wrap my brain around the fact that pbuffers, floating point pbuffers, and texture pbuffers are three separate extensions, each of which seems to roll in several other extensions. But I’m up to speed there (at least far enough to load up all the extensions I need and get the extended functions running).
The problems that I KEEP running into are:
- All of the extensions are described as deltas from the spec, which makes them nearly impossible to read on their own. But I can work around that given enough time…
- I keep running into statements about values that are recognized by wglChoosePixelFormat (in either the Iattrib list OR the Fattrib list, which only adds to my confusion). An example would be:
<quote>
Accepted in the <piAttributes> array of wglGetPixelFormatAttribivARB and
wglGetPixelFormatAttribfvARB and in the <piAttribIList> and
<pfAttribFList> arrays of wglChoosePixelFormatARB:
WGL_FLOAT_COMPONENTS_NV 0x20B0
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
</quote>
What causes me problems with this kind of statement is that I don’t know if those are keys or values. If they are keys, what values go with them? Should I just assume GL_TRUE/GL_FALSE? If they are values, what key do they belong with?
- I also keep running into comments about internal pixel formats, but not seeing anywhere to choose an internal pixel format (sorry if that sounds incredibly ignorant, but I’ve spent about 4 hours digging as hard as I can around web pages, nVidia developer pages, SGI pages, tutorials, etc, and I can’t seem to get this going).
I get the feeling that there is some kind of basic knowledge that somewhere along the way everybody just got, and nobody mentions anymore, and now there’s a gap that I can’t seem to get across.
Here is a dump of the section of code that is currently driving me nuts. The first four wglCreatePbufferARB calls “work”, in that they return an hpbuf. The second two calls
return 0. I do not actually know if the first four calls return the kind of buffer I want (3 component unconstrained 32bit floating point, for the first four calls, and 4 component for the second two calls).
Any help would be GREATLY appreciated. Any pointers to references that do not assume the reader has made their living as an OpenGL programmer for the last three years would also be greatly appreciated, as they would allow me to come up to speed without wasting anymore of your time.
I am trying to get this done in the next couple of days so I can get results for a feasibility study.
Thanks!
Mac