Iray Uber Shader [Documentation] Questions

Arnold CArnold C Posts: 740

Reading the documentation for the Iray Uber Shader, I find some of the explanations a bit vague and would need some clarification:

Transmitted Measurement Distance - This is the distance light must pass through an object before getting the transmitted color.

At what scale? The MDL documentation states that the coefficients are per meter of world space. But in another MDL tutorial it's been said, that one should take care of the measurements, or the results will be wrong (f.e. putting in meter where is has actually to be centimeter). Since Studio's world scale is rather centimeter than meter, I would like to know if that had been adjusted within the Shader, or if it's still at the default meter scale?

Peeking into that said Uber Shader, I also found the formula to calculate the absorption and scattering coefficients. Calculating the scattering coefficent is quite easy to understand (Scattering Coefficient = SSS Amount / SSS Measurement Distance), but the absorption coefficient gives me a bit of a headache (Absorption Coefficient = log(Transmitted Color) / (-1.0 * Transmitted Measurement Distance)). My question on this is, how the renderer calculates the "log(Transmitted Color)" out of the 3 mostly different floats for the red, green and blue color channels? Are they converted into a single float, go by the average of all floats summed up, or does it calculate it for each of the color channels seperately?

SSS Amount - This property sets how much scattering is occurring.

Does this mean, how much of the incident light is actually scattered, or more the total amount of light in that material being subject to scattering?

Consider the strikedthrough ones solved if the difference in the distance scale of the "colored_wax.mdl" and the DS Shader Preset of the same name means, that the measurement for the absorption and scattering coefficient in the Iray plugin has been already adjusted to Studio's default world space scene unit scale of 1 cm per unit.

Post edited by Arnold C on
«1

Comments

  • Arnold, you seem to have a grasp of the mechanics behind these things far ahead of what I've been able to learn.  If you continue to put down findings and quesitons you have, I, in my own best interst, heh, will try to find and direct those that might be able to respond or comment because I would certainly love to unravel the Iray-Gordian-knot.  Hopefully I will learn enough as well to be able to intelligently add to the conversation.

  • KhoryKhory Posts: 3,854

    All this math.. But I will be watching avidly to see what you learn!

  • Arnold, you seem to have a grasp of the mechanics behind these things far ahead of what I've been able to learn.  If you continue to put down findings and quesitons you have, I, in my own best interst, heh, will try to find and direct those that might be able to respond or comment because I would certainly love to unravel the Iray-Gordian-knot.  Hopefully I will learn enough as well to be able to intelligently add to the conversation.

    Thank you for your kind words, Cris, and for your interest. My grasp of the mechanics behind these things isn't really that large, I wish I could understand more of the more abstract stuff and how close to real-word physics Iray actually works. And mostly to understand NVIDIA MDL in whole, to be able to write a specialized shader optimized for skin tissues' optical properties. The standard UberIray is IMO somewhat too limited to model all the different skin layers in a proper way. I fear the Iray-Gordian-knot won't be so easy to come by the way Alexander did. laugh

    Try some of those papers I mentioned in the other thread, and I'm sure you'll close up fast... or even pass me by. smiley

     

    Khory said:

    All this math.. But I will be watching avidly to see what you learn!

    You sound as if that's something horrible (okay, in some way it is laugh), but you had to see the sunny side of that, too: if you're able to put some real-world measurement into it, which is unfortunately based on that cruel math, you'll have to make much less guesswork and eye-judgement to set up your stuff. And it also will take you less time to get your final result. Which could mean you mabe can double or triple your output and in the end add your chapter to Stonemason's "Content Creation For Dummys, Volume 2 ...Or How I Made A Million Dollars Selling Poser And DAZ Content". (If you have his Sci-Fi Bedroom, try a look at the texture named "stlBooks.jpg", in the lower left corner. I love to look for the easter-eggs he tends to hide in his textures.) smiley

    My latest finding is a more physically based solution to apply a more realistic shine on skin (and the drawbacks this includes):

    set "Top Coat IOR" between 1.51 and 1.525 (the average for the refraction index of the sebum [1.5] and the stratum corneum [1.52/1.55] layers), "Top Coat Layering Mode" to "Fresnel", "Top Coat Roughness" to 0.7 (or "Top Coat Glossiness" to 0.3 if you use the "PBR Specular/Glossiness Mix") and "Top Coat Weight" to 1.0. Set "Glossy Layered Weight" of the Base Layer to 0.0, shutting it completely down. You'll get a realistic shine on your skin, just by IOR and surface roughness.

    That's the way how real-world does it, the large difference in the refraction indexes of air and those of the outer layers of skin result in an abrupt change in light's velocity, an amount of that being reflected instantly, and the roughness of the surface let the reflected light spread out into slightly different directions.

    The drawbacks: shutting the Glossy Layer down seems to result in a somewhat unrealistic "glowing" of the whole figure. By shutting it down, it's most likely that it's Refraction Index value also has been deactivated, which on the other hand is of some importance for the SSS parts of absorption and scattering. 

    The first tests I did with a "Glossy Layered Weight" of 0.001, a "Glossy Reflectivity" of 0.0 and a "Glossy Roughness" of 1.0. You'll get a shine at a realistic strength, but instead of that "glowing" you'll get a very strange dark boundary around the contours of the figure. sad

    It seems that even on that low level the glossy part of the Base Layer gets in conflict with the reflection from the Top Coat. Switching to "PBR Specular/Glossiness Mix", and setting the "Glossy Specular" to a color of 0, 0, 0, which normally should result in that there wouldn't be any reflection at all. Same dark boundary.crying

    My guess is, that the standard UberIray Base Layer isn't that optimal for that kinda work, and that it may need a different shader or an additional modified Uber Iray with a Base Layer without the glossy part, only scattering and transmission, and let the Top Coat do all the glossywork. A shader with a seperate layer for each of the skin layers (subcutis, dermis, epidermis, stratum corneum, sebum) I guess would be optimal and hopefully not have that large impact on renderspeeds I fear it could have. I'm currently trying to make sense out of the strange stuff they wrote in the MDL Manual and MDL Handbook to find out if it's possible to try and tinker one like that.

  • UPDATE on my findings so far:

    Comparing the "Colored Wax" Shader Preset with a setup of the "colored_wax.mdl" example in .\Program Files\DAZ 3D\DAZStudio4\shaders\iray\nvidia in Studio's Shader Mixer gave me the answer to the question, at what scale the Measurement Distances in Studio most likely are.

    Where the MDL uses a value of 0.02 (m) for "distance_scale" (the default scale for the coefficients in MDL is meter), the shader preset uses a value of 2.0 at that place. That would mean, that they most likely adapted the Iray renderer plugin to the default Studio world scale of 1 cm per unit.

    The formulas for the coefficient calculations but give me a (new) headache: the one for the absorption coefficient in DAZ's IrayUber and the one in the NVIDIA MDL example are completely identical, but those for the scattering coefficient differ much:

    DAZ3D: Scattering Coefficient = SSS Amount / SSS Measurement Distance

    NVIDIA: Scattering Coefficient = log(SSS Amount) / (-1 * SSS Measurement Distance)

    Since both methods seem to work, it's now to find out which one would be the most accurate. For the answer for that, I decided I'll try to find out right at the source.

    One sling untied, with some help from user Tobor, but another one even got tighter, the Iray-Gordian-knot is still defying.

  • ToborTobor Posts: 2,300
    Arnold C. said:

    DAZ3D: Scattering Coefficient = SSS Amount / SSS Measurement Distance

    NVIDIA: Scattering Coefficient = log(SSS Amount) / (-1 * SSS Measurement Distance)

    Since both methods seem to work, it's now to find out which one would be the most accurate. For the answer for that, I decided I'll try to find out right at the source.

    Wouldn't this come under the "knowable unknowables" category? Seems to me it would depend on the material; heavily viscous vs gaseous material, steam vapor vs Koolaid versus honey vs wax vs skin. I doubt there will be a single formula that will work on all materials.

  • SzarkSzark Posts: 10,634

    settles down with some popcorn and feet up.... :)

  • ToborTobor Posts: 2,300

    Let me rephrase and say there's probably a forumla that can be evenly applied, but we don't (yet) have all the terms for the formula. We'd need things like molecular density, for a start.Tthere's considerble math involved, depending on what we want to look at, e.g.  https://en.wikipedia.org/wiki/Mass_attenuation_coefficient, a fmorula for attentuation that also considers absorption and scattering coefficients. Don't know about you, but my slide rule just burned out just browsing that page...

     

     

  • mjc1016mjc1016 Posts: 15,001
    Tobor said:

    Let me rephrase and say there's probably a forumla that can be evenly applied, but we don't (yet) have all the terms for the formula. We'd need things like molecular density, for a start.Tthere's considerble math involved, depending on what we want to look at, e.g.  https://en.wikipedia.org/wiki/Mass_attenuation_coefficient, a fmorula for attentuation that also considers absorption and scattering coefficients. Don't know about you, but my slide rule just burned out just browsing that page...

     

     

    That's part of the reason I settled for a minor in Math, instead of a major...my brain just couldn't handle any more.

  • Tobor said:

    Wouldn't this come under the "knowable unknowables" category? Seems to me it would depend on the material; heavily viscous vs gaseous material, steam vapor vs Koolaid versus honey vs wax vs skin. I doubt there will be a single formula that will work on all materials. 

    I'm really not an expert at this, but I'd say, that Iray "knows" from the IOR of the material and it's absorption and scattering coefficients, if it would be a dense or "not so dense" material. The denser the material, the more absorption and scattering will occur.

    The MDL 1.2 Language Specification states on page 33 (for explanations about the color type), that "operations will be performed using the vacuum wavelength λ0 = λ * n ; where λ is the local wavelength in a medium with an index of refraction of n." From that I understand that the color (wavelength) i a volume is modified by it's refraction index value.  

    Tobor said:

    Let me rephrase and say there's probably a forumla that can be evenly applied, but we don't (yet) have all the terms for the formula. We'd need things like molecular density, for a start.Tthere's considerble math involved, depending on what we want to look at, e.g.  https://en.wikipedia.org/wiki/Mass_attenuation_coefficient, a fmorula for attentuation that also considers absorption and scattering coefficients. Don't know about you, but my slide rule just burned out just browsing that page...

    The equation for the mass attenuation coefficient itself isn't that complicated, nor is that for the attenuation coefficient. That for the mass density is a bit complex, but as long as you have the relevant measurements, it's really not that complicated. Getting this relevant measurements I see the most difficult part of that, judging by the difficulty you have to get even on the simple ones like IOR and such. wink

    The more essential question would be, if the renderer is able to make sense of that kind of data. I just headed over to the NVIDIA Advanced Rendering Forums and started to ask about the volume material struct. And as I see, a mod has already approved my posting, so let's hope someone who knows about will give an answer. smiley

    Szark said:

    settles down with some popcorn and feet up.... :)

    laugh Welcome around. Just make sure you're not dropping any of your popcorn on the floor. cheeky

    mjc1016 said:

    That's part of the reason I settled for a minor in Math, instead of a major...my brain just couldn't handle any more.

    One trick is, to simply ignore when the gentle humming sound changes into a louder droning one. laugh

  • mjc1016mjc1016 Posts: 15,001
    Arnold C. said:
     
    mjc1016 said:

    That's part of the reason I settled for a minor in Math, instead of a major...my brain just couldn't handle any more.

    One trick is, to simply ignore when the gentle humming sound changes into a louder droning one. laugh

    So, I gave that up and worked in a recording studio...doing that drowned out that droning sound.

  • Arnold CArnold C Posts: 740
    edited September 2015

    I headed over to the NVIDIA Advanced Rendering Forums, and here's what I've been told by the helpful Admins and Moderators over there:

    The Absorption Coefficent (further abreviated as AC) is calculated using the below formula, (for the designations I used the names as they're used in Studios Surface Material Tab):

    Absorption Coefficient = log(Transmitted Color) / (Transmitted Measurement Distance * -1)

     

    • The logarithm field log() computes the natural logarithm.
    • Measurement Distances in Studio are in it's centimeter world space scene scale, NVIDIA uses meter for default in their MDL examples.
    • The AC is calculated for each RGB color channel seperately so it could portray the varying absorption properties of a material, depending on the wavelength, for skin it would be: in the blue spectrum the most, and in the red the least.

    The RGB color values in the Transmitted Color slot work like valves, or flood gates, and determine, in dependency of the given Transmitted Measurement Distance, the amount of light of that specific color (in %), that is transmitted by the volume over the specified distance; a value of 1.00 means fully open, and one of 0.00 means completely shut.

    F.E., a value of 0.5 in the red RGB channel and a Transmitted Measurement Distance of 1.0 would result in 50% of red light transmitted through a material which is 1 centimeter thick will come out the other side. Would the thickness be 2 cm, than it would be 25%, at 3 cm 12,5%, and so forth.


    The Scattering Coefficient (further abreviated as SC) is calculated similar, but in difference from the AC, which supports full color, the SC is currently only supported as greyscale in Iray (for NVIDIA meant that for many SSS applications a greyscale/white scattering would be sufficient enough), but they are already working on a change, so that it will be full color in the future, too.

    Scattering Coefficient = SSS Amount / Scattering Measurement Distance

     

    The SSS Amount determines the amount of light (in %) that will be scattered before it could travel through the distance determined by the Scattering Measurement Distance.

    F.E., a value of 2.00 for SSS Amount and a Scattering Measurement Distance of 0.75 means that 200% of our PLVP's (poor little virtual photons) are scattered before they have a chance to travel through a distance of 0.75 centimeters. (That's one intense bar room brawl! :P)


    I made up a little calculation matrix in OpenOffice, now that I have all the relevant information availabe, and if DAZ didn't let Iray do any adjustments to them internally (and so out of our sight), the absorption and scattering coefficients for our new "Generation 7" maidens are all just "a lil' bit" (or "way, way") beyond anything ever measured. :I

    If you check the SSS settings, there we have a Transmitted Measurement Distance of 10.00 (cm), a Transmitted Color of RGB 1.0, 0.339223, 0.339223, a Scattering Measurement Distance of 0.75 (cm), an SSS Amount of  2.00 and a Material IOR of 1.33 (clear water; nothing! on this planet, except clear water, is made out of clear water! Even politicians don't have an ior like that; on those it's the average of muddy water, hot air and a complete vacuum. :P)

    So we will get an AC of RGB 0.00, 1.0810976, 1.0810976 and a SC of 2.666667, which means there would be absolutely no absorption at the red spectrum, and an even one in the green and blue spectra. (In which I see the reason for Gen 7's skin turn out to be a little too reddish in some lighting situations. The first one mentions "SSS Reflectance Tint" will be fed to the crocodiles. Aw, wait...! :P) 

    On human skin, absorption at a wavelengths of the blue spectral range is the most, a bit less on green wavelengths, and at red wavelengths the least (but not nothing, zero, null, nada!). The maximum optical penetration depth for light at a wavelength at 750 nanometers is at around 2.2 milimeters!

    Thanks for your attention. smiley

    As I heard, Szark will throw a round of popcorn on the house... laughcheeky


    UPDATE: There has been a misunderstanding regarding the material.ior! Although expressed as a color, the colors within the RGB channels of the Transmitted Color will be left alone when it comes to calculations for the absorption and scattring coefficients. The formulas and explanations I have already corrected.

    Sorry. blush

    Post edited by Arnold C on
  • zaz777zaz777 Posts: 115

    Arnold C. said:

    I headed over to the NVIDIA Advanced Rendering Forums, and here's what I've been told by the helpful Admins and Moderators over there:

    Great information Arnold!

    The irayubermaterial.mdl file doesn't include the material's IOR in either coefficient's computation and I assume that DAZ Studio isn't doing it in some some way that is hidden from us.  So, if we want to use physically "correct" parameters for transmission and scattering, we need to adapt the values we use here.  Thankfully, it isn't very hard to make those computations.

    To correct the scattering coefficient, we simply need to multiply the SSS Amount by the material's IOR.

    To correct the absorption coefficient, we divide the Transmitted Measurement Distance by the material's IOR.

    This actually makes sense out of what I've been seeing in my renders.  I've been increasing the SSS Amount to get a bit more waxy look to what I though was fairly plastic looking skin.  I'd been increasing it to a value that would be higher than multiplying it by the IOR, but I also wasn't changing the Transmitted Measurement Distance.

  • EsemwyEsemwy Posts: 577

    How is the absorption coefficient evaluated?

    What's with the natural log of the color? Given that the RGB values are all between 0 and 1, the ratios of the colors will not only be changed, but inverted if they're being evaluated separately.

    Given your numbers above, if they're evaluated separately, we'd have -infinity, -1.85996551, -1.85996551, which gets divided by the negative Transmitted Measurement Distance. Where -infinity would probably be replaced with a large negative number.

    An alternative is multiply the color by the logorithm of its monochrome equivalent which would give us 0.0, -0.353 -0.353, which is much less strange.

    Or is the whole thing evaluated as monochrome? That would produce -2.265, also less strange.

    I guess, with all that thinking out loud, the question is, which is it? Or is it something else?

  • Dang...the site didn't even tell me there were more postings here, but I'm really glad to see there are!

    Great information!

  • Arnold CArnold C Posts: 740
    edited September 2015

    Thanks, zaz.

    Esemwy said:

    How is the absorption coefficient evaluated?

    What's with the natural log of the color? Given that the RGB values are all between 0 and 1, the ratios of the colors will not only be changed, but inverted if they're being evaluated separately.

    Given your numbers above, if they're evaluated separately, we'd have -infinity, -1.85996551, -1.85996551, which gets divided by the negative Transmitted Measurement Distance. Where -infinity would probably be replaced with a large negative number.

    An alternative is multiply the color by the logorithm of its monochrome equivalent which would give us 0.0, -0.353 -0.353, which is much less strange.

    Or is the whole thing evaluated as monochrome? That would produce -2.265, also less strange.

    I guess, with all that thinking out loud, the question is, which is it? Or is it something else?

    Did you use the logarithm to base e? That's the "ln" key on a pocket calculator or the LN function in Excel/OpenOffice Calc. Let's see:

    For the 1.00 on the red RGB channel, I get 0.00, the natural logarithm for that is 0.00, divided by -10.00 I get (logically) 0.00. As the 1.00 in the red color channel won't be further modified within the renderer, the 1.00 in the red RGB color channel will result in absolutely no absorption there! (The people at NVIDIA recommend to not us a 1.00 or 0.00 for a Transmitted Color value, since it would result in no absorption for this color channel and will look just odd.)

    For the 0.339223 on the green and blue RGB channels the natural logarithm is -1.0810976 , divided by -10.00 I get 1.0810976. So we have an AC of 1.0810976/cm for each the green and the blue RGB color channel. A bit too low and too uniform.

    While human skin has the highest absorption (and scattering) within the "blue" spectral range at wavelengths between 420 and 490 nanometers, and a slightly lower in the "green" spectral range at wavelengths between 490 and 575 nanometers, this values don't make very much sense by now.

    Post edited by Arnold C on
  • Dang...the site didn't even tell me there were more postings here, but I'm really glad to see there are!

    Great information!

    Welcome back, Cris! Thank you! smiley

    Yes, the e-mail notification for the new forums doesn't seem to work that perfect now. frown

    Mostly solved, the volume part of the Iray-Gordian-knot. wink Would it help if I'd simply just write a ticket to get an answer to the last unsolved question? I'm a bit indecisive for doing that, since I don't want that the head of one of the helpdesk guys n' gals may explode... laugh

  • EsemwyEsemwy Posts: 577

    Sorry, cut and paste error on my part and I should have explained better. I didn't use IOR because I didn't see it in the MDL. If I remove the conditionals, the code is thus:

    absorption_coefficient: math::log(transmitted_color) / -transmitted_distance_of_measurementscattering_coefficient: sub_surface_scattering_amount / scattering_distance_of_measurement

    If I assume I'm taking the natural log of the elements of RGB 1.0, 0.3392230.339223

    DANGER PYTHON CODE!

    a = np.array([1.0, 0.339223, 0.339223])np.log(a)/-10.

    I get 

    0.0, 0.10810976, 0.10810976

    If I assume the logorithm is operated on the monochrome conversion of the color:

    np.log(a.sum()/3)*a/-10

    The ratios of the colors are maintained resulting in

    0.05807439, 0.01970017, 0.01970017

    This maintains the relative contributions of the colors. I did a simpleminded monochromatic conversion, but they could just as easily implement a different method. I have no evidence that this is what the log(color) implements, but the first alternative makes it meaningless as a color. We've also seen that in other cases that the volume shaders use only the luminance value, which would be more akin to this method.

    I guess my point is, if the transmitted color and the absorption coefficient are expected to be actual colors as opposed to simple luminance values I don't think the natural log of the individual color channels makes any sense.

    This is now much longer than I intended. It's entirely possible that it makes no sense whatsoever as I'm rather sleepy at this point.

    Good night.

  • ToborTobor Posts: 2,300

    If you look at the wax example, the IOR is there, but it's not part of the computed math for the coefficients. Dialing a different value for IOR indeed affects the refraction, so the term is being passed to Iray. In Arnold's example, I take it the IOR is not connected in to the MDL surface definition, and is instead handled procedurally. How this differs inside Iray's busty innards is something for the brave to test!

    The wax example would be the easiest to hijack, though it does not contain a term for SSS amount. That could easily be hard-coded for down-and-dirty testing purposes. It also combines the distances for absorption and scattering, where these are separate in the IrayUber MDL file. I've found some use for differing values here, but for what I'm doing -- glowing godrays, pulsating liight sabers, etc. -- using the same value for both seems to work well.

     

  • That's an interesting question. I added the link to my thread at the NVIDIA Advanced Rendering Forum to my explanation posting. Feel free to join the discussion, the more we are asking specific questions about how MDL and Iray work, the better. wink

    As I saw in your Playing around with Iray MDL thread, you already got the MDL Language Specifications and the MDL Handbook. I can't find in there nothing that will suggest that a color operation is done involving a preceding monochrome conversion. If you have read the chapter about color, you may already know that in MDL a color value isn't a color in the conventional meanig, "the MDL color type represents values across a continuous spectrum of wavelengths". (Although I've yet still to find out in which way the various wavelengths are mapped to the color value. The explanations about that are a bit sparse, like those for the volume properties. I argue that the one who wrote the MDL Specs it's just the same who wrote the DAZ Studio Manual... or a close relative. :P).

    The method NVIDIA uses seem to rely directly on the descriptions givem in the IUPAC Compendium of Chemical Terminology - the Gold Book about absorption coefficent, and absorbance. So the "color" of the AC isn't really a color, it's a ratio. Expessed as color value.

    Yep, me too. G'Night smiley

  • Arnold CArnold C Posts: 740
    edited September 2015
    Tobor said:

    If you look at the wax example, the IOR is there, but it's not part of the computed math for the coefficients. Dialing a different value for IOR indeed affects the refraction, so the term is being passed to Iray. In Arnold's example, I take it the IOR is not connected in to the MDL surface definition, and is instead handled procedurally. How this differs inside Iray's busty innards is something for the brave to test!

    The wax example would be the easiest to hijack, though it does not contain a term for SSS amount. That could easily be hard-coded for down-and-dirty testing purposes. It also combines the distances for absorption and scattering, where these are separate in the IrayUber MDL file.

    As JanJordan explained on the NVIDIA ARF, the "uniform  float ior = 1.4" determined in the material struct [ior: color(ior)] in the "colored_wax.mdl" example is treated as material.ior, and layer specular and glossy BSDF's in reflect_transmit mode will automatically use the material.ior.

    The SSS Amont is in, but it's kinda easy to overlook:

    scattering_coefficient: (distance_scale <= 0)? color(0): math::log(color(.5)) / -distance_scale;

    "to write expressions like color(0.5) is a convenience for lazy code writers - it equals to color(0.5, 0.5, 0.5)" like Ruediger on the NVIDIA ARF said. So the SSS Amount for the colored wax is 50% per 0.02 meter distance. Since both the AC and SC are expressed as 1/cm or 1/mm, and measured at specific wavelengths, there isn't really a good reaon to have different measurement distances for each of them. You could even go by a 0.01 (or a 1.0 in Studio) if it's given in 1/cm.

     

    Post edited by Arnold C on
  • Arnold CArnold C Posts: 740
    edited September 2015

    UPDATE:

    Heads up from JanJordan @ NVIDIA ARF: color values of 1.0 / 0.0 in a Transmitted Color RGB color channel should be avoided, since it would result in no absorption for this color (wavelength). So a 1.0 in any will result in light of that color will be able to shine right through a transmissive material of even 1 mile thickness without any losses. Oi, that isn't Star Trek here... laugh

    I'll try to get a definitive confirmation how the logarithm for the AC's colors is calculated. 'till then... smiley

    Post edited by Arnold C on
  • SzarkSzark Posts: 10,634

    yep the popcorn is on me.

     

    Ok this is still hard for me to follow but it might explain what I am seeing in my testing. What I did was to put a distant light behind Genesis at 50 lumens and tested a few things out. It would seem to me the the Translucency is providing more of the colour while SSS isn't but they are tied together. If I make the SSS colour a high saturated colour more translucency takes place, drop the saturation down and translucency drops. I also set up SSS at 2.00, 0.25, 0.50 and -0.50 at I saw 10 being way to much. Skin thickness of 0.25 seemed right to me. SSS of 0.50 just looked right and the SS direction well I could not see any difference between negative and positive values.

  • Arnold CArnold C Posts: 740
    edited September 2015
    Szark said:

    yep the popcorn is on me.

    Ok this is still hard for me to follow but it might explain what I am seeing in my testing. What I did was to put a distant light behind Genesis at 50 lumens and tested a few things out. It would seem to me the the Translucency is providing more of the colour while SSS isn't but they are tied together. If I make the SSS colour a high saturated colour more translucency takes place, drop the saturation down and translucency drops. I also set up SSS at 2.00, 0.25, 0.50 and -0.50 at I saw 10 being way to much. Skin thickness of 0.25 seemed right to me. SSS of 0.50 just looked right and the SS direction well I could not see any difference between negative and positive values.

    Great! laugh

    Yeah, that's unfortunately highly complex stuff. It took me a long while to even basically understand that cr... Glad you're still with us. smiley

    Yes, that translucency depends on how many of our little photons will survive due to a lowered (or raised) ratio. Too less will look as odd as too many. It all depends on right balanced distance and color values, which to find is the hardest part on this, and as we just have been informed, that a value of 1.0 isn't that balanced at all... and of course an appropriate ior value. Which will have an impact on the transmission that couldn't be ignored.

    I guess the SSS Direction is mostly noticable if you overturn your transmission settings. I had an incident where I had some nasty shadow artifacts, which got less when I retuned the direction setting.

    Since the scattering part is currently only supporting monochrome, for that we will still be restricted to a very simplified solution, so Scattering Measurement Distance at 0.25 looks good if you set your SSS Amount to something around 2.0. It will become more interesting when NVIDIA changes that from grayscale to full color.

    The transmission part is currently the most important, for it will decide if your light shines right through your figures or will be absorbed before it could reach the other side. I'm currently on a Transmitted Measurement Distance of 2.0 and a medium saturated color. Looks good so far, but I'll try some measured data from the upper limits of the respective wavelength ranges. They'll be a a bit lower than those in the mid and lower ranges, but should still be within the limit to be considered valid.

    Post edited by Arnold C on
  • ToborTobor Posts: 2,300
    edited September 2015

     

    Arnold C. said:

    The SSS Amont is in, but it's kinda easy to overlook:

    scattering_coefficient: (distance_scale <= 0)? color(0): math::log(color(.5)) / -distance_scale;

    Yes, I understanmd that, but it's not a separate input term, like it is for IrayUber. I think there's more universal application (not just skin or colored wax) when the value is not based on the (luminance of the) color, but is separately controllable. In IrayUber, they assign the value of SSS Amount to sub_surface_scattering_amount, and then use that in place of the highlighted code above.

    Your psuedo-code had it right: fetch SSS_Amount from an input term, and apply that instead of some  log of what turns out to be only the luminance value of the color, not even the color.

     

    Post edited by Tobor on
  • SzarkSzark Posts: 10,634

    Yeah I have it set up so the translucency is only affecting the ears and not the whole body like it was a week ago.

  • Arnold CArnold C Posts: 740
    edited September 2015
    Tobor said:

    Yes, I understanmd that, but it's not a separate input term, like it is for IrayUber. I think there's more universal application (not just skin or colored wax) when the value is not based on the (luminance of the) color, but is separately controllable. In IrayUber, they assign the value of SSS Amount to sub_surface_scattering_amount, and then use that in place of the highlighted code above.

    Your psuedo-code had it right: fetch SSS_Amount from an input term, and apply that instead of some  log of what turns out to be only the luminance value of the color, not even the color.

    As scattering is currently tied to greyscale, which results in conformal scattering across the whole visible spectrum, DAZ's simpler formula makes more sense than the one from the wax mdl, a logarithm calculation makes only sense when done in full color. I guess we can go by a good average of the most scattering occuring at around 380 nm and the least at 750 nm. I found a cute little formula to calculate the specific scattering coefficient for a given wavelength, based on measurements of 21 caucasians. Too bad there seems to be none for the absorption coefficient also.

    Szark said:

    Yeah I have it set up so the translucency is only affecting the ears and not the whole body like it was a week ago.

    Regarding the ears, I found out that you could go with a positive SSS Direction for them, since they're mostly made of cartilaginous tissue, and the skin there doesn't contain a strong hypodermis layer, if any.

    Post edited by Arnold C on
  • SzarkSzark Posts: 10,634

    Since I am using Genesis and the ears are tied to the head I will keep it negative.

    Scattering Measurement Distance at 0.25 looks good if you set your SSS Amount to something around 2.0. It will become more interesting when NVIDIA changes that from grayscale to full color.

    so what should SMD be then, 0.75 mm if a value of SSS is at 0.50?

  • ToborTobor Posts: 2,300
    Arnold C. said:

    As scattering is currently tied to greyscale, which results in conformal scattering across the whole visible spectrum, DAZ's simpler formula makes more sense than the one from the wax mdl, 

    Beyond being simpler, it may be the "safer" method, if and when Iray is updated to incorporate the chroma information of the color() term for scattering, rather than just luminance. For reasons of compatibility with existing scenes, it seems more than possible that Daz was made aware of this planned change, and stayed away from using the math found in the wax example. If "color" suddenly involves both chrome and luminance -- which we know is coming -- it's anyone's guess how that will change the appearance of existing shaders.

    Your main interest is skins; mine is exhaust flumes and laser beams. In the end, we'll probably need different treatments of volumetric shaders to satisfy all the needs out there.

     

  • Arnold CArnold C Posts: 740
    edited September 2015
    Szark said:

    Since I am using Genesis and the ears are tied to the head I will keep it negative.

    Scattering Measurement Distance at 0.25 looks good if you set your SSS Amount to something around 2.0. It will become more interesting when NVIDIA changes that from grayscale to full color.

    so what should SMD be then, 0.75 mm if a value of SSS is at 0.50?

    Ears being tied to the head is normally a good thing, doing the Rembrandt I find a bit too extreme... wink But I know what you mean. smiley

    Depends on how close to real you want to have it (for all calculations, a Refraction Index of 1.44 on Base Refraction is used; a good average for the combined dermis, epidermis and stratum corneum layers): 

    An SSS Amount of 2.00 and a Scattering Measurement Distance of 0.75 will result in an SC of 2.666667, which is around 6 times weaker than the weakest real-world measurement at 700 nm (16,70/cm).

    An SSS Amount of 0.50 and a Scattering Measurement Distance of 0.25 will result in an SC of 2.00, which is about 8 times weaker, and you'll get the same result when you set it to SSS Amount of 1.00 and a Scattering Measurement Distance of 0.50 btw.

    An SSS Amount of 2.00 and a Scattering Measurement Distance of 0.25 will result in an SC of 8.00, which would be just 50%.

    I'd say the trick lies within the decision, how far you want to let your photons travel. 

    Post edited by Arnold C on
  • SzarkSzark Posts: 10,634

    ok given that SSS Amount only goes to 1.00 I am not sure what to use now. Yes I know I can increase the threshold so I might give it a shot. I did see more SSS effect when I sent the SMD to 0.75 at SSS Amoun of 0.50

Sign In or Register to comment.