Author Topic: Performance Issues  (Read 2370 times)

Offline Dinin

  • byte
  • *
  • Posts: 28
    • View Profile
Performance Issues
« on: April 11, 2012, 07:22:18 pm »
Hi !

I'm rendering objects with 450 faces and textures (64x64 pix).
The objects are serialized with reduced = true but without texture assigned because textures are set dynamical in runtime.
Now when amount of objects > 60 im running into performance problems (Galaxy SII).
So i looked with traceview and there i see that much cpu time goes to:
- com/threed/jpct/CompiledInstance.fill (25%)
        - com/threed/jpct/GenericContainer.add (31%)
        - java/nio/ShortToByteBufferAdapter.put (20%)

Do you have any idea what i can do to make this faster ?

thx and greets
Dinin

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Performance Issues
« Reply #1 on: April 11, 2012, 08:37:44 pm »
Are you sure that you haven't benchmarked the setup of your objects here?

com/threed/jpct/CompiledInstance.fill will be called only once for static object but multiple times for animated ones. If your objects are animated, this might explain it. The huge amount that com/threed/jpct/GenericContainer.add takes indicates that you either (as mentioned above) have benchmarked the actual setup code or that you are using animated objects that have been compiled using compile(true, false);, i.e. without static uv coordinates. Are you? If so, do you have to?

Offline Dinin

  • byte
  • *
  • Posts: 28
    • View Profile
Re: Performance Issues
« Reply #2 on: April 12, 2012, 01:01:40 am »
yes, this objects are animated.
how to i set static uv coordinates ?
And what is the diffenenz (sorry i'm a newbie in this sector)?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Performance Issues
« Reply #3 on: April 12, 2012, 06:54:24 am »
The difference is that with static uv-coordinates, you can't change how the texture will be applied on the mesh at runtime. However, you can still change the texture itself. I don't know what you are currently doing, but is assume that (as already posted) you are doing something like compile(true, false); somewhere!? If so, change it to compile(true, true);. If you don't use that line, you'll see me confused about your profiling...

Offline Dinin

  • byte
  • *
  • Posts: 28
    • View Profile
Re: Performance Issues
« Reply #4 on: April 13, 2012, 11:48:39 pm »
yes, compile (true,true) did it.
Now it run's much,much faster.

mthx for your help!