Quote from: cyphyr on January 15, 2011, 06:12:50 PM
Ahh that was the answer I was looking for
How many point lights were used? And any chance of a clue as to how you used functions to control the light fall off.
I don't remember how many lights were used. The fewer you can get away with to cheat the effect, the better. You probably don't need many if your clouds are far enough away. Make sure to choose a maximum distance on each light source, because this makes a big difference to render times.
For the beam falloff function I didn't actually control the lighting, but I controlled the density. I made a very bright cloud by entering a high value for its
ambient parameter, which you need to make the core bright enough. Then the effect is created by modulating the density.
Roughly speaking, it goes something like this. To position the line you use a Constant Vector. Any point on the line will do; a line will pass through this point. Subtract the constant vector from Get Position. This gives you the vector from the point you specified to the current position. However, since we want to falloff from a line, not from a point, we need to exclude one of the components of this vector. We can do this using a Build Vector node. For example, if I want my line to travel in the X direction, I will need to build a new vector from the Y and Z components, leaving the X input empty. By excluding the X vector, I now have the vector from the closest point on the line, not just the vector from the point I entered in the Constant Vector.
EDIT: For the Build Vector, make sure its first input labelled "input" is empty, otherwise you will be modifying another vector when really you need to build a new vector from scratch. Use Y to Scalar and Z to Scalar nodes to get the Y and Z components of the Subtract Vector, and plug those into the Y and Z inputs of the Build Vector.
Now I can create my density function with falloff by using a Divide Scalar. The first input to the Divide Scalar is a constant scalar with a positive value (try 10, but it will depend on how large you want the beam to be). The second input is your Build Vector which provides the distance from the line. (The Divide Scalar expects scalar inputs, but it will automatically turn your vector into a scalar by calculating its length, which is exactly what we want from it.)
If you connect all that to the
final density modulator of your cloud layer, and the cloud is sufficiently illuminated with the
ambient parameter, you should get a beam with a falloff. It will be noisy though, and it has the problem that it forms a singularity at the beam itself. You can fix this by Add Scalar'ing a Constant Scalar to the Build Vector before you divide by it. The larger the constant, the lower the intensity at the centre of the beam.