LuxRender 0.8dev – Volumetric Scattering

With a new year comes the realisation that most of my 3D rendering has come in the form of playing with the development builds in between working hard and playing video games.

Well, one of the long-long awaited features wanted by so many users is finally here and in development and very very testable. It might very well be near its final form (I wish not to offend the development team) And such I have been playing around with it.

The Volumetric Scattering in Lux comes in the form of 3 or maybe 4 possible implementations. I dont know all the details but, effectively the volumetrics are the same on all, the difference is the surface definition. This will become more apparent in the following test renders.

The basic Parameters are wrapped inside the version 0.7 feature, handling volumetric absorption, mainly used to create realistic Glass.

We have the normal absorption parameter, which takes a colour and an absorption depth and has been covered previously. The other main parameter is a scattering colour and a scale. The colour is self explanetory, however the scale is what is the interesting control. It can make the difference between fine fog, and say for example, milk. Bit of an extreme way of looking at it but that is what makes volumetrics so interesting in this case.

The other parameter is a isotopy g parameter which If i am honest i havent played with much at all. Basically it determines the primary scattering direction, either mostly forward (in the direction of the light), mostly backwards (same deal) and isotropic. For all of my tests i have kept this as isotropic.

Before I start I should state the following,

Defining the volume, and using the correct image scale is the difference between having an image that goes crazy and looks weird, or having an image but the effect you wanted doesnt work or make sense.
By Volume definition, this is exactly the same as in Glass2. The normals on a surface point the face to the Exterior volume, the opposite side is the Interior. If you want the atmosphere to include scattering, you should be sure to define the exterior volume for every object you have in the scene or you might get unexpected results. In general the scattering parameters required for atmosphere are very low, on the order of less than 0.01, more will look like dense fog.

For my first, very simple test I wanted to create some classic “God Rays” entering a room from a window.

Very purple room! but there you see some rays from the sun through the window. To achieve this i defined a cube inside the room which was set to a null material. With a tiny tiny bit of scattering and slight adjustment of the gain of each light in the scene, they are clearly visible.

The next scene, I defined the atmosphere with a scattering parameter of 0.01 for all colours, here my image scale is a little wrong, and what looks like it should be columns of say 50cm across, are actually closer to 2m across. Either way, the scattering in the atmosphere gives everything a grey tint, I have very very simple materials in this scene so i didnt expect anything colourful. What I aimed at was the haze from the lamp to be visible at the top of the image, this hase being from the scattering and not from secondary bounces from the walls.

On the subject of correct scales, I decided to investigate penetration depth of the light through an object. I took the 4cm wide grid from the LuxBall scene which is often used to test materials and made a wedge from null material. under that wedge i played some meshlights.

The properties of the wedge are as follows,
The colour of the wedge was set to the darkblue colour available in the luxblend exporter with an absorption length of 20cm. The scattering scale here is 400 with the same colour as the wedge.

Here it is possible to see how far the light is visible (although scattered) and how easily you can see the numbers underneath as they become covered by the null material.

My next test was a little tricky to get right, I originally wanted to add milk to my earlier “Tea for two” image, thought it was almost impossible unless i used a glossy surface, and while it would be possible to get the correct colour, it would not be possible without ALOT of messing about to get it to look right.

Milk has a really high scattering parameter, and watering it down with tea, still gives it a high scattering level. Here, the parameters are empirical, I selected a milky tea colour from an image of a cup of tea, and set the scattering colour to a slightly blue colour and gave it a scattering value of about 1000. Note here that i used Glass2 as my material rather than Null.

I then tried something a little crazy. I set all the tea set to use Glass2 with an absorption depth similar to the tea,  (about 4cm (yes i know it is wrong)) and gave it a green tint and a scattering value similar to that of the tea (1000). I then boosted the scattering of the milk up to 1500 levels and hit render. After baking for about a week on different computers, I got this

Here is is very interesting to see the dark shadow of the cup handle. it also shows how well behaved the system is. Though, with these high levels of scattering, the speed of the render is painfully slow!!! So be warned!

I then tried a simple glass of milk. Here basically the material is Glass2 with a absorption depth of 4cm with a slightly yellow colour. The scattering scale here is slightly blue and has a scale of 2000… (yep, very high!)

The reason for this is that, I don’t want the absorption to get all the light that enters the milk, i want it to be scattered sufficiently such that we see light from the caustics of the glass.  It is possible to have a material that absorbs at a depth of 1mm, but with very high scattering, will appear to be almost white bceause of this. Unfortunately that usually means the render takes a long time!

Here is my Glass of Milk

After this render, and the amount of adjustments i needed to make to the colour/depth and scattering scale (probably about 50 retries!) I thought it might be useful to make a bunch of renders which could be used as a guess when composing scenes to get the correct order of magnitude when wanting to use the Volumetric material.

Please excuse the lack of lables, however the parameters are contained within the file names. The units are in meters for the absorption length, at the start of the file name, there will be something like 0.5 at 1… this means the material has a colour (R=0.5 G=0.5 B = 0.75) and the absorption depth is 1m… files that are on the left column have no absorption and so are listed as 1at1 so colour is white at 1m.

My last words of advice is that image scale is the most important thing when choosing parameters, Remember here that 1blender unit is 1m and so if you are modelling small objects, unless you want them transparent, you need to use high levels of scattering to get a correct result.

 

Advertisements
Gallery | This entry was posted in Blender, LuxRender. Bookmark the permalink.

8 Responses to LuxRender 0.8dev – Volumetric Scattering

  1. Kyra Doria says:

    Hello, I cannot realize how you can add your website in my rss reader. Are you able to Help me, please

  2. kilbeeu says:

    hi, very informative stuff.
    i’m a new lux user and i’m experimenting with it a bit and have a question about scattering with milk material example above.
    i understand it greatly extends rendering process, but do you remember how long it took to render that glass of milk of yours? i was trying to achieve similar result, rendering overnight and the render after few hours wasnt anywhere near to what what i see here (or with my other few-hour renders where i have used glass or other liquids materials), in fact – it was complete grainy mess… does it take THAT long to get smooth render or am i doing something wrong?

  3. elif says:

    How can i put that liquid into a cup (except a glass cup) for example a ceramic (glossy material)

    • Mark says:

      Putting liquids into containers is fairly easy if you dont need to do simulations, but just want it for rendering.

      The process i use is shown here –
      https://3drenderblog.wordpress.com/2010/09/09/is-it-a-glass-for-wine-or-beer/

      I did this by first making the shape of the cup/container. I then did a loop cut with ctrl+r at the level at which i want the liquid. I select this ring, duplicate it and then separate it into a new object. Using this ring i then extrude it inwards to make a surface. You can guess/estimate what a real liquid surface looks like with a slight meniscus close to the edge. Once this is done I close the surface and remove any doubles.

      The important thing, at least for lux is that the volume system needs to be correctly setup. You must simply define each surface with the correct parameters

      So for a glass you need at least 2 surfaces, the surface of the liquid and the interface between the container and the liquid, each of these should have their properties set according to what is the external and internal medium.

      Hopefully this helps

  4. elif says:

    Thanks for the explanation but i still can not create a coffee cup and liquid as you did 🙂 anyway

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s