Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Kiriller12 · Jan 27, 2016 at 01:18 PM · terraintextures

Terrain transparent texture

How do I can use transparent texture on my terrain in Unity5? This shader don't work http://wiki.unity3d.com/index.php/TerrainTransparency

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by FortisVenaliter · Jan 27, 2016 at 02:59 PM

The standard shaders' source code are all available for download here.

I recommend you open up the terrain one, and modify it to allow transparency, then import the modified shader into your project. The docs for writing shaders are pretty good.

Comment
Add comment · Show 2 · 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 Kiriller12 · Jan 28, 2016 at 09:31 PM 0
Share

Sorry, I'am not good in shaders, may you discribe it better? Or at least something about which sader I should replace?

avatar image mgstauff · Sep 20, 2017 at 03:06 AM 0
Share

Has anyone done this and have some code to share? I'd like to be able to then access the transparency map from scripts to change transparency of portions of the terrain dynamically.

avatar image
0

Answer by PeteXZ · Mar 17, 2018 at 10:06 PM

I've just spent a few hours working this out, so here is my answer for anyone else who is stuck on this.

First of all, download the shader source code as described by @FortisVenaliter. You will get a zip file with lots of shaders in. Find Standard-FirstPass.shader and copy it to your Assets directory. This will replace one of the built in terrain shaders, but nothing will change at the moment because it's still the same as it always was.

Now open the file in an editor. Search for the SplatmapMix line. After it, add a line reading: if(splat_control.r > 0.05) discard;

This means that any pixels which would normally be rendered with the first texture are now thrown away. You should therefore use some dummy texture as your first one, then put your real terrain textures after that. It follows that when you create a new terrain, it will initially be entirely transparent, so it may appear not to have worked. Just paint something on the terrain and you should see it working.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Terrain look 1 Answer

Changing terrain texture on contact (collision) 2 Answers

Fuzzy Texture On FPS Camera 2 Answers

Terrain Painting, brush smaller than 1? 1 Answer

How do I determine what texture I am hitting on a terrain? 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