- Home /
How to make a volumetric gradient / fog / haze
Hello!
I am trying to come up with a way to visualize the gravitational forces in an n-body simulation. Basically, I want the player to be able to see where there are stronger gravitational forces.
I was thinking of doing something like a volumetric haze that gets stronger where the gravity is strongest, sort of like colored fog. Something like this image: http://www2.sjs.org/raulston/mvc.10/Topic.2.Lab.2_files/image139.gif except instead of arrows, a smooth fog with gradient coloring nebula effect, eg something like the effect in these two assets: https://www.assetstore.unity3d.com/en/#!/content/11707 and https://www.assetstore.unity3d.com/en/#!/content/40016
I would give those assets a try, but I actually want a gradient and not a solid color, and the "shape" of the fog is not going to really fit a primitive like a cube or sphere very well.
One idea I'm considering is a particle effect where I programmatically place all the particles in a 3d grid and adjust each particle's color individually. I think that will work, but it'll probably be a lot of particles, which is why these fog-like shaders seem like an interesting way to go.
Thanks in advance for any tips or ideas! Alex
Answer by isnotinvain · Apr 05, 2016 at 07:46 AM
I was able to come up with something that demonstrates what I'm going for:
I did this by creating a 3D grid of particles, and setting their alpha to a value reflecting the local gravity at each point in the grid. While this sort of works, it doesn't really look "quite right" because I'm sort of cheating the volumetric-fog effect with particles instead of using some kind of shader that actually does volumetric fog. So I'd still be interested in any ideas on how to make this sort of 'volumetric' fog effect in an arbitrary shape (ideally based on a grid of intensity values).
Your answer
Follow this Question
Related Questions
Elementes like in "from dust" 1 Answer
Lerp an Alpha Gradient in Particle System Color over lifetime In script 0 Answers
Particle/Line renderer sword slash effect 1 Answer
Scaling the whole Shuriken effects? 1 Answer
Is there a way to create a complete circle made of particle ribbon trails ? 1 Answer