Usage
Click the add volume button to activate it. A volume attribute
will be added and will be displayed in the attributes data input box as the
currently active attribute.
Comments
The volume attribute is somewhat different from the other attributes. It is a solid attribute, that is, it defines light-emmiting material inside the solid. This will cause the object to be rendered using a volume rendering method. The material in the solid has a certain density, much like a gas or dust cloud, and the larger the volume inside the solid, the more opaque the solid will appear.
Warning
The volume attribute cannot be visualized in the Texture Preview window of
the TextureEditor. You'll have to use the render window of the TextureEditor
if you want to work on the volume attribute using the TextureEditor.
5 cubes, all containing the same volume material but with different opacities due to size difference.
A cube with density 1.0 and a size of 1.0 in each dimension will be completely opaque.
Volume parameters
A volume attribute has the following parameters:
A cube with a low density volume attribute, containing a red sphere.
A cube with a high density volume attribute, containing a red sphere.
When choosing the speed parameter, start with a value of approximately one tenth of the size of the volume. Render to see if the quality is high enough, else lower the speed (e.g. by a factor 0.5) until it is. Always follow this procedure, it prevents unnecessary slow rendering.
A cube with a high speed volume attribute, notice the banding which nicely visualizes the step size (speed).
A cube with a low speed volume attribute and thus high quality.
When working on a scene it is recommended that a higher speed is used for quick render previews. Choose the right speed when you're ready for the final rendering.
Speed does not influence rendering time on particles with a volume attribute. This is because there is no stepsize needed, as each particle is rendered individually.
An ordinary object grouped with a volume object: they are treated as seperate objects (that's what group means).
If you want to influence the way normal objects are rendered when they're inside a volume, you'll have to use overlay.
An ordinary object overlayed with a volume object: the volume has to be
'layed-over' the ordinary object(s).
A halo created with one point particle system. Each individual particle is rendered as such.
The volume attribute can be used to create particle smoke.
Interesting effects can be achieved by assigning 3D maps to the density of a volume attribute.
A cube with a noise map on the density of its volume attribute. Notice the opacity and shadow are influenced by the map.
A cube with a noise map on the color of its volume attribute. Notice the opacity and shadow are not influenced by the map.
There are 2 new maps named 'halo()' and 'halo2()' which can be used to create halo effects. The halo map is a real gaussian halo and the halo2 is a similar but faster alternative.
The halo() map on the density of the volume attribute of a sphere.
The halo2() map on the density of the volume attribute of a sphere.
The halo maps are also useful to create cloud type maps in combination with noise functions.
A cloud generated with a halo2()*noise(0.2) density.
Also effects like a nebula can be generated using halo, noise and color maps.
A nebula generated with a halo2()*noise(0.15) map on the density and a 2*(marble2()*color(1, 0.76, 0.54) + (1-marble2())*color(0.8, 0.32, 0.32) + color(0.1, 0.0, 0.8)) map on the color of the volume attribute of a squashed sphere.
If you try to reproduce this and things don't work out like you'd expect, there are 2 things to keep in mind:
To model a light beam, 2 approaches can be taken:
When creating a room with dust inside, always make sure that the surface of the solid containing the dust material is visible from the camera, or else the volume attribute will not be visible. So when creating a cube room with the camera in the cube, the surface of the solid containing the volume must not be outside the room.
Reset all.
Create a cube and size it by 200, assign a grey diffuse attribute for the walls and a volume attribute for the dust inside the room.
Give the volume a speed of 20 (one tenth of the size of the solid), a density of 0.003 and select the scattering volume type to make light effects visible.
Set the camera zoom to 120.
Add a spot light to the scene, give it a green color, and aim the spot light on one of the walls using 'spot coi'. Assign an intensity of 10000 (we need a powerful light source for the dust to become visible).
Raysketch. Due to the high speed the banding effect is noticable, decrease the speed of the volume attribute to 10 or to 3 to get a higher quality.
The result of a powerful spotlight inside a low density dust room.
Using the above example, delete the volume attribute of the cube and delete the spot light.
Create a cone and size and rotate it so it resembles the spot light beam of the previous example.
Assign a volume attribute to the cone and give it a green color, a density of 0.01 and a speed of 1.0.
Raysketch. The light beam in this example is not a light beam at all but it has the advantage of rendering faster because there's only a volume attribute present inside the cone. The disadvantage is that light effects suchs as shadows and illumination are not present.
The result of a cone containing a green volume attribute inside an empty room.