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
1
Question by SyntaxTerror · Jan 11, 2016 at 09:08 PM · c#lighting

How do I make things fade into the distance?

I have a game where the player stays at the centre of the game world. There are then a number of characters that approach it from all angles. I want to be able to do it so it looks like they're coming into view from darkness. It should be gradual lighting of the characters, rather than them just appearing into view.

Putting a spotlight at the top doesn't work as it's only lighting the top of the characters. There doesn't seem to be any attenuation of the point light.

What's the best way of achieving this effect? Bear in mind that I have zero confidence with shaders.

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 tanoshimi · Jan 11, 2016 at 10:46 PM 1
Share

Without meaning to sound facetious, you need to build up your confidence with shaders. It's one line to make an object's alpha fade with its depth. Failing that, have you considered global fog?

avatar image Cherno · Jan 12, 2016 at 12:47 AM 0
Share

You can always use the Update functioln or a Coroutine to set the $$anonymous$$eshRenderer's material color's alpha value to a value that is calculated from the distance between the object and the world center.

avatar image SyntaxTerror · Jan 12, 2016 at 06:48 AM 0
Share

Yep. I think alpha channel is the way to go with this. I did try the global fog but couldn't figure out how to set it up correctly. The lack of detail in the scene at the moment makes it difficult to see what's happening when I set the fog.

Besides, in the past I've tried setting the fog but it doesn't work on some devices - most notably Windows Phone.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Morozov_5f · Jan 12, 2016 at 09:21 AM

I think, you are looking for fog. You can enable it in Lighting window (open via Window->Lighting).

Menu looks looks that:

Fog menu

You can play with params to make your game look awesome :)


снимок-экрана-2016-01-12-в-14929.png (7.4 kB)
Comment
Add comment · Show 1 · 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 SyntaxTerror · Jan 12, 2016 at 09:33 AM 0
Share

That's what I used on previous projects and it looked cool - until I tested it on Windows Phone. Seems my Lumia 925 doesn't support a high enough shader level. :( It's what I use as my primary testing platform as deployment is simple.

Fog would have been perfect but I think I'll go with Alpha. For now at least.

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

56 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 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 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

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Way to have 2D Sprites lit by Lights? 3 Answers

Application.LoadLevel() changes lighting for some reason? 12 Answers

Bloom in a 2D game on iOS? 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