www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Wolf17 on June 25, 2013, 11:03:37 am

Title: About scene lightmaps and scene optimisation.
Post by: Wolf17 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.
Title: Re: About scene lightmaps and scene optimisation.
Post by: EgonOlsen 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 (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.
Title: Re: About scene lightmaps and scene optimisation.
Post by: Wolf17 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
Title: Re: About scene lightmaps and scene optimisation.
Post by: Wolf17 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.
Title: Re: About scene lightmaps and scene optimisation.
Post by: EgonOlsen on June 25, 2013, 08:53:30 pm
Just load them via the Loader class (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Loader.html#loadSerializedObject(java.io.InputStream) (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Loader.html#loadSerializedObject(java.io.InputStream)) or http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Loader.html#loadSerializedObjectArray(java.io.InputStream) (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Loader.html#loadSerializedObjectArray(java.io.InputStream))).
Title: Re: About scene lightmaps and scene optimisation.
Post by: Wolf17 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.
Title: Re: About scene lightmaps and scene optimisation.
Post by: EgonOlsen 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?
Title: Re: About scene lightmaps and scene optimisation.
Post by: Wolf17 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.
Title: Re: About scene lightmaps and scene optimisation.
Post by: EgonOlsen 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.
Title: Re: About scene lightmaps and scene optimisation.
Post by: Wolf17 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 !
Title: Re: About scene lightmaps and scene optimisation.
Post by: EgonOlsen 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.
Title: Re: About scene lightmaps and scene optimisation.
Post by: Wolf17 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?
Title: Re: About scene lightmaps and scene optimisation.
Post by: Thomas. 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...
Title: Re: About scene lightmaps and scene optimisation.
Post by: Wolf17 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!
 
Title: Re: About scene lightmaps and scene optimisation.
Post by: Thomas. 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.
Title: Re: About scene lightmaps and scene optimisation.
Post by: Wolf17 on June 29, 2013, 09:03:31 pm
  HMmmm! That is really bad. Can't we use an obfuscator or something ? (Do they exist?)
Title: Re: About scene lightmaps and scene optimisation.
Post by: Thomas. on June 30, 2013, 11:29:21 am
Yes of course, this is way how to do it more difficult.
Title: Re: About scene lightmaps and scene optimisation.
Post by: EgonOlsen on June 30, 2013, 12:40:43 pm
I wouldn't worry too much about all this. If you are going to seel something, 99.9999% of the market won't bother with such things.
Title: Re: About scene lightmaps and scene optimisation.
Post by: Irony on July 01, 2013, 01:06:08 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?
If you serialize your models, one can only use them with JPCT, but not edit them with Blender or 3d-Studio or utilize them in any other engine. If you use assets from e.g. Turbosquid, you are even required to do something like that.
Title: Re: About scene lightmaps and scene optimisation.
Post by: Wolf17 on July 02, 2013, 04:57:27 pm
  Thank you all for replies ! That Helps !