• 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 Yanifska_ · Sep 26, 2013 at 02:33 PM · camerashadersfog

Is there a way to tweak the fog so it will be mapped on the world Y axis instead of the camear local Z axis ?

Hello dear community !

I want the fog to depend of the world coordinates instead of the camera.

I am building a top down shooter and I want a fog layer on the ground so the base of building will be a bit softer and the character will half disapear.

I suceeded by having the camera exactly at a vertical angle, but I plan to have some camera movement and the angle will change from time to time. That's why I ant the fog to be independant of the camera.

I read that you could do something similar by coding shaders, but I can't do that.... ? I believe there are some way to do that with particles but wont it be too heavy for ios ? Do you know of any solutions other than that?

By the way, I am using this vertex color + lightmap shader : http://forum.unity3d.com/threads/121083-Unlit-Vertex-Color-Lightmap

Thank you for reading! I hope you can help me with that

Cheers !!!

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 Yanifska_ · Sep 28, 2013 at 08:06 AM 0
Share

I just found that this option exist in the pro version. Is there a way to achieve something similiar in unity indie ?

avatar image Hoeloe · Sep 28, 2013 at 09:40 AM 0
Share

What you're looking for here is called volumetric fog. It's a complex material, and is only possible to create with Unity Pro. I do have an asset on the asset store that will approximate it (for rounded shapes), if that helps, but you're probably better off looking into it yourself.

avatar image Yanifska_ · Sep 28, 2013 at 02:52 PM 0
Share

Yeah it's just what I found out lately....I am stil looking for more indie frendly solution. $$anonymous$$aybe hire a shader coder ?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by sacredgeometry · Sep 28, 2013 at 11:06 AM

You can fake it by using a camera shader where the opacity is controlled by the height of the player. You could even fake it by sticking a plane in front of the camera where the opacity is controlled by height. Its not perfect but I have used this technique lots in film making so it is definitely possible to get some reasonable results.

Edit: I found this, which might help. I couldnt tell you if it works on the free version though.

http://stackoverflow.com/questions/17108239/fog-shader-camera

Comment
Add comment · Show 6 · 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 Yanifska_ · Sep 28, 2013 at 02:52 PM 0
Share

Yeah in 3d softwares we can render a Z-depth pass and use it in after effect to make fog or depth of field effect. But I am quite new to real time and I believe all this is related to shader coding. Do you know if Strumpy Shader Editor will be able to produce such shaders ? I didn't try it yet.

avatar image sacredgeometry · Sep 28, 2013 at 02:55 PM 0
Share

I believe so, I dont think you need to do it with a camera shader if it doesn't have to be true volumetric fog personally. I mean all you are asking for is basically for a screen opacity to be turned up and down relative to the y position of an object. You dont need it to interact with the player using fluid dynamics do you?

I will make a mockup for you now

avatar image Yanifska_ · Sep 28, 2013 at 02:59 PM 0
Share

Also what about particles ?is ok for IOS ? I could have a layer of particles of the size of the screen attached to the camera.

avatar image sacredgeometry · Sep 28, 2013 at 03:29 PM 1
Share

http://www.youtube.com/watch?v=DsEpyi1sDto&feature=youtu.be

This is a really lofi solution and wont really give you proper fog but depending on the game you may not notice...the only place you will notice is when you go closer to objects or further away volumetric fog should get clearer. If the game is 2d or 2.5d then that axis is locked anyway.

Other than that I am not sure. without having pro. I am afraid.

Particles aren't great for volumetric...they are very inefficient considering the amount you would need to simulate a fluid.

avatar image sacredgeometry · Sep 28, 2013 at 03:42 PM 0
Share

I have edited the answer with a link to a shader that might be of help.

Show more comments

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

17 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

Related Questions

Strange lighting on large-scale objects when using fog in VR 2 Answers

Global Fog, rotating the camera by itself 0 Answers

Default-Sprite with fog 1 Answer

[Shader] No Fog on Particles/Standard Unlit 0 Answers

Unity - How to hide the Far Clipping Planes of camera? 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