OSL Improved Pointiness

by Tim Zoet in Materials, Shaders, Textures

OSL Improved Pointiness

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.

As you can imagine, these calculations take a lot more time than simply using the pointiness attribute. Because of this, the OSL script is not very suitable for direct use in your scenes. It is mainly intended to be used for baking textures. These baked textures can of course be used very easily in all of your scenes.

Features

  • Independent of polycount: Whether your model has a lot of detail, consists of only a 100 polygons or uses 4 levels of subdivision, the sharpness of an edge is calculated very precisely and consistently.
  • Aspect ratio and size of polygons: The size and aspect ratio of polygons does not matter anymore.
  • Corners and interpolation: No more weird interpolation errors around corners.
  • More control: Multiple values to very precisely control the look of the edges.

Product Updates

Version 1.1

  • Added another script that uses a somewhat different calculation, renders faster and is easier to use.

Included in the package is a PDF containing instructions on how to use OSL scripts and all properties of this particular shader.

No FAQ's found for this product.

Item Rating

This item has an average rating of 4 from 3 ratings by the community.

34%
67%
0%
0%
0%
  • Elian Koll 3 months ago

    Really Good script, i like it.
    To use it with Cycles just Bake the Shader output to a Texture Map.

  • the3dcie almost 2 years ago

    So handy !

  • George Kim about 2 years ago

    Exactly what I needed. But you should have informed the prospective purchaser (1) that it, as of today, Feb. 23, 2017, does not support GPU rendering mode and (2) it's a script not an addon so you would have to copy the script every time you start a new project.

    I hope to see a GPU rendering support, and more simple installation.

    • Tim Zoet about 2 years ago

      I wish there was GPU support for OSL as well, George, but I'm afraid that won't be happening anytime soon! Implementing such a renderer can only be done by the Blender developers, and it is a lot of work... (like, a lot). Take a look at this discussion by the Blender devs: https://developer.blender.org/D1745

Purchase this item to leave a review!