Hi Liu, as you already indicated in other posts - you have read my advice to other people in this situation And here I repeat it use Cedrik Pinson osgjs format ( exporter for osg converter is here https://github.com/cedricpinson/osg/tree/master/src/osgPlugins/osgjs ) it looks very suitable for OpenGL ES 2.0 models. To use it, though, you will need to write your own loader
Regards Sergey On Mon, Nov 10, 2014 at 1:23 PM, Liu Xiao <[email protected]> wrote: > Thanks ! That is really a simple and nice example for me, I will try it > and feedback when I get succeed. > > I think your solution is loading texture separatly , while my osg file is > binding with texture. I donot know how to convert fbx to osg format for > external texture file. > > However, the following shader works for my young.osg file here : > > > Code: > static const char gVertexShader1[] = > "varying vec2 v_texCoord; \n" > "void main() { > \n" > " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; > \n" > " v_texCoord = gl_MultiTexCoord0.xy; > \n" > "} > \n"; > > static const char gFragmentShader1[] = > "varying mediump vec2 v_texCoord; > \n" > "uniform sampler2D sam; > \n" > "void main() { > \n" > "gl_FragColor = texture2D(sam, v_texCoord); > \n" > "} > > >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

