Author Topic: About scene lightmaps and scene optimisation.  (Read 3122 times)

Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
About scene lightmaps and scene optimisation.
« on: June 25, 2013, 11:03:37 am »
      I wanted to know, can I have 2 sets of uvs for a 3d model for multitexturing (one for normal texture other for lightmap). If this is not possible is there any other suggestion.
Also I wanted to know how much polygon count ,object count ,animation are too much for a 1ghz phone.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: About scene lightmaps and scene optimisation.
« Reply #1 on: June 25, 2013, 11:24:49 am »
Yes, you can do that. The only problem with it, that none of the 3d formats that are supported (3ds, obj, asc, md2...) support multiple texture layers. When i did this for example for Quake-levels, i splitted the model into two when exporting, so that one contains the normal texturing and one the lightmapping. I then loaded both and merged them into a new one like so: http://www.jpct.net/forum2/index.php/topic,1790.msg13191.html#msg13191.

About performance: It depends...a general rule is to favour polygon above object count, i.e. if you can combine single meshes into a larger one, it's worth to do so in most cases. Which device are we talking about? 1Ghz is bit vague.

Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
Re: About scene lightmaps and scene optimisation.
« Reply #2 on: June 25, 2013, 11:35:00 am »
   Wow, that means i can do lighmaps..that quake level looks awesome .
but do I have to  necessarily use desktop jpct for the serialisation?
I have jbrush which serialises level too ... can i use it somehow ?
and about the device 1ghz,512 mb/1gb ram ,adreno205 +  gpus

Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
Re: About scene lightmaps and scene optimisation.
« Reply #3 on: June 25, 2013, 05:09:14 pm »
  I downloaded jpct pc , set it up , serialised the 2 merged objects. Now how to use that in android jpct.


Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
Re: About scene lightmaps and scene optimisation.
« Reply #5 on: June 26, 2013, 02:44:12 pm »
  I made it ! But There is a Problem . I am getting only 16 fps with the shadowed model . Without that I get 35 to 40 fps. I don't know why the fps has fallen so drastically.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: About scene lightmaps and scene optimisation.
« Reply #6 on: June 26, 2013, 09:44:00 pm »
That might be caused by an increased number of draw calls. The engine batches geometry based on textures to minimize draw calls. If you apply a second layer, you might reduce the possible size of these batches (example: A mesh with 10 textures can be rendered in 10 draw calls, a mesh with 10 textures and 10 lightmaps on top might have to be splitted to 10*10=100 drawcalls). This isn't an issue if your lightmap is baked into one texture (which is the normal case). If that applies to you, it might be caused by the fact that the Adreno 205 stinks. Which OpenGL mode are you using?

Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
Re: About scene lightmaps and scene optimisation.
« Reply #7 on: June 27, 2013, 05:45:27 am »
      Oh ! I have not tried it on adreno 205 yet . I   installed it on my older device (600 mhz,512mb ram,adreno 200) thinking that if it runs in slower one, then bigger end is not a big deal.
I m using opengl es 2.0. Do you have any suggestions/fixes ? My scene really looks nice with shadows.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: About scene lightmaps and scene optimisation.
« Reply #8 on: June 27, 2013, 07:53:38 am »
Depends on how your lightmaps are structured. Is it one large texture or a bunch of single ones? Apart from that, Adreno 200 with a 600Mhz cpu is really extreme low end. I wouldn't wonder if using multitexturing will bring it to its knees especially when using OpenGL 2.0.

Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
Re: About scene lightmaps and scene optimisation.
« Reply #9 on: June 27, 2013, 08:54:55 am »
   They are small individual textures. I tried it on my 1ghz phone adreno 205. and it runs nice  :D ! But still it gets  little choppy for very short time when I start my app at first . But  I am still satisfied with that!
Still if any solution to optimise it will be great.
Thank You Egon !

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: About scene lightmaps and scene optimisation.
« Reply #10 on: June 27, 2013, 09:39:34 am »
   They are small individual textures.
As mentioned, this will greatly increase the number of draw calls. If possible, combine the lightmap textures into one (or several) larger ones like quake does it.

Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
Re: About scene lightmaps and scene optimisation.
« Reply #11 on: June 29, 2013, 04:19:03 pm »
   One More question . It is easy to rename an .apk file as .zip  and access the assets and resource contents. Is there a way to hide them?

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: About scene lightmaps and scene optimisation.
« Reply #12 on: June 29, 2013, 05:40:59 pm »
It is not possible, you can only make it more difficult (random names, encrypted files,...). If you send me APK file I can send you java sources. This is big issue, because developer can not do anything with warez...

Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
Re: About scene lightmaps and scene optimisation.
« Reply #13 on: June 29, 2013, 06:52:17 pm »
It is not possible, you can only make it more difficult (random names, encrypted files,...).
   Oh! I See! By the way , which java sources ?
Thanks for help!
 

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: About scene lightmaps and scene optimisation.
« Reply #14 on: June 29, 2013, 08:42:52 pm »
You can get java sources of any application. It is good to know when you want to sell your app.