Pixar's Bump to Roughness in Cycles OSL - progress and issues

I linked to / documented my progress (on artstation) of altering blenders source to facilitate the insertion of Pixar’s Apache 2.0 Bump to Roughness shader by adding a new specular normal input here : https://www.artstation.com/artwork/xYNql4

However, I can only successfully run it in Release mode of blender, not debug due to a missed assertion. Does anyone have any feedback and can anyone help me fix this so it works in both modes?

Edit : Added video (please watch in fullscreen, 1080p) (first regular showing a normal map, and second with the same normal map but using Bump to Roughness) Notice the retention in detail in the B2R version as the camera moves away.

1 Like

Found the cause of the Debug mode crashing - Blender doesnt like when you have a “INT : Checkbox” parameter on a custom OSL shader as it evaluates to be a boolean but is still an int. The solution is to not use the checkbox.

Fixed the CPU principled shader to actually have infuence on the specular normal, roughness specular and roughness diffuse inputs which were added.

Now I’m going to look at a GPU version.

GPU / CPU version is working and on github as well as OSL.

Easily generate and split the bump map /normal map tx with my script and feed it into the node. On / off comparison video - some details are lost due to the youtube compression, but since everything uses the same shader I tried to match the ground plane only. Notice the difference in visibility of the scratches on the top and sides of the cube,