Make "gaussian laser beam" (object with variable radial emission profile) Laser beams are usually not cylinders of light, but instead they have a smooth beam profile, where they are brighter in the center of the beam and dimmer towards the sides. The cross section typically looks like a Gaussian function, do they are often called "gaussian beams".

Consequently, in illustrations, the lasers are often rendered such that they are most intense in the center and fade out towards the sides. I have achieved this using a blur effect in the compositor, but since Blender can handle most of the other physics in the world, I would like to include realistic laser beams directly. 

Here is what I have come up with so far, but I am not quite happy with the results:



The blue beam was created using the node layout described in this post, except that I swapped the order of the colors in the color ramp. This still displays very sharp edges and they do not match the natural background color.



For the green beam, I tried to do the most realistic thing possible: I combined a volume emitter with a volume scatterer object. In reality, it is the scattering of the laser beam by particles in the air that allows us to see the beam, so I thought that this was the most appropriate. I added a set of nodes (yellow) to control the longitudinal intensity of the emitter in order to make the beam brighter near the focus (right side). Then, I included a set of nodes (red) to control the radial intensity of the beam in order to give it a nice soft edge. However, I just scaled the intensity along the radial coordinate, but did not take into account the fact that the beam is getting smaller. So, there is a nice gradient of intensity near the left side of the beam, but it's still very sharp towards the right side. 

So, I suppose the question is how do I scale the intensity of the emitter while taking into account the width of the beam?
Here is a node setup that approximates the Gaussian beam.


normalize the coordinates of the object by division on the dimensions
subdivide the radial dimensions "in this case Y and Z" on the beam length "X" 
feed  Y Z into a Gaussian function to create the redial gradient
the longitude gradient is simple (beam length-X)




Coordinates node group


Gaussian function node group

The A input in the Gaussian function group controls the amplitude of the Gaussian function.
S_y and S_z control the Y and Z spread.

simple render :

another render :


.blend file
YA render