[osg-users] Tips for low-end GPUs? → check sphere count!

Cyril Brulebois cyril.brulebois at kerlabs.com
Wed Nov 4 08:15:28 PST 2009

Hi Alberto,

Alberto Luaces <aluaces at udc.es> (04/11/2009):
> I think you are already on the right track. From your description,
> your program bottleneck seems to lie on the card fill rate and/or
> texture handling. Tips for diminishing that work would be:

Thanks. Here's my findings after some testing:

> - As you mentioned, lowering the resolution of the rendering window
>   as much as you can.

Quite surprisingly, that didn't help. Even moving from 1280x1024 to
400x300 (be it fullscreen or not).

> - Lowering the resolution of the textures you are employing or
>   inspecting if you can go faster through the use of mipmapping. The
>   results will vary with the amount of available GPU RAM you have.

I'm actually using no texture at all but only setColor().

> - Try to disable as many blending effects you can.

There weren't that many such effects, only a HUD with a few lines of
text, no big deal, and only some containers (mostly: 1 box contains
various spheres, and that containing box is transparent). So it didn't
help either.

> - Use LODs mainly for that purpose, in order to deactivate blending
>   effects on farther objects where they can't be seen so well.

I didn't try that: there are no far objects (not much further than the
ones on the foreground), and since disabling blending totally didn't
help, I didn't bother.

> - Set the cheapest texture filters that you can cope with, NEAREST
>   ones are the fastest.

I think I've covered that above.

> - Disable any anti-aliasing or oversampling.

I tried that, didn't help either (if we're talking about features
accessible through the DisplaySettings instance).

Anyway, disabling object after object, I finally found the culprit:
the default level of detail for spheres was making the GPU feel
completely overwhelmed. I've therefore switched some objects from
Sphere to Box shapes, and used Tessellation Hints to lower the level
of detail on the remaining items. I've now moved from ~ 5 FPS to 60.

For reference, should someone find this thread later, here's how to
use it:
,--[ TessellationHints are our friends ]--
| // Set lower amount of detail:
| ref_ptr<TessellationHints> hints_low = new TessellationHints;
| hints_low->setDetailRatio(0.15f);
| // Create a regular Sphere:
| ref_ptr<Sphere> obj = new Sphere(Vec3(0, 0, 0), 1.0);
| // Use the TessellationHints object when creating the ShapeDrawable object:
| ref_ptr<ShapeDrawable obj_drawable
|   = new ShapeDrawable(obj.get(), hints_low.get());

Thanks again Alberto for confirming my initial thoughts.

Cyril Brulebois
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20091104/e8723d39/attachment.pgp>

More information about the osg-users mailing list