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 SilverShad0wz · Dec 25, 2013 at 02:22 PM · terraintransparentcustom-shader

TransparentTerrain wiki shader problems

Hello,

I'm trying to create a simple scene where you're walking along a cliff path and my problem is, when I look away, I see this:

alt text

My problem is that, despite setting the fog as intense and with any mode, I can still see the goddamn terrain in contrast to the skybox. I don't want that to happening, as in this case, you're supposed to be on top of a REALLY high cliff.

I tried doing what this wiki post says to do, and where I paint with a completely transparent I get blue, when I run it, like in the picture. On the scene editor, it isn't but kind of white, and relatively kind of transparent (on the edges). Anything I could be doing wrong, or any help you could provide?

I know there's a plugin on the asset store to do this, more than one even, but I'm broke as all hell (student, :( ) and don't really want to spend 5-10$ on a goddamn shader mod.

Thanks in advance, any help would be appreciated!

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 aldonaletto · Dec 25, 2013 at 02:54 PM

Apparently your problem is the skybox shader, that doesn't take the fog settings into account: the sky shows bright and clear behind the foggy mountains! I solved this problem once by modifying the original skybox shader in order to include fog, and added to it a parameter that adjusts how much the fog vanishes towards the sky - take a look at this answer.

Comment
Add comment · Show 4 · 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 SilverShad0wz · Dec 25, 2013 at 03:04 PM 0
Share

That answer seems amazing! I'm fairly new to unity but that shader seems like it'd solve my problem! I'll try it when I can thanks for the answer man!

avatar image SilverShad0wz · Dec 25, 2013 at 04:20 PM 0
Share

I just tried it, and it helped but my problem is still there x-x. Not as bad though, but the square terrain can still be seen brighter than the skybox. What I could really use would be some sort of fog that only happend below a certan y value, and that CO$$anonymous$$PLETELY blocked the terrain. I mean, eventually totally opaque.

avatar image aldonaletto · Dec 26, 2013 at 01:10 AM 0
Share

You're right! I forgot to clamp the variable fog to the range 0..1 with the function saturate(). Just modify line 43 to this:

  half fog = saturate(1 - normalize(i.dir).y / _Fog); // fog vanishes upwards

Tweak the parameter Fog Intensity in the skybox material in order to get the desired results. Thanks for pointing out the issue - my answer is ok now.

avatar image SilverShad0wz · Dec 28, 2013 at 01:04 AM 0
Share

Thanks so much for the quick edit, you're helping a lot! It's just perfect now, thanks!

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

19 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

Related Questions

Adding a bump map to the TerrainFourLayer shader 1 Answer

Is it Possible to have Trees with Billboarded Leaves? 2 Answers

Make trees non transparent on camera touch 1 Answer

Make a simple tree 1 Answer

Custom Terrain AddPass not working 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