>
> I am able to render it but frame rate is slow. I'd like to improve
> performance using back face culling. The point is I don't know how to
> activate it (if it is possible):
> I tried with these lines of code but frame rate is still low:
> osg::StateSet* ss = _root->getOrCreateStateSet();
> osg::CullFace* cf = new osg::CullFace(osg::CullFace::BACK );
> ss->setAttribute( cf );
>
>
  That should do it.


> I am using OpenGL ES 2.0 and shaders.
>
> I setup the camera in this way:
>
> Code:
>
> //set the clear mask for the camera
>
> _viewer->getCamera()->setClearMask(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
>

  I've been told secondhand that on some
tiled-renderer mobile platforms, not clearing all buffers (including the
stencil buffer) can put you onto a slow path. I don't know if you need to
be USING stencil buffers in order for this to be relevant or not. Try it
and see.



> I hope you can give me some tips to improve performance. If you need some
> other information about my setup I will be glad to give it.
>

  Unfortunately, I don't think you can display the osgViewer Stats on an
GLES2 platform, but it would be very useful to be able to gather those
statistics and dump them out some other way, as this would tell you
something about your scene's performance. Though, it won't tell you if you
are fill limited or not. However, you could consider adding the discard
statement to the end of your shader(s) -- this will cut out one step of the
fill operation and might tell you if memory writes are the bottleneck.

  Similarly, you could replace your real shaders with trivial do-nothing
shaders and see if shader execution is your problem.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. [email protected]
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio •
LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to