• 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
Question by ThisGuyThatsHere · Apr 21, 2017 at 08:07 PM · terrainoptimizationgrassvegetation

How to optimize custom grass?

Hey

I have made a procedural terrain generator, the problem is, I tried adding grass the easy way, e.g. texture on a plane is being spawned at a vertex, however, even with that little (compared to what you usually achieve with built-in terrain) amount I got a significant FPS drop, so how would I add vegetation? Or there is no easy way?

Comment
konsic
ukulilandia

People who like this

2 Show 0
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
Best Answer

Answer by FortisVenaliter · Apr 21, 2017 at 08:35 PM

Well, first, use the quad instead of the plane. It uses like 1/64th as many polys.

But there are, in fact, dozens of ways... however, each have their benefits and drawbacks. I'll list a few I can think of off the top of my head below, but I'm sure there are more comprehensive lists/guides to be found elsewhere online:

  1. Static Batching - basically cram as many grass quads as you can into a single mesh, but that eliminates billboarding

  2. Point Extrusion - define a mesh of points, then use the geometry shader to convert into billboarded quads

  3. Height mapping - similar to #2, but use one repeating flat mesh 'tile' and pass a heightmap to make sure the same mesh can fit itself to any terrain.

Keep in mind, you're also not limited to one method. You can switch methods per LOD to make more expansive grass run well.

Comment
ukulilandia

People who like this

1 Show 3 · 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
avatar image ThisGuyThatsHere · Apr 21, 2017 at 09:03 PM 0
Share

Thanks!

I was planning to make it via #1 and still may do it this way, but #2 got me interested. Not easy since I'm new to shaders but seems very procedural-friendly.

avatar image tanoshimi · Apr 21, 2017 at 09:59 PM 0
Share

Geometry shaders are typically slow and not that cross-platform compatable. I'd recommend investigating using the new GPU instancing feature, or simply a chunked dynamic mesh instead.

avatar image ThisGuyThatsHere tanoshimi · Apr 21, 2017 at 11:38 PM 0
Share

Then I guess it's not worth that amount of time I would need to understand them, also as I calculated I get about 100-200k grasses per chunk (that being lowest good-looking amount) so that could be split into 12 grass meshes easily applied as LOD. Gotta check how it runs as 12 meshes, cause now I have 2-3 FPS on my mid-end PC. ~Actually 24, cause normals, but seems to run fine.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

80 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Vegetation problem 1 Answer

Optimizing vegetation. 3 Answers

how to import custom plants and grass into unity 1 Answer

Camera flickers near terrain grass/detail on Mobile 0 Answers

Accessing the Terrain detail material 2 Answers


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