hybr wrote: > In gles 2.0 shaders dont have builtins like gl_MultiTexCoord gl_Color > gl_FrontColor\gl_BackColor gl_TexCoord gl_FragColor etc, and ftransform too. > Check gles 2.0 spec. > Use your own varyings and attributes, use your own output from fragment > shader(and dont forget to bind stuff in osg::Program). > > Cheers. > > 07.08.2012, 19:20, "John Moore" <>: > > > In this way it's using another shader that I did not write by myself and > > this shader is giving errors. > > > > Code: > > > > State::convertShaderSourceToOsgBuiltIns() > > ++Before Converted source > > > > void main() > > { > > gl_Position = ftransform(); > > gl_TexCoord[0] = gl_MultiTexCoord0; > > gl_FrontColor = gl_Color; > > } > > > > ++++++++ > > -------- Converted source > > uniform mat4 osg_ModelViewProjectionMatrix; > > attribute vec4 osg_MultiTexCoord0; > > attribute vec4 osg_Color; > > attribute vec4 osg_Vertex; > > > > void main() > > { > > gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex; > > gl_TexCoord[0] = osg_MultiTexCoord0; > > gl_FrontColor = osg_Color; > > } > > > > ---------------- > > > > Compiling VERTEX source: > > 1: uniform mat4 osg_ModelViewProjectionMatrix; > > 2: attribute vec4 osg_MultiTexCoord0; > > 3: attribute vec4 osg_Color; > > 4: attribute vec4 osg_Vertex; > > 5: > > 6: void main() > > 7: { > > 8: gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex; > > 9: gl_TexCoord[0] = osg_MultiTexCoord0; > > 10: gl_FrontColor = osg_Color; > > 11: } > > > > VERTEX glCompileShader "" FAILED > > VERTEX Shader "" infolog: > > ERROR: 0:9: Use of undeclared identifier 'gl_TexCoord' > > ERROR: 0:10: Use of undeclared identifier 'gl_FrontColor' > > > > Compiling FRAGMENT source: > > 1: uniform sampler2D diffuseMap; > > 2: > > 3: void main() > > 4: { > > 5: vec4 base = texture2D(diffuseMap, gl_TexCoord[0].st); > > 6: vec4 color = base; > > 7: color *= gl_Color; > > 8: gl_FragColor = color; > > 9: } > > > > FRAGMENT glCompileShader "" FAILED > > FRAGMENT Shader "" infolog: > > ERROR: 0:5: Use of undeclared identifier 'gl_TexCoord' > > ERROR: 0:6: Use of undeclared identifier 'base' > > ERROR: 0:7: Use of undeclared identifier 'color' > > ERROR: 0:7: Use of undeclared identifier 'gl_Color' > > ERROR: 0:8: Use of undeclared identifier 'color' > > > > Linking osg::Program "" id=9 contextID=1 > > State's vertex attrib binding 2, osg_Color > > State's vertex attrib binding 7, osg_FogCoord > > State's vertex attrib binding 3, osg_MultiTexCoord0 > > State's vertex attrib binding 4, osg_MultiTexCoord1 > > State's vertex attrib binding 5, osg_MultiTexCoord2 > > State's vertex attrib binding 6, osg_MultiTexCoord3 > > State's vertex attrib binding 7, osg_MultiTexCoord4 > > State's vertex attrib binding 1, osg_Normal > > State's vertex attrib binding 6, osg_SecondaryColor > > State's vertex attrib binding 0, osg_Vertex > > glLinkProgram "" FAILED > > Program "" infolog: > > ERROR: One or more attached shaders not successfully compiled > > > > I think this is something built in in open scene graph. > > Ho can I use only my shader? > > > > Cheers, > > John > > > > ------------------ > > Read this topic online here: > > http://forum.openscenegraph.org/viewtopic.php?p=49193#49193 > > > > _______________________________________________ > > osg-users mailing list > > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > _______________________________________________ > osg-users mailing list > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > ------------------ > Post generated by Mail2Forum
This is not completely true because I wrote some simple shaders for texture mapping (without bump mapping) and they are working. I don't know precisely how it works but it seems openscenegraph is able to map these variables such as gl_ModelViewProjectionMatrix, gl_Vertex, gl_Normal, gl_MultiTexCoord0 to openscenegraph built in variables like osg_ModelViewProjectionMatrix, osg_Vertex, osg_Normal, osg_MultiTexCoord0. ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49197#49197 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org