I'm trying to apply a fog to my grass plane, which is deformed in multiple ways (plane is subdivied + waved by hand + 2x modifier: displace. The fog is supposed to be dense at the bottom and disappear with height, based on the gradient. But the gradient is applied to the whole object, not the local Z coordinates of the volume. Fog is generated with Volume Shatter.

I know the description is complicated, so, IMAGES! What I have is rendered, what I want is with those arrows. enter image description here

[1]What I 'want' presented with a surface shader: [2]What I have: enter image description here [3]This is how it looks in volume shatter: enter image description here

So: I want the effect from [1] to apply to volume. Please help. I'm Struggling with this for days...

I hope I didn't use wrong tags.


A guy from blender IRC support channel (#blender on freenode) found the answer, so, as follows!

There are TWO methods. First one is raytracing: first method It's really slow, and OSL depending. And casuses crashes, apperently ;)

Second method, much faster (bueno!) uses height maps instead of gradient texture. height map method nodes height map

Also, @JA12 simplified it even more, look at the nodes: enter image description here

You can study it with the attached .blend file. It's amazingly simple. .blend file my mirror: mirror


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.