Hi,
I'm trying to develop apps for iOS using GLES 2, so far I managed to build OSG 
3.2.1 to use GLES 2 and as long as I create some geometry and manually 
load/apply GLES 2 shaders everything is fine. On the other hand I am 
experiencing some issues when I try to load models from files (not containing 
any shader definition - OBJ, FBX and some OSG/OSGT).

I know that when I use such kind of models then I should provide GLES 2 shaders 
in order to display them and, to my understanding, there are 3 possibilities:

1) manually apply shaders to the loaded model

2) use ShaderGenVisitor that generates shaders automatically

3) use Shader Composition

I tried using ShaderGenVisitor, but it looks like that the shaders that are 
generated are not GLES 2 compliant (because of missing pre-built attributes), 
and even though attribute aliasing is applied, not every "gl_" attribute is 
translated to the corresponding "osg_" version. For instance in the converted 
version I have a row like this:

  gl_Position = osg_ModelViewProjectionMatrix * gl_Vertex;

Note that only "gl_ModelViewProjectionMatrix" has been converted but for some 
reason "gl_Vertex" has not changed.

Also, there are attributes that are not translated at all, like gl_TexCoord and 
gl_LightSource.

Searching the forum, it looks like that the ShaderGen approach should be 
replaced by Shader Composition, so I wanted to try it but I'd need some 
directions to start with it...so far I only managed to enable it like this:

  state->SetShaderCompositionEnabled(true);

Where state comes from the viewer's window. But no model is displayed by the 
viewer.

Actually I am not sure at all that I should use Shader Composition, so my 
question is: if in my GLES 2 app I want to display models loaded from files 
(not containing any shader definition), what should I use and where should I 
look at to get started?

Thanks.
Alessandro

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





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

Reply via email to