Thanks so much for your quick reply , it really helps. Also this post gives me a good example of shader: http://forum.openscenegraph.org/viewtopic.php?t=6482
But still I have problem on drawing the texture. Sergey Kurdakov wrote: > Hi Liu, > > > use setUseVertexAttributeAliasing as Robert recently explained for similar > question > > === > The aliasing of gl_* uniforms to osg_* equivialants is not done by default. > You can switch it one yourself if required though via osg::State, from the > osgsimplegl3 example: > > // for non GL3/GL4 and non GLES2 platforms we need enable the osg_ > uniforms that the shaders will use, > // you don't need thse two lines on GL3/GL4 and GLES2 specific builds as > these will be enable by default. > gc->getState()->setUseModelViewAndProjectionUniforms(true); > gc->getState()->setUseVertexAttributeAliasing(true); > > > In your own shaders if you are building against GL1/2 (default build of OSG) > then you can simply use the gl_* parameters. > > Also have a look at the shaders in OpenSceneGraph-Data and the osgshaders > example. > === > > > > > Regards > Sergey > > On Fri, Nov 7, 2014 at 12:14 PM, Liu Xiao < ()> wrote: > > > Hi, > > > > When I trying to use the osg 3.2.1 (with OSG_GLES2_AVAILABLE:BOOL=ON ) > > example_osgViewerIPhone, I got the following errors: > > > > > > Code: > > VERTEX glCompileShader "" FAILED > > VERTEX Shader "" infolog: > > ERROR: 0:6: Use of undeclared identifier 'gl_Vertex' > > ERROR: 0:7: Use of undeclared identifier 'gl_FrontColor' > > > > FRAGMENT glCompileShader "" FAILED > > FRAGMENT Shader "" infolog: > > ERROR: 0:4: 'vec4' : declaration must include a precision qualifier for type > > ERROR: 0:5: Use of undeclared identifier 'base' > > ERROR: 0:6: Use of undeclared identifier 'color' > > ERROR: 0:6: Use of undeclared identifier 'gl_Color' > > ERROR: 0:7: Use of undeclared identifier 'color' > > > > glLinkProgram "" FAILED > > Program "" infolog: > > ERROR: One or more attached shaders not successfully compiled > > > > > > > > My Config file is as follows: > > > > > > Code: > > #ifndef OSG_CONFIG > > #define OSG_CONFIG 1 > > > > /* #undef OSG_NOTIFY_DISABLED */ > > /* #undef OSG_USE_FLOAT_MATRIX */ > > /* #undef OSG_USE_FLOAT_PLANE */ > > #define OSG_USE_FLOAT_BOUNDINGSPHERE > > #define OSG_USE_FLOAT_BOUNDINGBOX > > #define OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION > > /* #undef OSG_USE_UTF8_FILENAME */ > > #define OSG_DISABLE_MSVC_WARNINGS > > > > /* #undef OSG_GL1_AVAILABLE */ > > /* #undef OSG_GL2_AVAILABLE */ > > /* #undef OSG_GL3_AVAILABLE */ > > /* #undef OSG_GLES1_AVAILABLE */ > > #define OSG_GLES2_AVAILABLE > > /* #undef OSG_GL_LIBRARY_STATIC */ > > /* #undef OSG_GL_DISPLAYLISTS_AVAILABLE */ > > /* #undef OSG_GL_MATRICES_AVAILABLE */ > > /* #undef OSG_GL_VERTEX_FUNCS_AVAILABLE */ > > /* #undef OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE */ > > /* #undef OSG_GL_FIXED_FUNCTION_AVAILABLE */ > > > > #endif > > > > > > > > > > Can anyone help with this? Or is there any examples of osg ios can I learn? > > > > Thank you! > > > > Cheers, > > Liu > > > > ------------------ > > Read this topic online here: > > http://forum.openscenegraph.org/viewtopic.php?p=61538#61538 > > (http://forum.openscenegraph.org/viewtopic.php?p=61538#61538) > > > > > > > > > > > > _______________________________________________ > > osg-users mailing list > > () > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) > > > > > ------------------ > Post generated by Mail2Forum ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61545#61545 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

