- Home /
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 !!!
I just found that this option exist in the pro version. Is there a way to achieve something similiar in unity indie ?
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.
Yeah it's just what I found out lately....I am stil looking for more indie frendly solution. $$anonymous$$aybe hire a shader coder ?
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
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.
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
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.
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.
I have edited the answer with a link to a shader that might be of help.
Your answer
Follow this Question
Related Questions
EdgeDetectEffectNormals flips camera 0 Answers
mesh.uv, mesh.uv2 is what in GL ? 1 Answer
Post-process image camera shaders OpenGL 3 (WiiU) 0 Answers
Lens Effect 1 Answer