www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Wojtek on May 08, 2010, 03:11:58 pm

Title: Hardware only mode optimizations hints
Post by: Wojtek on May 08, 2010, 03:11:58 pm
Hello,

I am wondering if there are any settings that can be applied to decrease memory usage and/or increase performance if application uses only hardware rendering mode.

For example there is a Config.maxPolysVisible setting that I had to set to a big value to be able to display my scenes. I have noticed (please correct me if I am wrong) that when I started using compiled objects, this setting could be set to a much lower value and still the scene is displayed correctly.

So my question is if there are any options that could be turned off (or adjusted) if the hardware mode is used:
a) with compiled objects
b) without compiled object
and no software mode compatibility is needed?

Thanks,
Wojtek
Title: Re: Hardware only mode optimizations hints
Post by: EgonOlsen on May 08, 2010, 10:41:00 pm
Yes, you can decrease the size of the vislist when using compiled objects only. In addition, you can try to call strip() on compiled objects. It has some drawbacks regarding the PolygonManager, but just give it a try. It won't help performance but it will free some memory.

If possible, share meshes. This helps for both, compiled and uncompiled objects. I.e. If you models are using the same geometry data, make sure they use the same mesh. If this is the case, objects that share the same mesh can share the same compiled data. This reduces memory usage in native and gpu memory. Have a look at Object.shareCompiledData(<Object3D>) for more information. This may also help performance wise.

And last but not least, you try if Object3D.getMesh().compress(); gives you some memory back.
Title: Re: Hardware only mode optimizations hints
Post by: Wojtek on May 10, 2010, 08:09:26 pm
Thanks for hints :)

From my side I can add also that it is possible to use tiled textures by multiplicating each UV point by some value (number of tiles that should be used). That way a small texture would be multiplicated and object would look better.

Thanks,
Wojtek