Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 MakakWasTaken · Mar 28, 2015 at 05:05 PM · terrainperformancetreebillboard

Tree Billboards

I am using gameobjects as trees for various reasons. Is there a way I can create billboards like in the terrain tree system? Do I have to write a shader, or can I write a script instead? They don't have to fade smoothly or anything I just need the billboards.

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
1
Best Answer

Answer by _joe_ · Mar 28, 2015 at 05:36 PM

Simply use a quad (not a plane).

Create a new Material and drop on it your Texture. Make sure that you use .png textures that have transparency. Pick the "Particles/Alpha Blended" Shader.

Adding the Material on the Quad will show the effect needed.

Now to make the quad a billboard, write a script and drop it on the Quad. This script should have a transform.LookAt() (check the documentation) in the Update.

Comment
Add comment · 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 MakakWasTaken · Mar 28, 2015 at 05:38 PM 0
Share

I was wondering how to make the Billboard texture at run-time is there an easy way to do this? And won't it give bad performance to run 5000 transform.LookAt's every second?

avatar image _joe_ · Mar 28, 2015 at 06:35 PM 0
Share

There is nothing such as "Billboard Texture". A billboard is a physical object in the scene, that has a cutout (transparency) texture applied on it.

Even using the Unity UI system and changing the Canvas mode to World Space will create Quads for every image added, my approach was the same.

LookAt is simply a Quaternion matrix operation that you will have to do. LookAt is there to simplify the task That's all.

As for performance, if you have 5000 billboards, the best approach is to filter the display based on distance (Near and Far Field of the Camera). Or simply check for the distance to the billboard, if it's farther than a certain number, simply disable the calculation.

Billboards follow the world tick time, so update is the perfect place to put them so you'll be ok running the script (even for multiple items).

If you want there is an other less "accurate" approach, you can, ins$$anonymous$$d of using Update, to run the LookAt inside a coroutine with a custom WaitForSeconds.

But of course this will be slower (yet more controlled). This control can allow you (just for the sake of performance) to increase the loop time if the object is far (faster calculation), or decrease it (faster) if the object is close to the camera. But of course Update is still the go to technique.

Hope that helps

avatar image MakakWasTaken · Mar 28, 2015 at 07:47 PM 0
Share

With Billboard texture I meant the texture that the billboard is going to use. But I found a solution on Google for this. Thanks anyways for giving me a good starting point on the quads.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Using billboards for trees that are not on terrain? 1 Answer

Can I disable tree billboarding? 1 Answer

Invisible Tree Billboards....???? 1 Answer

Max mesh trees for terrain does not work. 1 Answer

Does the built-in Terrain Tree Billboard cast shadows? 0 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