[osg-users] osg_MultiTexCoord0 on OpenGL 2 vs GLES2

Pierre-Jean Petitprez pierre-jean.petitprez at inria.fr
Wed Feb 10 01:07:08 PST 2016


Hi,

I am working on an application that has to work both on regular Ubuntu environment and on Android. So I have written a couple of shaders in order to comply with GLES2 specs.
The problem is, with regular OpenGL profile on Ubuntu, the same shader is not working properly: the osg_MultiTexCoord0 seems to not be working, while gl_MultiTexCoord0 works (but obviously noton GLES2 of course).

Here is my vertex shader:

Code:

attribute vec4 osg_Vertex;
uniform mat4 osg_ModelViewProjectionMatrix;
attribute vec4 osg_MultiTexCoord0;
varying vec4 texCoord;

void main(void) {
gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
texCoord = osg_MultiTexCoord0;
}




The fragment shader is just applying the texture thanks to the texCoord variable.

So on GLES2 this vertex shader works properly, but on OpenGL 2  I have to replace osg_MultiTexCoord0 by the old gl_MultiTexCoord0 in order to make it work.

I have tried with OSG 3.2 (as apt packages on Ubuntu), 3.4 and 3.5 as sources, and I always get the same results.
I have applied setUseModelViewAndProjectionUniforms(true) on my graphics context state to enable osg_* matrices.  Is there a possibility to also enable other osg_* variables ?

Thank you!

Cheers,
Pierre-Jean

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








More information about the osg-users mailing list