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
2
Question by yirah · Apr 20, 2015 at 07:42 PM · unity 5shadertransparencyissuefog

Unity 5 Global fog with transparency issues

Lately I have been trying out the new lighting system of Unity 5 as well as the fog system. So far I've looked up quite a bit and tried many different things yet I can't get this one solved. When working with transparent shaders the global fog gives a very annoying result as you can see below in the windows

And as well for the skybox/fog transistion, I can't seem to get a good looking effect as objects far away show a pretty harsh transition between being fogged and the skybox.

The transparency issue is obviously also occurring when using decals as shown below.

I have no experience writing shaders and this probably is my roadblock to making proper use of the global fog. So if anyone knows a solution for this issue or has the same issue please let me know. Thanks !

Comment
Add comment · Show 3
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 screenname_taken · Apr 20, 2015 at 08:00 PM 0
Share

Dunno about the windows, but for the fog, i'd try to simply match the fog's color to the skybox.

avatar image yirah · Apr 20, 2015 at 08:31 PM 0
Share

Yeah, that is probably the best way to get around that, but the windows and decals are the main issue :/ Thanks for the reply though !

avatar image screenname_taken · Apr 21, 2015 at 09:56 AM 0
Share

It looks as if the main thing is with the shader on the window pane is transparent. Perhaps not writing on the zbuffer or something. (I know less than you for shaders most probably.) Perhaps use a shader on the windows that isn't transparent from afar, and add a trigger at a point that you know the fog is gone, to change the shader into the one you want. It's a bit of a "ghetto" solution i know.

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by mikelortega · Apr 21, 2015 at 02:44 PM

You have to match the skybox and fog's color. Actually, if there is fog you cannot see the sky. For the windows issue, I had to make sure to check Lighting -> Fog active before building the scene (even if density is 0). I hope it helps.

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 yirah · Apr 21, 2015 at 03:10 PM 0
Share

I believe that did the trick ! can't believe that I didn't stumble on that myself.Though there should be a little density as it seems to be the same value used for global fog. Thanks a lot :)

avatar image Earlybird · Aug 11, 2015 at 09:51 AM 0
Share

This worked for us also, although our assets were downloading via asset bundles. For this we had to make sure to turn on fog in the scene prior to building our asset bundles.

avatar image
0

Answer by 14ercooper · Aug 14, 2015 at 03:52 AM

Method 1 - Simple and easy:
Window --> Lighting
Scroll down and check fog
Edit settings to your liking

Method 2 - Slightly faster, more customization:
Remove Global Light
Add a point light, child to player
Create a material for skybox color
Window --> Lighting
Set skybox material to newly created material
Make sure Sun says None
Set Ambient Source to color
Set the ambient source color
Edit the point light, skybox color material, and ambient source color to suit your needs

I think you are using method 1, so try method 2

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

Transparent shader disappears with multiple objects 1 Answer

Transperency not working correctly on imported objects. 1 Answer

Unity System Fog Access 0 Answers

Strange effects of two transparent objects on each other. 1 Answer

Cant get Alpha Channel to Work with Custom Shader 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