Hi J-S -- ShaderGen could have avoided the use of deprecated built-in
uniforms and deprecated predefined vertex attributes by using custom
uniforms and generic vertex attributes. These features are already
available in GL2, so testing would not have been an issue, had the
author chosen to write ShaderGen in such a manner. As it currently
stands, ShaderGen just looks like new GL2-dependent code. :-( As a
community, I'd like to see us all stop contributing new GL2-based code
(I realize I have no control over this), and have all new contributions
be as GL3-safe as possible.
As I'm currently investigating OSG on OpenGL 3 for a client, I was
curious to know: Was ShaderGen a work in progress? Was further work
planned on ShaderGen to take us closer to GL3? If so, who's doing it
and when can we expect fixes/updates? As a GL3 solution, why is so much
of it incomplete? Etc. This will help me gauge and estimate the amount
of work I'll need to do for my client. Thanks.
Jean-Sébastien Guay wrote:
Hi
Paul,
Hi all -- I've finally had a chance to review
the ShaderGen code. If I understand correctly, this was added as a step
towards eventual support for OpenGL 3. However, I'm surprised by the
OpenGL 2 / GLSL 1.20 nature of the shader code, specifically the
extensive dependency on built-in uniforms and predefined vertex
attributes that were deprecated with OpenGL 3 / GLSL 1.30 -- even use
of ftransform().
Was the author assuming the code would be ported to OpenGL 3 / GLSL
1.30 in the future? Or was the author assuming that the host would set
up uniforms and vertex attributes with names identical to the old GLSL
1.20 uniform and vertex attribute names (that would be a mistake in my
opinion, as uniforms and vertex attributes starting with "gl_" are
reserved)? Or have a simply misunderstood the point of this code?
Well, I wonder, if the author had used OpenGL 3 functionality, how
would he have tested the code? OSG currently has no way to create an
OpenGL 3.x context...
It's pretty simple to change uniform names and switch from using
ftransform() to using vertex * modelViewProjection... ShaderGen was
more a proof of concept of generating shaders from the accumulated
state. I think this, along with the VirtualProgram example that Wojtek
did, are good steps toward a possible solution for OpenGL 3 support.
J-S
|
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org