PDA

View Full Version : some questions about gl 3+



_arts_
01-05-2011, 02:50 AM
I'm not about to move to GL 3 now for some reasons.
But I'd like to know some things about GL 3 and later versions (all these questions taken from wiki: http://www.opengl.org/wiki/History_of_OpenGL#OpenGL_3.0_.282008.29).

1. Since GL 3+ deprecates display lists, bitmaps, how do glw/wgl font functions will be supported ? Will they ? If yes, how will they work ? If no, how could we deal with fonts in a quite good manner ?

2. Since, immediate mode, client vertex arrays are deprecated too, it seems the only way to render geometry is threw VBO. Am I wrong ?

3. It seems only triangles polygons could be drawn. Right ?

4. Depth textures seem deprecated too. So, it seems that the only way to do shadow mapping (for example) will be threw shaders ?

Thanks in advance.

aqnuep
01-05-2011, 03:05 AM
1. WGL font functions will work as expected only using a compatibility profile.

2. You are right, as that is the preferred method. Also they are the fastest* (*almost, as display lists are still very fast but they are more heavyweight for the driver).

3. Triangles, lines and points are supported (list or strip when applicable). Quads and polygons are not supported directly in hardware anyways.

4. Depth textures are not deprecated, only fixed function depth comparison is gone, but that is subsumed by shadow samplers and the appropriate texel fetching built-ins in GLSL.

_arts_
01-05-2011, 03:10 AM
Thanks for the reply.

1. That's what I was afraid of. So, how do you do to deal with it if you don't want any compatibility profile (since AFAIK GL 4 does not have any compatibility profile) ?

2. OK. So it means if we have to do a simple thing for testing, for example drawing a line or a quad, I must do a full VBO stuff, a bit heavy to my point of view.

3. OK

4. OK, I had misunderstood this point.

aqnuep
01-05-2011, 07:21 AM
1. GL4 supports compatibility profile as well. AFAIK it will be supported for a long long time. The easiest way is to just use the compatibility profile. If it is not an option then you must use some GL3+ compatible font library (if such exists).

2. That's right, and you have to create your shaders as well, otherwise it is not possible to draw anything. However, you have to do the VAO + VBO + basic shader config stuff only once. At first sight it seems a bit awkward that drawing a single line requires that much setup, however, the same setup is enough to display arbitrary complex static geometry.

Dark Photon
01-05-2011, 08:27 PM
aqnuep's got you covered, but just to clarify some things w.r.t GL3+ with the COMPATIBILITY profile.


1. Since GL 3+ deprecates display lists, bitmaps, how do glw/wgl font functions will be supported ? Will they ? If yes, how will they work ? If no, how could we deal with fonts in a quite good manner ?
Display lists and all the things you're used to are there if you just allocate a COMPATIBILITY profile.


2. Since, immediate mode, client vertex arrays are deprecated too, it seems the only way to render geometry is threw VBO. Am I wrong ?
Immediate mode and client vertex arrays are still there in COMPATIBILITY profiles as well, as you'd expect. It's only if you allocate a CORE profile on GL 3.1 or higher that you can't get to these anymore.

As to perf, immediate mode has always been sad. Display lists are typically fastest (on NVidia). With Client arrays and server arrays (aka VBOs) vying for 2nd and 3rd place -- VBOs faster for larger batches, client arrays for smaller batches. VBOs can be accelerated with VAOs or an NV extension (the latter getting them as fast as display lists).


3. It seems only triangles polygons could be drawn. Right ?
Nope. All the usual primitives are available.


4. Depth textures seem deprecated too. So, it seems that the only way to do shadow mapping (for example) will be threw shaders ?
Not with COMPATIBILITY profile. All's still there. Fixed function pipe or shader pipe -- your choice. And depth textures never went away, even for a CORE profile.

Think of COMPATIBILITY as CORE + legacy conveniences.

Ehsan Kamrani
01-05-2011, 11:02 PM
Display lists and all the things you're used to are there if you just allocate a COMPATIBILITY profile.

OK, What do you mean from "allocating" a COMPATIBILITY profile. As far as I know, if the implementation supports GL_ARB_compatibility extension, then we can use old functions.

Alfonse Reinheart
01-05-2011, 11:47 PM
OK, What do you mean from "allocating" a COMPATIBILITY profile. As far as I know, if the implementation supports GL_ARB_compatibility extension, then we can use old functions.

When you use wgl/glxCreateContextAttribsARB, you can ask for a Core or Compatibility profile. If you don't ask for one, and you ask for a GL version > 3.1, then you will get a core profile by default. You must ask for compatibility in order to get it with this function.

Of course, if you don't use wgl/glxCreateContextAttribsARB, and instead use the usual context creation function, then you automatically get the compatibility profile.

See the Create Context extension (http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt) for details.

_arts_
01-06-2011, 02:45 AM
Dark Photon, I understood. My questions interrests were about using core profile, since with compatibility profile remove nothing from previous versions. Thanks anyway for the precisions.