PDA

View Full Version : OpenGL 2.0 Spec



valoh
09-08-2004, 10:23 AM
mhh, no thread regarding the OpenGL 2.0 Spec (http://www.opengl.org/documentation/specs/version2.0/glspec20.pdf) ? Ok, then I will start one :D

After a quick read I'm missing the float texture formats. Shouldn't they become part of the OpenGL 2.0 spec?

Corrail
09-08-2004, 11:31 AM
Yes, originally floating point texture formats should be a part of OpenGL 2.0 but AFAIK they didn't make it in time. There will be an extension covering this feature but I don't know when it will be released.

But I'm a little bit confused about the extensions which where promoted into OpenGL 2.0 core. For example they say for two sided stencil they use ATI_seperate_stencil and a state of EXT_stencil_two_side. So which extension should be used for Windows where only OpenGL 1.1 is available? Will there be an ARB extension or simply use ATI_seperate_stencil?

mw
09-08-2004, 01:24 PM
There is no need use the ARB, EXT or vendor specific versions of the core routines. OpenGL 2.0 Drivers will expose entry points all core routines, but they have to be loaded via the standard extension mechanism (ie wglGetProcAddress("glGetHandle"); instead of wglGetProcAddress("glGetHandleARB"); )- of course wglGetProcAddress("glGetHandleARB"); should still return the correct entry point, since most drivers include extensions which have already gone into core.

KRONOS
09-08-2004, 02:29 PM
The ATI_seperate_stencil is weird! I don't know what to use... I think the extension to use is ATI's but what state does it get from EXT_stencil_two_side?

Corrail
09-08-2004, 03:01 PM
Originally posted by mw:
...Oh, thanks! Didn't know that!

jimmiwalker2
09-08-2004, 04:45 PM
Hi!

I hope I'm wrong, but I didn't find how to change render target. Could it be that it isn't part of OpenGL 2.0 spec? Hope not :(

MZ
09-08-2004, 04:55 PM
Could it be that it isn't part of OpenGL 2.0 spec? Hope notAbandon all hope.

idr
09-09-2004, 08:06 AM
There was quite a bit of debat about the separate stencil issue. The API that is in OpenGL 2.0 does not exactly match ATI_separate_stencil (http://oss.sgi.com/projects/ogl-sample/registry/ATI/separate_stencil.txt) or EXT_stencil_two_side (http://oss.sgi.com/projects/ogl-sample/registry/EXT/stencil_two_side.txt) . Basically, the API in OpenGL 2.0 adds functions to set the new state, like the ATI extension, but allows all state to be separately specified, like the EXT extension.

If you're on pre-2.0, use whichever extension is available. AFAIK, there won't be an ARB version of the extension. That shouldn't matter because all of the existing cards that support either of the existing extension can support 2.0. :) My personal opinion is that new code wanting to use two-sided stencil should just use the 2.0 API.

KRONOS
09-09-2004, 10:11 AM
Originally posted by idr:
My personal opinion is that new code wanting to use two-sided stencil should just use the 2.0 API.And where is this "2.0 API"?

idr
09-09-2004, 10:55 AM
Page 202 (page 216 of the PDF) of the OpenGL 2.0 spec (http://www.opengl.org/documentation/specs/version2.0/glspec20.pdf) .

V-man
09-09-2004, 05:55 PM
Originally posted by idr:
There was quite a bit of debat about the separate stencil issue. The API that is in OpenGL 2.0 does not exactly match ATI_separate_stencil (http://oss.sgi.com/projects/ogl-sample/registry/ATI/separate_stencil.txt) or EXT_stencil_two_side (http://oss.sgi.com/projects/ogl-sample/registry/EXT/stencil_two_side.txt) . Basically, the API in OpenGL 2.0 adds functions to set the new state, like the ATI extension, but allows all state to be separately specified, like the EXT extension.
I didn't quite get it. I though that if you use glStencilOp, it sets up both faces.
If you use the separate version, you can select front or back.

Which would be good, cause it matches the blending behavior where you can specify how RGB and alpha can be treated. glBlendEquationSeparate I think it was called.

idr
09-10-2004, 08:31 AM
Originally posted by V-man:
I didn't quite get it. I though that if you use glStencilOp, it sets up both faces.
If you use the separate version, you can select front or back.

Which would be good, cause it matches the blending behavior where you can specify how RGB and alpha can be treated. glBlendEquationSeparate I think it was called.So, the ATI extension allowed separate state for everything except the stencil ref value and the mask value. The ATI extension was a little bit quirky in that one function takes a face selector value (like glMaterial), and the other function takes explicit front and back values (like glBlendFuncSeparate / glBlendEquationSeparate).

The EXT extension was fully orthogonal for all current and future stencil state. It did this by way of a single new function that selected which facing (front or back) was to be updated (like is done with multitexturing).

The debate was about whether it would be better to, basically, just move the EXT version into the core or do something different. The decision was to follow the model of glStencilOpSeparateATI and add a facing selector to StencilOp (calling the new function StencilOpSeparate) and StencilFunc (calling the new function StencilFuncSeparate). The new API looks more like the ATI extension but provides the orthogonality of the EXT extension. The pre-2.0 functions work exactly like calling the new functions with GL_FRONT_AND_BACK.

Looking at the Delphi3D entry (http://www.delphi3d.net/hardware/extsupport.php?extension=GL_EXT_stencil_two_side) , I suspect that all hardware that currently supports the EXT version will get OpenGL 2.0 support. Since the hardware doesn't seem to be fully front/back stencil orthogonal, I don't think the same can be said for the ATI version. If I were to write an app that had to support multiple flavors of two-sided stencil support, I would write wrapper functions that made the extensions look like the 2.0 API. For the ATI extension, it should probably print a warning if impossible state (i.e., front mask != back mask).

V-man
09-10-2004, 10:19 AM
Thanks that cleared it up. Is it certain that ATI cards can't do the GL2 version in hw?

idr
09-10-2004, 03:08 PM
It's not certain, but it seems reasonable that if the R300 family was fully orthogonal, then the ATI extension would have exposed everything the hardware could do. My guess is that the hardware can do exactly what the extension exposes. The newer hardware can probably do everything. Like I said, that's just my guess.