The daz team is available to provide technical data if needed

Issue #355 closed
Alessandro Padovani created an issue

Thomas, we just got this post by Sam of the daz team a couple days ago, it can be useful if you need any help

https://www.daz3d.com/forums/discussion/comment/6445081/#Comment_6445081

Comments (6)

  1. engetudouiti

    If Thomas can Contact Daz team, I may recommend (hope) Thomas ask about iray reflectivity (with roughness metalness mode)

    Iray MDL never offer reflectivity socket, but use ior to mix glossy shader as same as cycles .

    That means, daz definetly convert reflectivity by use ior. the problem is what formula they used to convert ior as reflectivity.

    the doc only discribe, reflectivety 0.5 = (almost) ior 1.5 then basically use it. but it is not PBR manner.

    why it is important we need to use ior value with fresnel to mix glossy shader in blender.

    . it is almost principle (or you need to use new mix formula with your original curve function)

    I had serched it long time, then basically many product render reflectivity use same convert function . (blender doc use specurarity in pincipled bsdf)

    ======

    Specular

    Amount of dielectric specular reflection. Specifies facing (along normal) reflectivity in the most common 0 - 8% range.

    Hint

    To compute this value for a realistic material with a known index of refraction, you may use this special case of the Fresnel formula: specular=((ior−1)/(ior+1))2/0.08specular=((ior−1)/(ior+1))2/0.08

    For example:

    • water: ior = 1.33, specular = 0.25
    • glass: ior = 1.5, specular = 0.5
    • diamond: ior = 2.417, specular = 2.15

    Since materials with reflectivity above 8% do exist, the field allows values above 1.

    ===== (blender manual)

    if we assume, cycles principled bsdf “Specular” = Daz iray uber “reflectivity”,

    we can get ior for bsdf shader mixing from daz reflectivity value. (if reflectivity is 0.5, ior should be 1.5 actually daz document discribe so)

    by this formula (python math.sqrt) ref = reflectivity(I assume it is principled bsdf specular)

    ior = -(14.142135623731*sqrt(ref) + 2.0*ref + 25.0)/(2.0*ref - 25.0)
    

    though current bsdf (add on option) not convert reflectivity 0.5 , as ior 1.50 without clear reason, even htough daz document discribe so.. with multiple some value, (so if you think it is correct, ask it Daz . they may answer your conversion is correct or not)

    Then if we can get real formula how daz get reflectivity from ior value.. . so we can reverce , get ior from daz reflectivity. or you can ask more directly, “what formula can convert daz iray reflectivity when we use fresnel node to mixing glossy shader (BSDF) as IOR

    there seems some daz original aproximation, I suppose.. the most clear thing is, even though I set reflectivity as 0.0, daz uber iray still show reflective color. but cycles ior 1.00 simply remove all reflectivity, when we use it for mixing frenel ior.

    (if you use my conversion function,, reflectivity = 0 ior 1.0, reflectivity = 0.5 ior 1.5, reflectivity = 1.0, ior =1.78878850537961)

    Then I hope to know, why reflectivity = 0.0 still show reflectivity.. (we can ignore it, (daz never suppose we set reflectivity as 0.0 or, there is some clear meaning.. (so it is not ior 1.00 but other value we need)

  2. Alessandro Padovani reporter

    In my tests I approximate with ior = 1.1 + 0.7 * reflectivity, that works fine enough at least for the uber shader. So when reflectivity is zero I use ior 1.1. Then please note that reflectivity and fresnel also depend on the implementation, in cycles there are multiple choices.

    So personally I’d not go with exact formulas that may not work anyway with cycles, but I’d rather use approximations based on actual tests. The uber conversion is far from perfect and there are many cases we don’t consider. Just most common materials work fine.

    Then the uber code is available in the irayubermaterial.mdl daz file for anyone interested, but I can’t read mdl.

  3. engetudouiti

    I do not care, if it is user self custom conversion, what function is used.. like ior = 1.1 + 0.7 * reflectivity. But I do not think it is good for this add on. But I can not suppose. daz use linear function to set reflectivity from ior. and as I said , daz clear discribe, when we set reflectivity as 0.5 it almost represent ior 1.5.

    if your function represent ior correctly, when reflectivity = 0.5 (daz default recommend reflectivity) convert as 1.45. ior never change between shader language. it is depend by each material. so we can use ior table (like glass, or diamond etc) as PBR parameter.

    even though your conversion is good enough with your test, I really do not think, we need to change ior 1.5 to 1.45 in cycles.

    of course how we use fresnel depend on the implementation, in cycles there are multiple choices. (but it is same, in MDL there are multiple choice, so if actually uber iray, tweak Ior like that,, it is correct to convert uber iray. but if not, there is no clear meaning, why we change 1.5 to 1.45.

    I knew , I have irayubermaterial.mdl , but it use many variable import from mutliple files. It is not so simple without asking author = DAZ developer

    From DAZ man reply, I believe if Thomas ask it, he may offer clear answer. may not say you read irayubermaterial.mdl and steal how we convert ior as custom reflectivity input.

    It is same, why I ask Thomas about add on code. even though I have some knowledge about bpy, and python, it never means we can easy find necessary function from complex code. I can read simple mdl. can write it (or can edit shader mixer with use my custom.mdl)

    But to catch the conversion function in the MDL is unfortunately still difficult for me. So I hope Thomas ask about the conversion. and confirm what function actually used. After that try to use the function in cycles node, then if it still not work well,, We need guess conversion. I never against, if you tried to get real function daz did, and try to use test and guess to imporve or better match for cycles.

    I may hope to ask about Top Coat option.too.

    I really think There are some Test and guess functions in This add on BSDF covnersion. but if daz devloper can help Thomas, it is really good chance to get real funciton how they made shader with MDL

    (I can assume Topcoat layer actually use MDL glossy shader, but if convert it, it should better to know how they customize. and made the layer shader block. And there are many option how use Topcoat,

    weight, fresnel, custom curve, reflectivity. I can easy guess each though, , I really hope to know how DAZ mix layer (or add layer) with base shader. it never be represent current guess coonversion way.

    And I recommend, ask about uver iray Volume.

    About current converison, I really do not know how you get value and set for Cycles volume scatter, and volume absorption value.

    I think, we may better not use Cycles offer volume transmission for skin (like non refractive, but more like diffusively transmission)

    Actually I had never seen, to make skin with cycles bsdf, with use volume absorption . basically it is not supposed to use skin I feel.

    but I do not say we must not use it for skin. if it really work reasonable, I do not care.. but at least add on auto attach them with most reliable option (Thomas say so), I may hope to confirm, it is reasonable to convert iray volume shader.

    At same time I may hope to use cycles volume shader, to get more realistic glass, water materials. (refractive mat) then if it is my custom node, I do not care how I set parameter values for volume , (because I can set as I like with guess, or look real pic, and set value )

    but, At least I believe, add on author Thomas may hope to know how iray uber use parameter to get Volume scatter and absorption, (daz covnert the parameter from MDL volume shader), then finally we can try to use those value for Cycles volume shader.At current only guess, without knowledge and confirm. (load some scene, with setting, compare, then guess ,and set value)

  4. engetudouiti

    So I read MDL handbook again, and serch the reflectivity is used or not in daz uberiray.mdl

    Then what I could catch is, daz seems not use fresnel layer to mixing. but use custom_curve_layer

    recent MDL hand book not clear discribe how it work. (just show example which used to mix 2 material)

    then old MDL hand book discribe like this,

    “Add an elemental or compound BSDF as a layer on top of another elemental or compound BSDF according to a weight w and a Schlick-style directional-dependent curve function. The base is weighted with 1-(w*curve())”

    I can check it in daz mix shader, MDL>>Default modules> bf > “Custom curve layer”

    This mixing node have these input socket,

    =========

    base (base shader),

    layer (layered shader (eg glossy bsdf),

    weight (multipled)

    glazing reflectivity

    normal reflectivity

    Exponent

    =============

    then I suppose the cruve () value is decided by exponent ( X**n) , normal relfectivity, and glazing reflectivity

    Daz uber iray only have one reflectivity which user set.. , so I suppose glazing reflectivity is fix value. then we only tweak (though daz recommend to keep normal reflectivity as 1.00 (fresnel ior 1.5)

    if Thomas asked about it, daz dev may offer how they set the Custom curve layer to mixing diffuse and glossy . In cycles we do not have such name layer, but we have math node, and RGB curve. then can use them as mix factor I suppose.

    (and there are layer weight node too, though I do not know clear but it have 2 out put, fresnel and Facing.

    I feel if Fresnel can be used to represent, glazing reflectivity, Facing can be used to represent normal reflectivity. but to do guess work, I really hope to get fact how daz set value for exponent, and glazing reflectivity. (so I suppose daz adjust these 2 value, then curve(x) get almost same value as ior(1.5) with “normal reflectivity” = 0.5.

    I suppose I can serch those in the mdl code, but It may better if we use those value from daz offer MDL code, get daz permission directly.

  5. Log in to comment