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 /
This question was closed Aug 29, 2015 at 12:44 AM by getyour411 for the following reason:

Other

avatar image
1
Question by konikun · Dec 23, 2012 at 10:38 AM · shaderterrainruntimetransparencytrees

How to make trees in a terrain transparent in runtime?

Hello everyone, I'm trying to make the trees in a terrain (not isolated trees) fade to transparent in runtime. Actually, I'd like to make only the leaves do that.

The simplest way I thought of doing that, was just fetching the TreePrototypes from the terrain data, getting to the prefab, getting to the material that I want (the optimized leaf material), and changing the material color's alpha to 0. However, that didn't seem to work, maybe because the transparency is only determined by the main texture's alpha.

Then another approach was to change the shader of the material to Transparent\Bumped diffuse, and then change the main color's alpha. This partially works (the leaves fade out gradually), but I get a warning from the editor saying that:

"The tree Tree1 must use the Nature/Soft Occlusion shader. Otherwise billboarding/lighting will not work correctly."

And the result is that the low detail trees disappear and I can only see the ones that are next to me.

If anyone has any idea on how to solve some of these issues, or just how to achieve what I'm looking for, it'd be great!

Thanks in advance.

Comment
Add comment · Show 1
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 getyour411 · Aug 29, 2015 at 12:44 AM 0
Share

You probably can't do a 'effect-over-time' here or the lag from constantly hitting/replacing the terrainData treeinstances will be quite evident. You can swap out the prefabs but it's risky and not supported because of the risk of corrupting the terrain. And as you've reported, Terrain trees need specific shaders.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

9 People are following this question.

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

Related Questions

Terrain transparency not seeing through 0 Answers

How do you add/remove terrain trees during gameplay? 1 Answer

Trees appearing as black square when oculus is plugged in 0 Answers

INDECIPHERABLE rendering order problem when modifying material property on Runtime 1 Answer

Set shader's AlphaCutoff programmatically in HDRP 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