It looks like you're using an ad blocker! I really need the income to keep this site running.
If you enjoy BlenderNation and you think it’s a valuable resource to the Blender community, please take a moment to read how you can support BlenderNation.

Laser Sheet OSL Shader

OSL (Open Shading Language) shader nodes for Cycles are becoming more and more popular (and powerful). Here's a laser sheet implementation by renatogsousa.

renatogsousa writes:

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.

Links

7 Comments

Leave A Reply

To add a profile picture to your message, register your email address with Gravatar.com. To protect your email address, create an account on BlenderNation and log in when posting a message.

Share this story: