Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Razorwings18 · Jun 15, 2014 at 08:11 PM · terrainperformancetreesgrass

Dense foliage on Android seen from above, performance, can it be done?

I'm fairly new to Unity, so please bear with me.

I'm making a game for Android where you see a terrain from the air, mostly either from the top, or in a 50/60 degree angle (you never see the horizon).

After some optimization, it works quite fast. So far so good.

I need to add some heavy foliage to this terrain, which does NOT need to be of high quality.

So I did some experiments with trees and grass (shipped with Unity), and:

  • set BILLBOARDING to the lowest (5)

  • FADE LENGTH 0

  • MAX MESH TREES 0

  • DETAIL RESOLUTION PER PATCH 128

Trees have NO COLLIDERS, DETAILS do NOT CAST SHADOWS.

After all this, I'm getting what I think are pretty good stats: - DRAW CALLS: 16-18 average - TRIS: 14-15k average - VERTS: 14-16k average - TEXTURES: 7-9 - VRAM: 20-25MB - VBO: 33-35 1.4MB

Still, on Android it is quite slow (let's say some 10/15FPS for reference on my mid-range device). Since I will need to add heavy scripting, AI and objects later, those numbers are only bound to go down, so I want to solve the problem at this point.

So my questions are: 1 - How are the trees/details slowing the game down (as in "that bad STAT that I should be seeing but don't"), and how can I optimize this.

2 - I there a workaround / tip / trick that I can implement to make it LOOK like there is a lot of foliage, keeping in mind I will NEVER see the terrain from the ground? (objects on the ground need to be partially hidden by the shrubs, so I cannot just make a terrain texture)

Any advise will be welcome. Thank you all in advance.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Razorwings18 · Jun 22, 2014 at 08:20 PM

I guess I answered myself on this.

While I'm not positive, the problem may have been that billboarding a lot of trees one next to the other caused a lot of overdraw. I did make a test where I placed diffuse billboarded objects (no alpha) instead of the trees, and performance was still quite low.

Anyway, my solution was I ended up tiling a bunch of Quad meshes next to each other that hover over the terrain, and assigned a material with a texture that looks like tree canopies in a forest, with transparency. I used that on the fastest unlit Alpha Blended shader I could find.

The result was visually pretty good, and with ultra fast performance (somewhere around a 3 FPS drop average on my device for a full screen of forest, a single drawcall for everything, and just 2 tris, 4 verts per tile).

Since my terrain has hills, I complemented the solution with a script that moves the quad vertices to a set height over the terrain, so the forest can conform to them.

Screenshot attached, showing how characters look (white for clarity) through this forest.

Fast forest for mobile


mobileforest.jpg (408.8 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Multiple terrains and how LoD works 0 Answers

Terrain is not batching anything? 0 Answers

Edit Terrain foliage/texture at runtime 3 Answers

Help with using a single texture for all terrain trees 1 Answer

Do all trees sway the same? And do bushes for that matter? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges