Advertisement

You're blocking ads, which pay for BlenderNation. Read about other ways to support us.

OSL Improved Pointiness Shader adds Accuracy

7

Tim Zoet's Improved Pointiness shader adds several improvements over the one in Cycles.

The pointiness attribute in Cycles can be very useful for rendering worn edges and dirt maps. However, it is far from perfect. It offers little to no control over the thickness of edges, corners cause problems and, most importantly, if the size of any polygons in your model are different from each other or when they change, you can start over again with designing your materials. All of these problems are mainly caused by how Blender calculates pointiness: it simply interpolates values between vertices.

This OSL script does things in a completely different manner. It analyzes the geometry around a point that is being shaded. When rendering a point on a triangle, the script will calculate a short offset along the normal and then shoot random rays in a hemisphere around that offset point. Depending on whether it hits something, it will calculate the differences in angle (and will perform some more mathematical magic) between the normal of the point and the found hit point to determine whether it found a sharp edge, a corner or a flat face.

About the Author

Avatar image for Bart Veldhuizen
Bart Veldhuizen

I have a LONG history with Blender - I wrote some of the earliest Blender tutorials, worked for Not a Number and helped run the crowdfunding campaign that open sourced Blender (the first one on the internet!). I founded BlenderNation in 2006 and have been editing it every single day since then ;-) I also run the Blender Artists forum and I'm Head of Community at Sketchfab.

7 Comments

  1. Am I correct in thinking that OSL shaders will not render on the GPU with Cycles?

    If so, it's a shame, as this looks very useful.

    • Blender indeed does not support GPU rendering for OSL. You'll have to bake your textures before you can use them in Cycles.
      I don't think there is any renderer available that has full GPU support for OSL, let alone an open source one. Recently, I found this (https://developer.blender.org/D1745) page, and it looks like it is still very far away. But maybe, somewhere in the not too distant future, there might be GPU support. We can only hope (and harass the Blender devs asking for GPU support :)).

  2. Looks great. I tried using the Blender pointiness shader with some low poly animation but found I needed to add edge loops to bring out the edges which went against the point of using low-poly. Can't wait to give this a try.

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.

Advertisement

×