This gives the sphere a slightly clouded look as if not all of the light was able to pass through it. For interesting variations of this texture, try lowering ior to 1.15 and raising reflection to 0.5.
One thing we do notice is that the shadow of the sphere is still the same old flat gray shadow we have had all along. If there is all this light refraction going on shouldn't there be something going on with the shadow as well? That something would be due to an effect known as caustics . POV-Ray cannot do caustics but it can fake them to some degree. This is an easy one. Simply add caustics 1 to the finish block and re-render to see the effect. What we see is a highlight in the shadow that simulates the effect of light passing through the sphere and being focused because of the curved surface. Remember that this is not real caustics, so changing other finish parameters like ior will not affect the caustic highlight. The faked caustic is limited to the area shadowed by the corresponding object.
Try varying the values for amount , thickness and turbulence to see what changes they make. Try adding a normal block to see what happens.
Due to the complexity of the halo feature and the large amount of parameters provided it is very difficult to get satisfying results. The following sections will help you to create a halo step by step, starting with the basic things and going to the more subtle stuff.
It is also helpful to read the halo reference sections to get a better understanding of the halo feature. You should especially read the sections "Empty and Solid Objects" and "Halo Mapping" because they are essential for understanding halos.
A halo is attached to an object, the so called container object, just like a pigment, normal or finish. This object is completely filled by the halo but you won't see anything if you do not make sure that the object is hollow and the surface is translucent. How this is accomplished will be shown in the next section.
When working with halos you always have to keep in mind that the container object has to be hollow and translucent.
In the first example ( halo01.pov ) we try to create a fiery explosion, which the sphere is best suited for. We start with a simple scene consisting of a camera, a light source (we don't care about shadows so we add the shadowless keyword), a checkered plane and a unit-sized sphere containing the halo.
You'll note that the sphere is set to be hollow and has a translucent surface (the transmittance channel in the pigment color is 1), just like it is required for halos. You'll also note that the plane has a hollow keyword even though it has no halo. Why is this necessary?
The reason is quite simple. As described in section "Empty and Solid Objects" there can be no halo inside any other non-hollow object. Since the camera is inside the plane object, i.e. it is one the side of the plane that is considered be inside, the halo will never be visible unless the plane is made hollow (or the negative keyword is added to bring the camera on the outside side of the plane).
What do all those halo keywords and values mean? At the beginning of the halo the emitting keyword is used to specify what type of halo we want to use. The emitting halo emits light. That's what's best suited for our fiery explosion.
The spherical_mapping and linear keyword need a more detailed explanation of how a halo work (this is also done in chapter "Halo" in more detail).
As noted above the halo is made up of lots of small particles. The distribution of these particles is described by a density function. In general, a density function tells us how much particles we'll find at a given location.
Instead of using an explicitly, mathematical density function, halos rely on a given set of density mappings and density functions to model a variety of particle distributions.
The first step in this model is the density mapping function that is used to map three-dimensional points onto a one-dimensional range of values. In our example we use a spherical mapping, i.e. we take the distance of a point from the center of the coordinate system. This is the reason why it is clever to start with a container object sitting on the coordinate system's center. Since all density mappings are made relative to this center you won't see anything if you start with an object sitting somewhere else. Moving the whole object (including textures and halos) to another location is the correct way of placing a container object.
Now we have a single value in the range from 0 to 1. This value will be transformed using a density function to get density values instead of distance values. Just using this single value won't work because we want to have particle distributions were the density decreases as we move from the middle the container object to the outside.
This is done by the density function. There are several alternatives available as described in the halo reference (see section "Density Function" ). We use the simple linear function that just maps values between 0 and 1 onto a 1 to 0 range. Thus we get a density value of 1 at the center of our sphere and a value of 0 at its surface.
Now that we have a density function what do we do to see something? This is where the colour_map keyword comes into play. It is used to describe a color map that actually tells the program what colors have to be used for what density. The relation is quite simple: colors at the beginning of the color map (with small values) will be used for low density values and colors at the end of the map (high values) will be used for high densities. In our example the halo will be yellow at the center of the sphere where the density is greatest and it will blend to red at the surface of the sphere where the density approaches zero.
The transmittance channel of the colors in the color map is used to model the translucency of the density field. A value of 0 represents no translucency, i. e. that areas with the corresponding density will be (almost) opaque, while a value of 1 means (almost) total translucency.
In our example we use
which results in a halo with a very translucent, reddish outer area and a nearly opaque, yellowish inner areas as you can see after tracing the example image.
There is one parameter that still needs to be explained: the samples keyword. This keyword tells POV-Ray how many samples along any ray travelling through the halo have to be taken to calculate the halo. Using a low value will result in a high tracing speed while a high value will lead to a low speed. The sample value has to be increased if the halo looks somewhat strange , i. e. if some artifacts of the low sampling rate appear. For more details see section "Halo Sampling" .
A good starting value for the number of samples is 10.
The basic halo used in modelling a fiery explosion.
Table Of Contents