Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

The Secret to Great Terrain on Mobile

Discussion in 'iOS and tvOS' started by protopop, Mar 2, 2015.

  1. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    Hey I was looking at your game you made (the massive open world one)
    And was curious, how did you make it where it's literally massive without
    performance killing the machine?


    A few people messaged me and asked me what my secret was to detailed terrain on mobile, so i thought I'd share my experience in general here:



    First, i don't do anything particularly special. I'm more of an artist that a coder, so doing things like optimizing shaders etc is beyond me. My approach is pretty straight forward.

    I think having a mobile mindset in general is important to optimization. I come from a flash background where performance over a broad range of computers was important, so as a general rule i 'think small' and try to optimize everything i do. Since iPhone 4s i have been able to get 2x2km terrains running with trees and textures.

    I make sure each texture is as small as possible without looking too blocky. I use a plugin called Resource Checker:

    http://forum.unity3d.com/threads/re...ure-material-mesh-memory-use-in-scene.132008/

    It's amazing. I use it to go through every texture and shrink to largest ones. This is important because having too many high resolution textures will fill up RAM fast and crash your app.

    is it possible to have some of your experience on how you optimise vegetation/tree/grass what shader you used
    I don't use any special shaders or anything, just regular Unity trees. i do limit the detail density and distance though.

    are they like painted object on terrain ?
    To place objects and vegetation i use Terrain Composer:

    http://www.terraincomposer.com/

    The author is brilliant and the plugin is indispensable. AFAIK it just places the objects for you, and performance is the same as if you painted them on the terrain by hand

    do they have lod?
    No LOD in my projects but that's because of time constraints, not desire, When i get some more time i will take a look at that

    do you use occlusion ?
    This is a must on iPhone. Unfortunately in my experience Occlusion changed in Unity 4.3 and has been buggier (more false positives, slower overall, less stable feeling) but that said it's still essential.

    I limit my tree distance and the max number of mesh trees to about 16 to keep performance high.

    Im more interested with the overall look an atmosphere of the Open World Wilderness so im not afraid to lower textures or have resolution, antialiasing etc be set very low . I think this mindset helps.

    even a 2000 x 2000 terrain kills my performance, at least on Unity 5 it does
    you should be able to run it on IOS. I would look at every little thing to see where you can optimize it. Reduce the detail like above, limit your grass density and distance (this fills up ram fast and causes crashes), reduce the number of trees.

    That's about all I can think of. I wish i could say there is one specific secret, but it's really more about just running your game, watching it crash, reading the error log (which is mostly cryptic to an artist like me but if you just read them you can often see what it was that crashed your game and start there), and reducing the quality.

    Oh yeah, goto your QUALITY settings and experiment with 1/8th textures, turning of anisotropy and anti aliasing etc. Start from a really optimized simple scene and move upwards with detail.

    Anyways I hope this helps:) I am a huge fan of terrain based 3d and i'm actually surprised we don't see more of it. The fact that Unity didn't fix the terrain tree bug for almost a year makes me think that not many people are using terrain and trees on mobile, otherwise it would have been an outcry and high priority. This isn't to knock Unity but to say that nature designer in games seem to be a bit in the minority.

     
    ROBYER1, aaaavvvv, schmosef and 7 others like this.
  2. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,525
    Awesome, thanks for sharing buddy!
     
    protopop likes this.
  3. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    Someone asked about making puddles in Unity 5 so I thought I would share the texture im using and the technique from the Viking demo here:

    Here's a quick puddle texture i created. You can save it and import it into unity. Its just a black puddle shape created using a bezier pen in fireworks. Then a glow around the edges (or you could blur it). Added some grunge texture over it, then paintbrushed some textures around the edges. You have to make sure that the texture is also a bit transparent (this is about 95%) because it seems Unity uses the variable transparency when it's reflecting specular light.



    I just inverted it from black to white to make the Albedo texture (basically the diffuse texture) so you can see something when it isnt reflecting. Here that is too:



    Create a new material, call it "Puddles" or whatever. Import teh two textures into unity and add them to the material like in the image below. For the Albedo texture i set the Alpha to about 5% and the color to a grey/blue to simluate some almost transparent water.

    I added the Puddle Material to decals that drape over the terrain but for a test you can just add the material to a plane.



    For your environment, make sure you have a directional light in your scene. I also added a reflection probe to the scene and made sure its bounding box intersected with the puddle. The reflection probe will augment the specular puddle with reflections so you'll be able to see it better.

    And voila - puddles:)

     
    Gametyme, frosted and Meltdown like this.
  4. wana7262

    wana7262

    Joined:
    Jul 2, 2012
    Posts:
    95
    This is Amazing, I am also working on Open World Hunting game, i am not an Artist, level designing is a big problem for me, i tried to contact some artists on Freelancer.com and awarded the project to one of them and lost my $350 :( ,He created some very UGLY looking terrain, no one can create AAA quality terrain for mobile, but only i found you.
     
    mukki014 likes this.
  5. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,779
    Thanks for the little tut protopop.

    Anybody quoting 350 for triple A quality terrain isn't going to produce expected results.
    High quality terrain like protopop creates is worth several multiples of the money you lost.
    Consider ignoring lowest bidders for your next contract and you might find a competent artist to do the work you require.
     
    ashishkushwaha and protopop like this.
  6. Benjamin.chevalier

    Benjamin.chevalier

    Joined:
    Jul 3, 2014
    Posts:
    21
    Thanks for sharing this Protopop !! That's very helpful.
     
    protopop likes this.
  7. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    Glad it helps - i love digital wilderness, the more we can all work on them the better:)
     
  8. AlanGreyjoy

    AlanGreyjoy

    Joined:
    Jul 25, 2014
    Posts:
    171
    are you serious right now??? WOW!

    This is beautiful!

    This makes me wonder... if my android GPAD 7 is just a pos. (got it from at&t)

    With just a flat terrain and one texture, I am still lagging in the frame rate department....

    Guess I need to chuck up the 100 bucks and use my iphone 6 plus and see if it really is my android being..... a android.
     
  9. AlanGreyjoy

    AlanGreyjoy

    Joined:
    Jul 25, 2014
    Posts:
    171
    Also, whats the hightmap resolution for your terrains?

    Thanks for the resource checker as well..

    I was pulling 68mb for textures.. now 4mb lmao.
     
    Last edited: Jul 12, 2015
    protopop likes this.
  10. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    Resource checker is awesome:)

    I just got the new iPod Touch 6 too and the speed is really good.

    My heightmaps are just 256 but the terrain is 2048x2048 meters. The heightmap handles the broad shape of the terrain and the rest is adding in finer details over that like logs, grass etc...

    I like Android and i find they can be fast - i bought a nexus phone to test the game and i was running it high speed at 1080p!

    Also in my experience the iphones are improvig exponentially each year. A few years ago i could barely run this and now i am positive they will announce Skyrim for iPhone soon:)
     
  11. AlanGreyjoy

    AlanGreyjoy

    Joined:
    Jul 25, 2014
    Posts:
    171
    I love you puddle idea. I came up with the same exact thing a while back. Found it on accident too xD

    I added a texture to the terrain... the terrain system hated how I did the texture in photoshop, and it gave all my dirt paths this really crazy puddle look. Then I was like... huh... this is actually really cool :p

    I am flying high in FPS now, thanks to your little article. I am waiting for t4m to update... that should really push the FPS through the roof.

    But you're right on the height map res. We don't need that much. Trees, grass, logs, rocks, ect... will hide any heightmap detail anyways. So why not lower it and save a little fps :)

    I keep pushing the limit too. I have not done a 2048x2048 terrain yet. I am at 1000x1000 right now. But I am going to bump it up to 2048x2048 tonight and see how that handles.

    I must say, I vowed to never do phone games... but the market is way to large to ignore... and its SUPER fun do to too :)
     
    protopop and theANMATOR2b like this.
  12. AlanGreyjoy

    AlanGreyjoy

    Joined:
    Jul 25, 2014
    Posts:
    171
    .... the hell? You mean... I could make money making terrains/levels for people? Now THAT'S funny! 350 is pretty low. It would take at least 5 working days to get AAA looking level. I mean... fully decked out. Terrain erosion, channels, sediment, water level.... just way to much to list.

    I am going to that site now :p
     
  13. MadeThisName

    MadeThisName

    Joined:
    Mar 14, 2015
    Posts:
    115
    Amazing. I have been having a headache using Unity 4.6 on mobile with any terrain loaded with trees and grass while using occlusion culling. Im suspecting you are using Unity 5? It seems to me that Unity 5 has made some major performance improvements for terrain on mobile. Myself and probably everyone included who will read your post are wondering what all your settings are.

    Do you atlas your textures and if so do you atlas your trees and grass?

    Are your meshes combined if so what program do you use (MeshBaker?)

    From the picture posted below the puddels post It looks to me like your terrain is a mesh. If that's the case then when using terrain composer do you set your trees as objects on the mesh? What is your approch?

    What sort of FPS do you achieve?
     
  14. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    I found Unity 4.6 was more efficient in many ways. And a HUGE part about working with these kind of open world scenes is the particular version of Unity you are using. For example, Occlusion culling in Unity 4.2 and below ws really, really efficient. I'm currently working with a 4km square terrain, but I had 16km square open world terrains running on the iPhone 4S(!) using it. But Occlusion culling was broken for trees from 4.3 to about 4.5 something so it wouldnt run even on an iPhone 5. When they fixed it i was onto unity 5, which has baked terratin tree shadows broken, so you have to use realtime lighting, so im focusing on metal devices. All this to say you have to be prepared that updates to the engine can possibly break what you can achieve, how you achieve it, and on what devices it will work. It's happened to me many heart attack inducing times and i try to roll with it:)

    The nice thing about Unity 5 is now im working with realtime shadows and global illumination (some screenshots from my iPhone 6 are below). In the upcoming Nimian Legends : BrightRidge HD i'm including a lot of different quality settings. Today there is a huge difference in computing power between say an A5 and an A8X chipset, so you hve to try and gve players away to control their level of quality, and preset certain quality settings by detecting the devices.



    Nimian Legends : BrightRidge HD on iPhone 6 - now with realtime shadows!

    I don't atlas my textures, but i wish i had a program that was lightweight and i could easily tell Unity "atlas these" and have it work:) I do try to cut down on quality where it isn't noticed so much. Tree distances are quite far but billboards are close and i limit the number of trees for example. My trees and grass are each seperate textures (and just from the assets store - there is a ton of beautiful vegetation on there)

    No combined meshes but i do make sure to have static and dynamic batching checked. Anything that isn't moving is static.

    My terrain is just a normal unity terrain. I prefer it because it's easier to make changes and you get all those great terrain benefits like swaying trees and grass. But the puddles are a mesh draped over the terrain and hugging it.

    I create my terrain in world machine and export to unity, then use terrain composer to compose logical rules for placing the vegetation and textures. Honestly it think its more trial and error, ive spent literally a few years developing just this landscape , called BrightRidge, alone. And before that there was another full landscape that will probably never be published but took a few years to play with. It's like clay, just keep adding a few things each week and over time it shapes itself into something that hopefully looks good:)

    FPS for the old version was 15 - 30, in the new one it's about the same depending on the amount of detail. For example the iPad Air 2 is a beast that can handle full and far vegetation and shadows and still have a 25-30fps.

    So to sum up i dont use any third party optimizers, just the in unity ones, but i approach it from the start wth a mentality for mobile, shorten distances as much as you can get away with, lower textures but add particles and dust to cover it, just focus on making the illusion that the area is alive without full resolution trees and massive textures. Its like if you've ever gone in a museum and sen a diorama - i THINK thats what they are called, just a few stuffed animals, some fake plants and a painted backdrop, but those simple displays fuel the imagination of many visitors by combining a few small things into something greater. It's all a trick until we can really simulate every atom on some kind of crazy future-computer;)




    Nimian Legends : BrightRidge HD on iPhone 6 - now with realtime shadows!
     
    theANMATOR2b likes this.
  15. MadeThisName

    MadeThisName

    Joined:
    Mar 14, 2015
    Posts:
    115
    Thankyou Protopop for your detailed explanation and sharing with us your fantastic approach for optimization on mobile. The game play pictures look stunningly beautiful and I hope you rock the Appstore with Nimian Legends : BrightRidge.
    You have my purchase!!
     
    protopop likes this.
  16. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    Thanks:) The original is on the app store but i am almost finished the separate HD version and will launch it soon.

    One thing i noticed BTW is that when i updated top IOS 8.4 it made some of the trees in my original version flicker blue. Its the first time ive seen an IOS update break a game thats already on the app store so im digging around for my old Unity 4 files to try and update that. Just another thing to be aware of when you release a complicated app:)
     
    theANMATOR2b likes this.
  17. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    635
    Show me a screen cap of your messed up trees would you, I'm curious what that looks like :)
     
  18. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    https://41.media.tumblr.com/bb5ece877da9c69c2cd611632d1a7802/tumblr_nsh2f4A7sg1tkj61lo1_1280.png


    It's only on the conifers, its the blue and it flashes and jumps around. It must be particular to that shader because the other trees are unaffected. It's not a bog deal and i should be able to fix it with an update, but the point is it's not the game that's changed but IOS 8.4 that the game is doing this under. I'm already working to update this older version, and its not in the upcoming HD version but it's good to be aware that maybe our games might break in future versions of IOS and devices.

    It actually just happened with Bioshock:

    http://support.2k.com/hc/en-us/articles/206800767-BioShock-Mobile-iOS-Compatibility-Issues

    It all plays into the challenge of archiving gameplay for future generations to examine. It's like try playing an Atari 2600 version of pacman today for research without having an atari 2600 and the cartridge:)
     
  19. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    635
    Does it only do that on the billboard?
     
    sinfulsoulz likes this.
  20. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    no - only on the mesh tree
     
  21. Keywise

    Keywise

    Joined:
    Mar 21, 2015
    Posts:
    29
    Thank you for the great information on meshes. I just bought Nimian Legends of iOS and I'm impressed.

    Within a few minutes I found my way to the waterfall at Libertesse and the amazing view. Beautifully designed and intuitive game play. Well done.
     
    protopop likes this.
  22. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    Thanks Keywise! It's great to hear the compliment.

    I got the name Libertesse as a play on the word Liberty. Officially the statue there is the goddess of freedom, but in actual in game history she is a representation of oppression since her statue has been erected in several locations replacing the original carvings that were there from an earlier nature based religion.

    I have an HD version on the way too. Here's some screenshots:





    There's more detail, time of day, new landmarks and shapechanging and more:) It's launching in January.

    I enjoy making worlds so much and to hear feedback from people like you makes it worth the effort:)
     
    Keywise likes this.
  23. Autonoma

    Autonoma

    Joined:
    Jul 21, 2013
    Posts:
    92
    Sent you a PM. :)
     
    protopop likes this.
  24. mikejkelley

    mikejkelley

    Joined:
    Dec 20, 2011
    Posts:
    43
    Hi Protopop, awesome post, very informative. Had a question; you say that you don't bake meshes, but is it possible to bake meshes after placing them using Terrain Composer? Also, can you elaborate on the mix of static and dynamic lighting? Are shadows still broken? How do you light a tree only for the sole purpose of getting shadows? Is it only a matter of marking it static? Thanks!
     
    protopop likes this.
  25. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    635
    You can't bake tree shadows, that's why he said he is just going with dynamic shadows and targeting high end devices.

    Do you mean combine tree meshes after being placed with Terrain Composer? TC places trees using the terrain system normally, so those aren't combined in any way. If you have TC place gameobjects that are meshes, you can, in hierarchy, mark them as batching static for sure.
     
    protopop likes this.
  26. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    see mbowen89s response for some of the answers (thank you)

    Think of terrain composer as just a person who places trees, grass, objects and textures on your terrain for you in the same place each time (as long as you deselect Use random). Once they are placed you can do whatever you want with them like normal (mark them as static, bake them with lightmaps etc). If things get screwed up you can run TC again and everthing will reappear in the same place.

    As BowenGames mentioned i use only dynamic lighting. Baking lightmaps works but you have to use a low resolution if you want reasonably short baking times, and i havent been able to get baked tree shadow on terrain to work in conjunction with dynamic shadows - im pretty sure its a bug. If you have a more specific question i didnt answer let me know:)
     
  27. mikejkelley

    mikejkelley

    Joined:
    Dec 20, 2011
    Posts:
    43
    Thanks for the answers, some of my confusion came from associating Static exclusively with baking lightmaps. Previous to 5 is was possible to get tree shadows to bake on terrain, correct? I'll probably be back w/ more questions, this is a very informative thread.
     
  28. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    635
    Yes, with the different shadow baking system in Unity 4, you could bake lightmaps that included terrain tree shadows. In Unity 5, the trees will not bake shadows onto the lightmap. There is also a separate issue in Unity 5 that I don't think has been resolved, and that is that if you have baked lightmaps, and then try to have realtime shadows at the same time, the realtime shadows will not appear on the lightmapped objects.
     
    protopop likes this.
  29. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151


    BrightRidge HD version 2.0 is available now:)

    https://itunes.apple.com/us/app/nimian-legends-brightridge/id1021026309?ls=1&mt=8

    Just a cross posting - if you like BrightRidge free you might want to check this out.

    NEW
    First person view option (thank you Gingerpanderbearfreakguy)
    More detailed terrain with realistic erosion and undulation
    Interactive Map
    Orange Puffids - poisonous bulbous weeds can be cleared out with a hit
    Global fog on by default - Global fog and Distace fog density can be independently set
    Upgraded Road system to allow more flexible world design
    Forest paths
    Inn Architecture - the front stairwell
    New “Alien” Terrapin Tower in preparation for storyline
    Forest Veranda
    Arrow size UI option (for quests in v3)
    Improved combat animation - Make hit pause momentarily with Particle flash
    New Puddle system for more flexible puddles
    added terrain quality settings in options
    Fairy Circles
    Hammer for boy, wrench for girl
    added eagle spirit view
    Added FXAA3 Antialiasing in effect options
    Brightridge Flag
    New tree species - Empyrial Dashwood

    FIXED and IMPROVED
    Bloom filter causing bright white highlights
    Map moved to main options
    Hero starts embedded in ground
    Bow and arrow / first person view too low
    Touchpad doesn’t resize with resolution change
    Global fog moved to ATMOSPHERE options beside distance fog
    Separate global fog settings per time of day
    collision in water columns (thanks youtube viewers)
    Change to version 2, v3, v4 simplify
    moved touchpad option into camera options
    Faster deer and fox shapechanges
    collider on chandelier
    volumes dont affect rain and some sounds
    removed joystick in spirit view
    moved fast travel to map
    Fixed broken animal swimming
    shapechnge animal sticks animation on exiting viewdot - sometimes deer shape doesn’t switch to idle from run or walk
    Code, content and memory optimization











     
    ilmario, theANMATOR2b and hopeful like this.
  30. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    635
    An iOS review:

    As a fellow dev, I feel your pain, I really do.
     
    protopop likes this.
  31. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    Thanks mbowen89:) I was LITERALLY just mulling this over.

    I try to keep calm about it. I understand some people feel fleeced, but they dont understand it was a technical necessity. Using Metal technology meant i had to submit a new binary and the upgrades i made just wouldnt work on a 32bit device.

    What made me feel better is that i had a long discussion in the comments on this page: http://toucharcade.com/2016/03/22/i...s-brightridge-after-the-huge-upcoming-update/ and people seemed understanding about it once i explained things. i think it helped also when people find out im one guy and not a heartless profit machine.

    Also nice was someone emailed me and really let the insults fly. I explained things clearly in my reply and he apologized for his tone and was now looking forward to the game.

    What would probably have solved a lot of my challenges here is if we could restrict apps to certain devices. As these devices improve exponentially every year the gap between the new ones and what was a few years ago is like the gap between an xbox 360 and xbox one. And we have ti kind of treat it like that because if we make a game that works back to iPhone 3 it will be very limiting.

    There's lots of 5 star reviews too which is nice, and i am making excellent and exciting progress on the next update which adds in quests. Its making it feel like what i had envisioned in the first place. And a love of making games and worlds is really at the heart of why i do his - to get creative release and to make people happy:)
     
    theANMATOR2b likes this.
  32. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,779
    Just make sure the next update doesn't exclude any of the currently supported platforms, our there might be additional backlash that connects with this justified/required reduction in platforms.
    Very nice quality on this release. Great job.
     
  33. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    Thank you theANMATOR2b:) Yeah, now that ive transitioned to 64bit i wont have to do that again.
     
  34. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    635
    That's exactly what Apple doesn't want though, the ability to exclude devices. They want the customer to have the PERFECT EXPERIENCE NO MATTER WHAT!

    So you better make that happen, protopop, even if it's impossible.

    Seriously, iOS is a freaking love hate relationship. I only like it because I make more money because of the type of consumers, otherwise it's terrible in more ways than it's good, in my opinion.
     
    theANMATOR2b and protopop like this.
  35. saikiran97

    saikiran97

    Joined:
    Dec 26, 2015
    Posts:
    2
    This is an awesome thread..!!
    I am also working on an open world..
    Can you please tell me how many Tris and verts you have..?? or what is limit...??
    I am targeting mid end to high end devices
    Thanks in advance..
     
    protopop likes this.
  36. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,033
    Has anyone determined if Grass Textures are substantially more performant than Detail Meshes? I'd assume so, but boy, Detail Meshes sure look better...
     
  37. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    635
    Break it down, what's the difference between a "grass texture" and detail mesh?

    A "grass texture" is just a billboarded quad, with alpha. A detail mesh, well it's as detailed as the mesh given, and still most likely alpha. So at that point, you just need to compare the vert/tri count.

    2 tri quad > performance than a mesh with 100 tris.
     
  38. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,779
    I've not ran a test on this so I'm speculating without hands on exp. Only what I've read. Any correction to my info is welcome.
    Doesn't alpha overdraw cause more impact than tri/vert counts? With bill-boarded grass with a lot of alpha overdraw, and overlapping overdraw - I believe that would be more heavy than a high number of tri/verts?
     
  39. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    635
    Yes you are right about the overdraw being an issue for sure. BUT, isn't it just as much an issue on detail meshes? Unless your detail mesh doesn't have any leaves/foliage, it has tons of non-billboarded quads all over it.

    A tree is basically just a very detailed "detail mesh" right? It's basically the same type of object. Some type of main stem/branches with a bunch of quads for leaves like this:




    If that entire thing was a billboard, you'd have a big rectangle of overdraw, but if there's 100 quads for leaves, that's 100 quads with alpha and overdraw as well.

    If this is something bush size, the billboarded quad is a lot smaller, so it's not going to overdraw stuff as much as a tree.
     
    JamesArndt and theANMATOR2b like this.
  40. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    I have about 200 000 verts in my scenes:) My advice is to push it and test often. I dont have any specific limit i just add in what i think is needed and hope it works most of the time, but im developing a kind of sixth sense i think that keeps me from making things too complicated:)

     
    theANMATOR2b likes this.
  41. saikiran97

    saikiran97

    Joined:
    Dec 26, 2015
    Posts:
    2

    200k....!!
    But how...?
    You have that many trees..!
    Anyway thanks..
    And..... Trailer is Awesome..
     
    protopop likes this.
  42. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    Thanks - the new story update is coming in August too:)

    I dont know about the verts - i think i grew up on flash, so its like in my DNA to just temper EVERYTHING in this mindset of performance. Its kind of like i make a judgement call with each and every thing i add, and "run" it inside my mind to get an idea how it will interact with the system before i add it to the scene.





     
    saikiran97 likes this.
  43. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,679
    A really neat game art trick to optimize trees on mobile: Create a lumpy low poly blob to represent the bulk of your tree canopy, and to create a little 4 quad piece of geometry with a leaf texture on it.



    Now duplicate and snap that little leaf texture geometry all around the lumpy blob's surface like such. You can also average the normals on the little leaf geometries so that you don't get any real hard edged face shading (makes a face appear almost black when not in direct light).



    You'll then get trees that look great like this example here (using this exact technique).



    The best part of this technique is two-fold: You use less geometry because less "leaves" are needed to fill out your tree canopy. You also dramatically cut down on the transparency overdraw on the screen as the tree is mostly comprised of a solid/opaque mesh! Hope you find this technique helpful.
     
  44. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    635
    Neat idea, I feel like it fails possibly when trying to create more realistic foliage/trees though. Your tree looks likes a blend of realistic/toony, if that makes sense?
     
    JamesArndt likes this.
  45. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,679
    I'll have to get some screen grabs of my own work using this technique in a realistic setting. It holds up to realistic as well. In my usage I just make the lumpy geometry ball in the center less like an oval and more like a natural clump, very deformed and extended in spots. I also don't use such saturated and brightly colored textures as seen in the example.

    I just grabbed these from a project of mine. Now this specific project isn't mobile, it's a PC game. The technique works so well I use it in any project I can. The top is seen as it is under the night time lighting of my first scene and in the second image I've removed the tiling texture on the geometry lumps and shaded the material red to expose where the lumps are. The lumps have a tiling texture based on the exact same texture for the leaves, so the transition is seamless. On PC builds I use multiple lumpy geometry bits all over the inside of the tree branches. Not as limited as mobile.


     
  46. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    635
    What about taller less bushy trees?

    trees.jpg
     
  47. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,679
    I wouldn't even worry about it with these types of trees. They aren't very broad or bushy. You could however create a tall more narrow chunk of geometry for the center. You would need some artistic talent getting it blend seamlessly with the alpha planes.
     
  48. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    wow that looks so cool:) I feel like i just got some insider developer information here. I don't know if it would work with unity's tree motion, but i can think of quite a few instance where i could use this - garden bushes for example. Also i hear you bout how it depends on how you do the textures and shaping exactly, but this 'toony' kind of stylized look wold be very useful in today's environment, where a stylized look (limbo, warcraft, firewatch, abzu, rime, inside (which is an incredible game)..etc..) is very popular for a variety of reasons. Thank you:)
     
    JamesArndt likes this.
  49. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,679
    Well it's generally an optimization that is intended for limited platforms like mobile, so you most likely wouldn't be using advanced tree shaders with motion. On PC, you might use these more advanced foliage shaders and there is really no need for this technique on high end PC development.
     
    protopop likes this.
  50. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,151
    I just submitted version 3 to the app store - hopefully Apple will approve it.

    I wonder how it will look on an iPhone 7

    Ive worked more than 5 years on this game and although i am planning one last update for polish and little extras, im really glad it is basically what i set out to create now that it has story mode.