Skip to main content
blender3d

Blender OSL Bevel Shader

By March 8, 2014September 26th, 2014No Comments

Michel J. Anders had his interest piqued in reading a thread about ambient occlusion shaders that asked if the Open Shader Language could be used to create a bevel shader. Michel promptly got to work and the answer is a resounding “yes”. You can use OSL’s raytracing capabilities to bevel edges at render time.

[blockquote source=”Michel J. Anders – blenderthings.blogspot.com”]the question was asked if OSL’s ray tracing capabilities coudl be used to create a bevel shader, i.e. a shader that mimics rounded edges on sharp meshes by manipulating the normal[/blockquote]

To create rounded edges at render time, you need to choose a point just below the surface of the object. This becomes the point where the rays will be cast from, slightly perturbed from the face’s normal. When you are close to an edge, the normals at the intersection of an face that is adjacent will be blended in. The code involved to implant the algorithm is surprisingly small.

Check out Michel’s post for OSL Bevel Shader for blender here, to read more and get the code.

lesterbanks

3D, VFX, design, and typography. Twenty year veteran instructor in all things computer graphics.