[osg-users] Clarification on CACHE_IMAGES and use of SharedStateManager

Swanger, Glen T. Glen.Swanger at jhuapl.edu
Wed Mar 1 08:02:59 PST 2017


Some Context,
I have several model files that use the same textures (e.g. electronics cabinets with very similar parts, but different layout and composition).  I need to keep the models in separate files based on the mode our application is configured to run (e.g. load a single station model file, or load all station model files into a play area).  In the play area mode I want to share textures between the model files to reduce CPU and GPU memory load.  Although there are a fair number of parts in our model we aren't draw call bound at this point, so I want to make sure I understand the process of setting up the osgDB Registry to create these shared texture resources.

I'd appreciate confirmation, corrections, or alternatives to the following steps:

1.       Make sure model files are setup to use external file references for texture images.

2.       Set the CacheHintOptions on the Registry to CACHE_IMAGES.

3.       Set ShareMode on the Registry SharedStateManager to SHARE_TEXTURES.

4.       Load model files that share texture image files.

Also, I know I can set the ShareMode to SHARE_STATE too, but the user needs to interact with a lot of the parts independently and the parts operational states are controlled by StateSet shader uniforms to control rendered result.  I'm going to add an application option to turn this on and off because I'm not sure how it will affect the end rendered results?

If anyone has any other suggestions for minimizing CPU and GPU memory load in the context described above, I'd greatly appreciate it.
Thanks,
Glen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170301/a194845e/attachment-0002.htm>


More information about the osg-users mailing list