Hi Robert,

In my opinion, ShaderComposition and "backward compatibility" uniforms are 
different features and need to be separate in the code.

If you think that's an interesting step before going further, I'll try to make 
a submission next week with these changes :

In osg::State :


1/ Separate vertex attibute aliasing and automatic search'n'replace gl_*** in 
shader code :

void setUseVertexAttributeAliasing(bool flag)  => stay the same
bool getUseVertexAttributeAliasing() const      => stay the same

void setConvertShaderSourceForVertexAttributeAliasing(bool flag)  => enable / 
disable the shader source code auto conversion, enabled by default
bool getConvertShaderSourceForVertexAttributeAliasing() const      


2/ Provide individual activation for uniforms :

void setUseModelViewAndProjectionUniforms(bool flag)  => remove
bool getUseModelViewAndProjectionUniforms() const      => remove

void setUseUniformsFlags(int flags)  => activate the management of some uniforms
int getUseUniformsFlags() const  

With flags defined at least for :

ModelViewMatrix => osg_ModelViewMatrix
ProjectionMatrix => osg_ProjectionMatrix
ModelViewProjectionMatrix => osg_ModelViewProjectionMatrix
NormalMatrix => osg_NormalMatrix
maybe some more usefull matrix in some situations : (not sure, I used to need 
these values, but for very tricky GLSL code)

ModelMatrix => osg_ModelMatrix
ModelInverseMatrix => osg_ModelInverseMatrix
ViewMatrix => osg_ViewMatrix
ViewInverseMatrix => osg_ViewInverseMatrix
ModelViewInverseMatrix => osg_ModelViewInverseMatrix
ProjectionInverseMatrix => osg_ProjectionInverseMatrix
ModelViewProjectionInverseMatrix => osg_ModelViewProjectionInverseMatrix
NormalInverseMatrix => osg_NormalInverseMatrix

And the real new feature :

FrontMaterial => osg_FrontMaterial
BackMaterial => osg_BackMaterial
Lights => osg_Lights
All other deprecated data (not deprecated features, this should be supported by 
shader composition)


For now, I really need only FrontMaterial and BackMaterial, so I'll start with 
these ones, but if the idea is good we could extend it easily.

As you said before, the management of these uniforms should be activated on the 
osg::State class, but the management of the value should be the responsability 
of osg::Material, osg::Light... using local unifoms


Let me know your opinion on this.

Thank you!

Cheers,
Aurelien

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=52513#52513





_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to