Source of the Specular Macro block?

Hello,

I am writing a tool to convert materials from one app (Daz) to another (3DS Max).

I asked about this before and thanks to the response I am using the Shader Builder to see how the shaders operate and recreate them.

One thing that is causing a problem however is the glossiness parameter - it behaves differently in the target application to Daz. I believe the function (as in the equation) used to calculate the specular component from the parameters is different.

Could anyone tell me how the specular highlight is calculated? Can I see the source for the Specular Macro block anywhere? Or could someone tell me what reflection model it uses?

SJ

Capture.JPG
983 x 554 - 82K

Comments

  • JonnyRayJonnyRay Posts: 1,744
    edited March 2014

    You can see the source code for any macro by adding it to the network, then right-click on the block and choose "Edit Macro Instance". In this case, the code works out to:

    Result = (Color * Strength * specular(N, V, Roughness));

    So, all the macro really does is to call the built-in 3Delight specular function.

    The 3Delight reference can be found here: 3Delight 6.4.4 - Standard Functions (lighting)

    Warning - it's not very helpful. ;) Appears to simply be an implementation of the Renderman standard.

    One thing to note about the default DAZ Studio shaders, they use the term "Glossiness" for the specular highlight. This is actually the inverse of Roughness. So if you're feeding Glossiness into the function, you should use the conversion Roughness = 1.0 - Glossiness.

    Post edited by JonnyRay on
Sign In or Register to comment.