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.

https://github.com/simileV/blender_3_bumpToRoughness
https://github.com/simileV/abj_osl_b2r

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,

1 Like

Hey, would you be able to help me with setting up the nodes? I’m having an issue with bump disappearing from distance and this is exactly what I need. So how does one set up the nodes? So far I’ve managed to set up the script PxrBump2RoughnessRead_abj, but my principled BSDF does not have Specular Normal socket. I’m also wondering which file I’m supposed to put into filename_check of the script. Also how is it supposed to be specified (like the exact file path from drive to file name?)

You have to compile a new build of Blender with the additional sockets added to it…that version of Blender is in the github

Could somebody please tell me how to installl it? I don’t know if I’m missing something.