OSL (Open Shading Language) shader nodes for Cycles are becoming more and more popular (and powerful). Here’s a laser sheet implementation by renatogsousa.
I’ve been following the different examples of the new OSL shaders and I have decided to write my own shader, in order to show another possible application. In this case is to simulate a laser sheet illuminating the objects in a scene.
The script allows the definition of the laser sheet by imputing its origin and the vector normal to the laser plane. It then illuminates the objects where they intersect the laser sheet only if there are no obstacles between their surface and the laser origin. You just have to connect the output of the script node to an emmission shader and then add it to the base original material.
You can input the origin and normal vector values by hand but in order to create an easier and more visible way of where the plane will be, I’ve introduced 3 empties in layer 2 which define the origin and the orientation of the laser plane. After placing these as we want, just run the python script “LaserUpdate” and the input values of the OSL script will be updated accordingly. You should de-activate layer 2 when rendering since the auxiliary plane will act as an obstacle interfere with the script.