Floor fog with ScatterVolume in Cycles

  • Hello

    The floor fog on this pic

    I made with a cube an ScatterVolume
    0_1493542762170_floor fog.JPG

    My question is, is it possible to make the VolumeSactter like a gradient with more at the bottom and less at the top of the Cube.

    I don't realy understand how the xyz coordinates effects the volume.. I tired out many combinations, but I don't realy find out a logic.

  • @joker Same here. I tried to make a cone of smoke (like tailpipe exhaust) denser at the small end with gradients but could never get it to work. The scatter node seems to have the same density all over a model but the parts that are thicker have more space for the rays to shoot through so more scatter to happen.

  • Can you not add V to your clouds and clamp it?


  • Poser Ambassadors

    V node is on the surface, not interior.

    I generally modulate fog with the P node, which gives absolute position in the scene.

    If you set the x and z parameters to 0, then the P node reads out height.

    The units of the P node are 1/10 of a Poser inch, so to read out a value as inches, you would set the y parameter to .1.

    Since the P node is officially a vector, when you plug that into a number channel it will be converted to a number by averaging, i.e. (x + y + z) / 3. Since we would actually want the inches to come out, you should triple the y parameter, so that the calculation becomes

    Y = (0 x + .3 y + 0 z) / 3 = .1 y

    Once you have height from the P node you can do lots of math with it, including decide on a blended density from A to B as in

    factor = (Y - A) / B

    Use that factor to control whatever you want, most directly into Mix or Blender nodes. If you're going to use it in other math nodes, you'll want to clamp it first.

    Instead of the legacy P node, you could probably also use the Cycles Geometry node, which has a Position output, but I'm not sure if that is operative in a volume shader. Certainly the Normal output is probably inactive in a volume.

  • @bagginsbill Thank you very much, it works!

    I was not sure if I understand exatly what you mean, but my test render brings exactly what I was looking for :-)



  • @joker Sorry for asking that, cause I feel completly stupid. I try to reproduce your test and in dont succed. Could you share your test scene so i can understand where i'm wrong ? what's the v_Texture_Coordinate node ?

  • @lsauvage

    I have no privilegs to upload files here, but try to download it here



  • Thank you very much, i greetly appreciate your help.

    Even with your scene at first i could not get the same result as you. It was have because of my settings where in poser native units.

    I had to change to inches, close the scene and reopen it to get your results.

    First fail due to units :

    after inches... Thats it !

    I think i will keep to inches.

  • @joker Hi, In your shader the P node is not doing anything other than reducing the density.

    Using 0_1493633668071_upload-7d13f238-b090-4114-9351-3aff4744fa9e

    I get


    and reducing the Y scale, and increasing the X and Z scales on the cube I get


  • Poser Ambassadors

    I wasn't sure what the U and V nodes do in a volume. So I suggested using the P node for the height, but you're all using the V. So fine, let's look at the V.

    Here is the Poser box, with the surface lit by the V node.


    Here is the volume lit by the V node.

    Interesting. I would have checked on this yesterday but I didn't have the time. So it would appear that in a surface shader, the V node gives you the V value from the UV mapping, but in a volume shader it can't do that. I expected it would give nothing, but instead it gave something proportional to P.y.

    Guessing that U node would give something proportional to P.x, it seems to do that.


  • Poser Ambassadors

    My problem with the V node, even now that I know it is proportional to P.y, is that I do not know the units, and I won't know them unless I experiment. As I wrote earlier, I do know the units for inches. So if I want to precisely control the gradient, so that as we go up from the ground, the fog begins to diminish at 21 inches and is completely gone at 34 inches, I can easily set that up without experimentation.


  • Poser Ambassadors

    Now I can, if I like, apply a uniform cloud pattern to the fog like so.


  • Poser Ambassadors

    I was going to show how to put all this in a compound node but it wasn't working right. I suspect bugs in compound nodes.

    Anyway - here's a setup involving the modulation of the clouds, so that at the bottom it's solid fog, and then it breaks up from 10 to 40 inches. Above 40 there is nothing.


  • Poser Ambassadors

    Note - you don't have to use emission. I just did so to get the color of fog I wanted as the scatter alone is rather dark.

  • Poser Ambassadors

    Another interesting arrangement is to use the clouds node to modulate the gradient bottom or distance. Here I'm modulating the distance.


  • @bagginsbill Wow! Thank you very much. I'm not sure if I've understood everything at the moment, but I am realy happy that I have now the possibility to controll clouds and fog atmospehere effects so good :-)

    I save your explanations. I'm sure I'll can use this very well :-)

  • Thanks, @bagginsbill I knew what you meant about the P node but I couldn't see how to use it to modulate "roughly" on the height, i.e,. not have a uniform fade. Thank you for the explanation I'm sure I will use this! BTW could we not have sub cats here so we could have a sort of Node Cult :o)