Search Unity

Terrain 4 Mobile System

Discussion in 'iOS and tvOS' started by SJAM, Mar 28, 2011.

  1. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    Sorry for my mistake :)
     
    Last edited: Apr 9, 2011
  2. TriplePAF

    TriplePAF

    Joined:
    Aug 19, 2009
    Posts:
    246
    Azert2k,

    Why are all diffuse shaders changed in my project to vertix lit? That vertix lit shader has problems with the linear fog in my scene. It can't smooth out the start and end distance. Is there more that get automatically changed and can't set back in a project?

    Please help,

    Peter.
     
  3. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    ??
    hum... others objects that T4M terrain ? it's impossible ...

    My system affect only the terrain, not others objects.

    Explain more because like that, I don't understand
     
  4. Curious

    Curious

    Joined:
    Nov 19, 2009
    Posts:
    334
    Is it on the Asset Store yet?
     
  5. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    this week, when I finish the update.

    For the best performance you can't use the HD resolution of iPhone 4. I will make a table of performance to explain that.
     
  6. TriplePAF

    TriplePAF

    Joined:
    Aug 19, 2009
    Posts:
    246
    I just import your Unity package into my project and every object that is using the default Unity diffuse shader got changed to the Vertix lit shader.


    Peter.
     
  7. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    No one have this problem,it's very weird...

    I suggest you to download again the package to try.

    or test on other project, because my package contain just 3 shaders with differents names of default shaders... I dont understand this troubles...?!
     
  8. sabrexx

    sabrexx

    Joined:
    Feb 2, 2011
    Posts:
    25
    if the performance is poor at iPhone 4 resolution what about full resolution on an ipad1?
     
  9. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    @sabrexx
    I don't know Sabrexx, I don't have iPad yet... but if the 3D chipset is the same of iPhone 4, the performance will be poor.


    I will Make a Table of Performance, with unity shader comparaison. You will know after the performance that can give T4M on all devices



    Update 1.1

    - Fix Brush Bug
    - Optimize Performance of menu
    - Fix « _MainTex » error with the Lightmap
    - Add Tree Distance Manager + Cam script
    - Scene with Distance Manager + Lightmap Demo
    - Add 3D Anaglyph Shader for T4M
    - Fix Conversion problem
    - AssetStore Submission
     
    Last edited: Apr 17, 2011
  10. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    iPad1 has the same GPU as the iPhone4 / iTouch4 which has the same as the 3GS devices.
    As such: if the performance is a problem on iPhone4, it will be a 2X% larger problem on iPad potentially given the problem is fillrate.

    But if fillrate is the case then you should optimize your materials to not use blending and transparency that much and it should no longer be a prob
     
  11. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    Table Of Performances HIGH SETUP :

    HERE


    Tutorial :

    HERE

    Now, with the comparison between the default shaders and T4M shaders, you can get an idea, for the final performance on your target devices.
     
    Last edited: Apr 17, 2011
  12. sabrexx

    sabrexx

    Joined:
    Feb 2, 2011
    Posts:
    25
    Does performance improve much at hd resolutions with anti-aliasing off?
     
  13. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Depends.
    AA is heavily fillrate bound and impacts the fillrate budget, so if your game was fillrate limited before and you enable AA, the performance can at worst drop by 60%++ just due to it (cause fillrate is an absolute limit, you can only render this fixed number of pixels per frame. So your FPS max in the end is fillrate / pixels per frame, if you overdo it with the pixels per frame, your FPS will drop correspondingly)

    One thing that also must not be forgotten is that pixel lights, which you just need to have if you want bumpmap, hit the fillrate too (how badly depends on the range and what layers they impact). As such you should never have more than 1 pixel light (optimally none if you don't need it) if you run on iPhone4 / iPad1 on HD resolution.

    going with HD + AA + Pixel Light is pretty surely not going to work out with any halfway normal environment at all prior the iPad2.

    I would only use AA if my game ran on solid 60FPS before or if I don't let it run at HD but only on SD resolution to make up for the missing real rendered pixels as SD + AA is faster than HD if you are using something fillrate heavier thing (lots of blending / transparency based stuff or pixel lights) simply because they only affect 1/4 the number of pixels on SD they do on HD
     
    Last edited: Apr 17, 2011
  14. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    I just report a bug on Unity editor, if you use directly PVR textures with aniso level other than 1 (increase this value for sharpen close texture),

    Before build or save the scene, this value return to 1.

    The final result is a blur on close texture.

    For my demo scene , you must replace the PVR textures by default textures, and increase the aniso level if you want a best result.
     
  15. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    I have made a little tweaking on T4M shaders.

    For moment, the 4 textures shader performance is increased (in the same conditions of the table of performance + lightmap), this shader has obtained 59.72 fps constant (SD resolution VersuS 33.85 before) and 25,19 constant (HD reolution VersuS 11,62 before)

    But without Lightmap, I obtained 44,22 fps in SD resolution (I didn't try on HD mode)

    For T4M bump shader, I obtained 35.2 fps in SD mode versus 28.16 before.

    I will continue to tweak my shader, and when I finished, I will made an update.

    Screenshot iPhone 4 SD (4 textures 512 + lightmap):




    Screenshot iPhone 4 HD (4 textures 512 + lightmap):

     
    Last edited: Apr 18, 2011
  16. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    What do you get with "normal sized" textures?

    Normal for such tiling textures for screen resolutions as on the iOS devices is 128 square or 256 square, you only rarely exceed that (cause cause if you exceed a tiling value of 2, they are rendered at less than their size pixelwise on screen even when being orthogonal to the cam view direction and with mipmap bias the detail doesn't give you much in the depth either)

    Also are these stats with a directional light set to unimportant (-> vertex) or one set to auto / important in which case it is a pixel light (for the non-bump case naturally)


    Will test it on android on thursday and look if I can find anything in the shader to push it a bit potentially as I'm pretty sure that these numbers are kind of fishy if that terrain is all you have, even the mesh it uses were a 40k+ mesh
     
  17. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    I didn't try this scene with 128x128 or 256x256 textures yet. I want having a high setup scene to optimize.

    The scene have 1 directional light (auto mode), the terrain 13.2k vertex.

    Any help will be welcome to optimize, thank you
     
    Last edited: Apr 18, 2011
  18. sabrexx

    sabrexx

    Joined:
    Feb 2, 2011
    Posts:
    25
    Hi there,
    I just bought T4M and was wondering if there will be a shader for only 2 diffuse textures. I only require 2 textures and it would be a nice speed boost to have a shader that only takes 2 layers.
     
  19. Curious

    Curious

    Joined:
    Nov 19, 2009
    Posts:
    334
    @Azert2k,
    Have you submitted this to the asset store yet?
     
  20. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    hello,

    ok, I will make a 2 textures shader for future update. while waiting use the 3 textures shader and use only the 2 first texture. After the update you will just change the shader ;-)

    @Curious

    yes, waiting for review.
     
    Last edited: Apr 21, 2011
  21. Curious

    Curious

    Joined:
    Nov 19, 2009
    Posts:
    334
    Great, thanks ;)
     
  22. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    The new version 1.2 coming soon (monday):

    - 4 Types of shaders : 2,3,4, and 3+3bump textures with 3 speed levels (fastest, fast and simple). All of them are more fast that previous shaders.
    - Undo/Redo implementation for painting and planting
    - Fake Shadow System for dynamic objects
    - more stable
    - And more
     
  23. sabrexx

    sabrexx

    Joined:
    Feb 2, 2011
    Posts:
    25
    Sounds great! Since I bought T4m outside of the asset store, will I be able to get it from the asset store somehow after it gets approved?
     
  24. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    Version 1.2 is out !!
     
  25. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    since now you have a 2 textures option, does it work with iphone 2g? in theory it should...
     
  26. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    @creat326

    Still not, because the shaders are always in shader model 2.

    I will look if I can find an solution, for future update.
     
  27. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    Terrain4mobile now on the Assetstore !
     
  28. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    it should be possible to port it for iphone 2g. I've seen games using custom terrain systems on a 2g platform and running pretty fast. If you managed to use 2 textures, porting it to an older shader system should be easy :)
     
  29. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    There is no older shader system.

    There is shader and no shader and pre 3GS has no shaders.
    All the have are combiners (pure shaderlab stuff, no shader code).

    none the less you could set it up for it, someone somewhere provided one.
    But you can no longer paint it etc
    its direct use with this system is very questionable as already the terrain mesh hits hard enough to not leave much spare resources left at all. (keep in mind that pre 3GS the budgets were extremely tight with less than 15k tris and 20 drawcalls and less. with a terrain that eats large parts of that, I would think trice if you didn't want to model the environment right from the start). Thats a good reason why even wasting time on it is of not so much use. The 3GS didn't take of that massively as gaming platforms while the 2nd gen didn't for no good reason, we are looking at a "common usage" performance delta of a factor of 1.5-3, games that sift at 15FPS on pre 3GS run on 50-60 on 3GS+ and alike
     
    Last edited: Apr 25, 2011
  30. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    hmm how did the guys at 4x4 Jam guys actually did it? it flies on 2G devices. And currently 25% of devices are 2G so it's just not possible to switch to a platform that only uses 3g, it would lose tons of sales.

    Btw, my game runs at 20-30fps on a 2g, with clouds, multiplayer and 8 airplanes on screen. So it's not so much the device, it's a matter of writing a good system. My only problem is with the terrain that doesn't look as good as it should: http://www.joaquingrech.com/dogfight.html if you want to see it on youtube.

    4x4 Jam managed to do an awesome terrain system but they never released it for others to use. I was hoping the system on this thread is able to work for 2g, otherwise it basically removes 25% of my customer base.
     
  31. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    They are not 2G, they are the first 2 generations in total (2G ie the original iphone, or the whole host of first generation together makes less than 1% of the install base). There is a wide difference even on those trashies. Generally the phones are worse than the iTouches due to their phone services which eat about 5MB RAM.


    And its possible to create something that "flies", but you need to write something highly optimized for the device, nothing that uses texture blending but explicit 1 diffuse texture + 1 detail texture for example and that uses geomipmap blocks. Thats extremely easy to implement and works very well and efficient as well as it requires very little texture lookups etc.

    Generally something opted for it works worlds better then trying to use something targeted at 3GS+ capabilities and "cut it down" to get it to run on pre 3GS at all.
    There is a system available targeted at old iOS devices, created by the devs of a spaceship fly game over the surface which might fit your needs pretty well. Unsure though on where to find it, as I didn't bookmark it back then I fear (I'm sure they had a thread on the board here though).
     
  32. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    I will see, if I can adapt my system to use on 1 diffuse + 1 decal.
    If this work, I will make a Opengles 1 module.

    Ps : the price of T4M will be increased very soon... If you need this system, you can buy on AssetStore also.

    I thank everyone who bought my system and who trusted me and allowing me to continue this tool.

    Don't worry, the updates will be always free.

    The link on my site is fixed ;-)
     
  33. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    I just started the next Demo Scene made with T4M, this project will be avaible on Apple Store like an apps.

    The vegetation and objects will become soon finished.

    the Lagoon: 4 texture shader :

    Screens of Lagoon iPod 3G ScreenShot :



     
  34. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    will included in the future version of T4M 1.3 :

    T4M Mix Shaders :

    Defaut shader 2,3,4 Textures (fastest, fast, normal)


    Toon Light Shader 2,3,4 Textures


    Unlit Shader 2,3,4 Textures (no light)


    The Lagoon Scene will be inclued after the out of AppStore app.
     
    Last edited: May 13, 2011
  35. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    AppStore App ?

    Nice to see new updates.
    Is the waterfall animated? Will you do one with animated lava where the lava is something like self Illuminated in the dark?
     
  36. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
  37. Foxxis

    Foxxis

    Joined:
    Jun 27, 2006
    Posts:
    1,108
    Is the source fully exposed? Thinking primarily of shaders etc. TIA!
     
  38. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    I love the toon shader :)
     
  39. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    @foxis
    Yes.

    @dreamora
    thank ;-) but...

    Note : I found a problem on Unlit shader and Toon Shader : shaders Problem Solved for next Update
     
    Last edited: May 19, 2011
  40. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Does it support projector shadows? It does not seem to.
     
  41. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    Yes of course (the brush preview is a projector)
     
  42. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    I am very interested and will be watching this one closely.

    Is OpenGL ES 1.1 supported yet? Does it work under 2G iDevices? (Since its OpenGL ES 1.1)
     
    Last edited: Aug 12, 2011
  43. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    I have never try the T4M on old devices( 2G,3G), the 1.1 shader works, but I don't know if the performance are good.

    On 3GS all shader (the 4 textures shader also) works with more than 30fps with the lagoon scene.

    I suggest you, before buy the T4M, to try lagoon scene demo, available on asset store. (the scene is heavy for old device, but if you keep only T4M terrain, maybe you can try on 2G and 3G devices.
     
  44. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    Hello, great work indeed!
    but isn't terrain for ios coming with the unity 3.5 update?
     
  45. stuatk

    stuatk

    Joined:
    Nov 18, 2009
    Posts:
    53
    Trying the demo:

    Planting bug, of am I doing something wrong? (using iMac + Lion + latest unity) After assigning some prefabs to the slots in the planter tab I run the game then when I return to the planter tab - the slots have been cleared!

    Also - whenever I click away from T4M object and return back to it, it should remember which was the last opened tab.

    I really want to use and buy the full version - but without documentation and written tutorials I the price tag cannot be justified.

    Thanks.
     
  46. SJAM

    SJAM

    Joined:
    Jan 11, 2009
    Posts:
    729
    Hi all,

    @SOIL
    The UnityTerrain works on iOS since some time, but performance are not good on mobile, due to a lot of drawcall and amount of vertex.
    The T4M fix this problem with only 1 drawcall (1 single mesh).

    @Stuatk
    First, I'm honored that a person who have worked on Tomb Raider, has try my tool :)

    Is not you or a bug, the engine reset all variables of my editor window when you play the scene, like some things in UnityTerrain menu (selected brushes and all settings of tree plant). I seek a solution for that.

    Like you see, my english is a little bad, it's for that, that I had made a video to explain better how to use the T4M.
    But a lot of persons ask me a written tutorial, so I will do that, this weekend + a little update to fix some things.

    EDIT : Follow the T4M : HERE
     
    Last edited: Apr 17, 2012