Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Question About anisotropic_vdf and "Material volume"

  1. #1
    Join Date
    Oct 2015
    Posts
    16

    Question Question About anisotropic_vdf and "Material volume"

    Happy new year, and Thanks nvidia offer MDL hand books, then I can still learning iray MDL when I need.
    I think, "anisotropic_vdf" is shader function to get volume effect, or kind of SSS .
    I can not still find correct manner to write MDL code about anisotropic_vdf because I can not find what parameter actually this shader have in MDL handbook., and how work. (So I hope next MDL handbook, there should be clear guide about this function Usage,,but by daz studio shader mixer, I can make custom shader with each MDL component. and it is almost same as writing MDL I think.(So I suppose daz already offer most of MDL modules, functions and components as nodes) compare with MDL introduction guide.

    Then I have some basic question about this function.

    1 Base transmission color

    to use antisotropic_vdf for volume transmit or SSS things, the material> surface must need to set BSDF with transmit first?
    eg, we may use "diffuse transmission BSDF" for skin SSS effect, or we may use "glossy BSDF" with "scatter and transmission" mode for volumetric effect, then use antisotropic_vdf for volume of the material structure?

    Why I asked it, about other render engine (and language,,) usually I could separate SSS effect with other shader parameter.
    eg I may not need to set diffuse transmisison shader,or refraction shader, but just set SSS shaders or volume transmit shaders
    with individual parameters which offered. then later mix with others.

    but About MDL anisotropic_vdf, I feel I must need to set dffuse transmisison or some refraction for surface frist, then the transmission (reflaction) color seems set as SSS or volume ,scatter and transmission base color. is it right?

    DAZ offer custom "uber iray shader", then I often feel difficulity to set SSS with DAZ named parameters, because SSS for skin effect need to mix use with diffuse>translucency color and weight, with options, how base color effect transmssion but daz never offer clear guide how circulate each parameter values with options for basic users. then I hope to make custom SSS shader which can easy mix use with base shader, without many trying and erroer of DAZ custom SSS parameters.

    2 Parameters of Anisotropic VDF and Material volume

    from nvidia document, and DAZ shader mixer nodes, I can find parameters Material struct> volume
    "ior", "Absorption Coefficent", "Scattering Coefficent". then Anisotropic VDF will be connected for surface volume >scattering
    Anisotropic VDF have only one parameter "Directional bias"

    two Coefficent (color 3) values seems length value, each RGB component may scatter or absorbed ?
    because about daz studio shader mixer,
    I need to set those vector value, out of color value limit (min 0 to max 1.0) . if it is "rength" (or radius) the unit is decided by daz studio? if so "Absorption Coefficient" = ( 30, 0.2, 1 means, current surface transmitted color, R may absorbed within 30 cm
    with direction which dicided by "Directional bias"? And "Directional bias" effect for not only scatter but also absorbed direction?

    3 Usage of "df>clamped mix VDF" components.

    I hope to divide absorbed color, and scatter color which can work individually.
    But I can only find "Directional bias" parameter for "Anisotropic VDF", that means I can change direction of effect for 2 VDF
    and mix them with weight. but it never means I can divide "scatter" and "transmit" color for volume.

    So this clamped mix component only use for mix VDF which use different "Directional vias"
    then to divide Volume scatter and absorption, need to make 2 matrial structure, which use 2 different volume setting,
    and it is correspond to my first question. so make Volume shader (or SSS shader) then set Scatter color and transmit color,
    we must set BSDF transmisison, and the transmisison color (or refraction color) decide Volume color too?

    (so if I hope to divide SSS effect color from diffuse >translucency, I need to make another Material which only use perfect white diffuse transmisison with anisotropic_vdf with volume), then mix with base Material by weight?

  2. #2
    Join Date
    Jan 2007
    Posts
    314

    Default

    Dear waitinfutuer19,

    happy new year to you too!

    Quote Originally Posted by waitinfutuer19 View Post
    Happy new year, and Thanks nvidia offer MDL hand books, then I can still learning iray MDL when I need.
    I think, "anisotropic_vdf" is shader function to get volume effect, or kind of SSS .
    I can not still find correct manner to write MDL code about anisotropic_vdf because I can not find what parameter actually this shader have in MDL handbook., and how work. (So I hope next MDL handbook, there should be clear guide about this function Usage,,but by daz studio shader mixer, I can make custom shader with each MDL component. and it is almost same as writing MDL I think.(So I suppose daz already offer most of MDL modules, functions and components as nodes) compare with MDL introduction guide.

    Then I have some basic question about this function.

    1 Base transmission color

    to use antisotropic_vdf for volume transmit or SSS things, the material> surface must need to set BSDF with transmit first?
    eg, we may use "diffuse transmission BSDF" for skin SSS effect, or we may use "glossy BSDF" with "scatter and transmission" mode for volumetric effect, then use antisotropic_vdf for volume of the material structure?
    Yes. MDL and iray are completely physically based which means SSS is not just "composited" onto the rendering but the path of every "light particle" is simulated. in order to have scattering in the volume the light needs to enter the volume. A transmissive bsdf allows light to enter the volume. Fore dense materials like skin, i would recommend the diffuse transmission for rendering efficiency reasons. A basic skin material i posted in here:

    https://forum.nvidia-arc.com/showthr...3044#post63044

    Quote Originally Posted by waitinfutuer19 View Post
    Why I asked it, about other render engine (and language,,) usually I could separate SSS effect with other shader parameter.
    eg I may not need to set diffuse transmisison shader,or refraction shader, but just set SSS shaders or volume transmit shaders
    with individual parameters which offered. then later mix with others.

    but About MDL anisotropic_vdf, I feel I must need to set dffuse transmisison or some refraction for surface frist, then the transmission (reflaction) color seems set as SSS or volume ,scatter and transmission base color. is it right?
    there are 3 colors affecting the color of light going through the volume in the sss case:

    1. tint of the transmitting bsdf this will filter the light at the moment it enters the volume

    2. absorption coefficient, this is a probability that the light is absorbed during its travel through the volume. Like the scattering coefficient, the absorption coefficient is not a regular rgb color and often i use a "color at distance" formula to make it more artist friendly:

    coefficient = math::log(color) / -distance

    The longer the path of light through the more light is absorbed. with above formula we can compute the absorption coefficient such that after traveling *distance* through the material, all but *color* is absorbed. At double the distance all but color*color is absorbed and so on.

    3. scattering coefficient" this is probably the hardest to get used to. It describes the probability that light changes its course in the volume (is scattered, this is what really is sss) It does not just change the color but rather defines what color is more likely to get through (for skin you want this to be red ) and what color is more likely to be scattered back at you.

    1 is the basic color and is wat you need to texture. 2 and 3 need to be balanced (which is what is hard)


    Quote Originally Posted by waitinfutuer19 View Post
    DAZ offer custom "uber iray shader", then I often feel difficulity to set SSS with DAZ named parameters, because SSS for skin effect need to mix use with diffuse>translucency color and weight, with options, how base color effect transmssion but daz never offer clear guide how circulate each parameter values with options for basic users. then I hope to make custom SSS shader which can easy mix use with base shader, without many trying and erroer of DAZ custom SSS parameters.

    2 Parameters of Anisotropic VDF and Material volume

    from nvidia document, and DAZ shader mixer nodes, I can find parameters Material struct> volume
    "ior", "Absorption Coefficent", "Scattering Coefficent". then Anisotropic VDF will be connected for surface volume >scattering
    Anisotropic VDF have only one parameter "Directional bias"

    two Coefficent (color 3) values seems length value, each RGB component may scatter or absorbed ?
    because about daz studio shader mixer,
    I need to set those vector value, out of color value limit (min 0 to max 1.0) . if it is "rength" (or radius) the unit is decided by daz studio? if so "Absorption Coefficient" = ( 30, 0.2, 1 means, current surface transmitted color, R may absorbed within 30 cm
    with direction which dicided by "Directional bias"? And "Directional bias" effect for not only scatter but also absorbed direction?
    the coefficient are like i said before "probability density per meter" and for artist friendliness you should use the above formula.

    The scattering coefficient describes *how likely* a photon changes its course. If that happens, the vdf describes *how* the photon changes its path. If "directional bias" is 0, the photon might change in any direction with equal probability, forward, backward, right left up, down or anything between. If directional bias is <0, the photon is more likely to be scattered back to where it came from. If its >0 its more likely to travel in a similar path as before with. In general, "directional bias" is would recommend to leave around 0.

    Quote Originally Posted by waitinfutuer19 View Post
    3 Usage of "df>clamped mix VDF" components.

    I hope to divide absorbed color, and scatter color which can work individually.
    But I can only find "Directional bias" parameter for "Anisotropic VDF", that means I can change direction of effect for 2 VDF
    and mix them with weight. but it never means I can divide "scatter" and "transmit" color for volume.

    So this clamped mix component only use for mix VDF which use different "Directional vias"
    then to divide Volume scatter and absorption, need to make 2 matrial structure, which use 2 different volume setting,
    and it is correspond to my first question. so make Volume shader (or SSS shader) then set Scatter color and transmit color,
    we must set BSDF transmisison, and the transmisison color (or refraction color) decide Volume color too?

    (so if I hope to divide SSS effect color from diffuse >translucency, I need to make another Material which only use perfect white diffuse transmisison with anisotropic_vdf with volume), then mix with base Material by weight?
    hmmm. i am not sure i completely follow, but mixing vdf is separate from coloring. In this aspect a vdf is different from a bsdf, the color is not a part of the df but defined through absorption and scattering. Also just "mixing" things in is not working in a physical based renderer, all the parts of a material interact. the ior for example will change the reflection and refraction, but since a different amount of light enters the volume at a different angle, sss will also change.
    Jan

  3. #3
    Join Date
    Oct 2015
    Posts
    16

    Default

    Very thanks kindly teach many things. JanJordan you are great teacher for me

    Then I had believed, I must need to use "Anisotropic VDF" (as SSS shader or volume shader) ,
    but with reading your answer, and MDL handbook, as basic I may need not set Anitoropic VDF, if i have no plan to make complex SSS which can change photon direction probabllity) ?
    If I set ior, and set 2 values (absorption coefficient, scatter coefficient) for material volume, MDL use default value for vdf scattering, that means it use simple VDF ,
    with transmit (or refraction) BSDF for surface , it may show usuall SSS (volume) effect?

    And this is last question , usually I use "SSS" strength value, or SSS scale value, to mix SSS (volume) effect about other shader language,, with base shader.
    I like simple way to adjust SSS effect with clear stregnth value.

    then about iray, it have not such parameter, but offer material volume property (Absorption Coefficent, "Scattering Coefficent")
    these 2 values may use to set SSS strength value as user parameter , if I hope so?

    eg I may add " SSS absorption strength" or "SSS absorption scale" as "user parameter", then set value as 0, It set absorption Coefficient as (0, 0, 0) , then the volume may not show any SSS absorption?
    and If I make "strength value" multilped with each R,G,B component of absorption, the strength value can use to adjust SSS absroption, from 0 to max 1 ?
    I simply plan, when the strength value = 1, the material show "full or default absorption effect " with the absorption coefficient value , which I set as default value?

  4. #4
    Join Date
    Jan 2007
    Posts
    314

    Default

    Quote Originally Posted by waitinfutuer19 View Post
    Very thanks kindly teach many things. JanJordan you are great teacher for me

    Then I had believed, I must need to use "Anisotropic VDF" (as SSS shader or volume shader) ,
    but with reading your answer, and MDL handbook, as basic I may need not set Anitoropic VDF, if i have no plan to make complex SSS which can change photon direction probabllity) ?
    If I set ior, and set 2 values (absorption coefficient, scatter coefficient) for material volume, MDL use default value for vdf scattering, that means it use simple VDF ,
    with transmit (or refraction) BSDF for surface , it may show usuall SSS (volume) effect?
    correct, no VDF is the equivalent to anisotropic VDF with directional bias 0

    Quote Originally Posted by waitinfutuer19 View Post
    And this is last question , usually I use "SSS" strength value, or SSS scale value, to mix SSS (volume) effect about other shader language,, with base shader.
    I like simple way to adjust SSS effect with clear stregnth value.

    then about iray, it have not such parameter, but offer material volume property (Absorption Coefficent, "Scattering Coefficent")
    these 2 values may use to set SSS strength value as user parameter , if I hope so?

    eg I may add " SSS absorption strength" or "SSS absorption scale" as "user parameter", then set value as 0, It set absorption Coefficient as (0, 0, 0) , then the volume may not show any SSS absorption?
    and If I make "strength value" multilped with each R,G,B component of absorption, the strength value can use to adjust SSS absroption, from 0 to max 1 ?
    I simply plan, when the strength value = 1, the material show "full or default absorption effect " with the absorption coefficient value , which I set as default value?
    The question is what should be the effect of "sss strength"?

    a. add sss to an opaque object, then i would vlend between a diffuse reflection (no sss) and a transmissive bsdf (full sss)

    b. 0 means clear object and 1 meens full sss . the problem here is to define what "full sss means" Physically the range is 0-infinity because the visual effect of sss is size dependent. exmple:




    both stones are the same material (emerald) but look pretty different just because of their size. They roughly have the same absorption and scattering coefficients. sss and volumetric absorption will only feel natural if you take the size into account. Thats why i proposed
    coefficient = math::log(tint) / -distance

    as a possible transformation. If you want to create for example a material for gemstones you know that the typical size of such a stone is probably in the cm/inch range. Therefor your formula for scattering could look like this:

    scattering_coefficient = math::log(color(scattering_strength))/-0.01

    and for volume absorption it could like
    absorption_coefficient = math::log( absorption_color*(1.-absorption_strength) )/-0.01


    the log is important to transform the parameter into the 0-1 range. The better the object matches the size, the more natural the parameter feels. I could imagine other formulas to transform a value of the 0-1 range into a valid absorption_coefficient, but i am not sure it would feel good. A quick untested idea would be
    absorption_coefficient = color( math::lerp(max_scattering,min_scattering,scatterin g_strength) )

  5. #5
    Join Date
    Oct 2015
    Posts
    16

    Default

    yes you are right, finally I could understand why I can not use simple multiple way, for the purpose, thank you!!!!!

    and checked again, the formula of log, I could understand most of meaning.

    But I still have one simple question about "math::log" , I could find MDL spec document it discribe, the log base is "natural logarithm"
    I think, the "base" is "e", is it right?

    Then about the fromula ,< coefficient = math::log(color) / -distance>
    The user parameter "color" is "absorbed color" value of the "point" from "transmit color" ? or "color" is remainder color of the point (distance from the surface) (so those two are almost reverse meaning)

    Just for purpose to understand formula,
    I hoped to change formula, color = f(distance, coefficient). Then color = e power (-dsitance * coefficient)
    or I can change, color = 1/e power (distance*coefficient) (power is not MDLcode just discribe for typing)

    Then I confuse which color means. the "color" is "color" of the point, or "absorbed color" of the point ( circulate by distance from the sruface) I understand, I need not change formula, but it change meaning of "coefficient" too. to set "color" then I asked.

  6. #6
    Join Date
    Oct 2015
    Posts
    16

    Default

    So I hope to clear what I ask is as image
    I almost understand the "absorption coefficient”  "probability" with another graph
    but just hope to confirm, the color value represent is 1 or 2. thanks (and really thanks you offer skin shader file for learning purpose,,)

    Click image for larger version. 

Name:	absorb.jpeg 
Views:	17 
Size:	67.9 KB 
ID:	10010

  7. #7
    Join Date
    Jan 2007
    Posts
    314

    Default

    Quote Originally Posted by waitinfutuer19 View Post
    yes you are right, finally I could understand why I can not use simple multiple way, for the purpose, thank you!!!!!

    and checked again, the formula of log, I could understand most of meaning.

    But I still have one simple question about "math::log" , I could find MDL spec document it discribe, the log base is "natural logarithm"
    I think, the "base" is "e", is it right?

    Then about the fromula ,< coefficient = math::log(color) / -distance>
    The user parameter "color" is "absorbed color" value of the "point" from "transmit color" ? or "color" is remainder color of the point (distance from the surface) (so those two are almost reverse meaning)

    yes its the natural logarithm. http://minfo.mi.nvidia.com/md/mdl_spec/MDL_spec.pdf page 96

    if:
    absorption_coefficient = math::log(color) / -distance
    then "color" means the remaining color after the light traveled "distance" through your volume. i.e.
    if color = color(1.,1.,1.) the glass will be clear and absorb no light
    if color = color(.2,.9,.2) then the glass will be green.

    Quote Originally Posted by waitinfutuer19 View Post
    Just for purpose to understand formula,
    I hoped to change formula, color = f(distance, coefficient). Then color = e power (-dsitance * coefficient)
    or I can change, color = 1/e power (distance*coefficient) (power is not MDLcode just discribe for typing)

    Then I confuse which color means. the "color" is "color" of the point, or "absorbed color" of the point ( circulate by distance from the sruface) I understand, I need not change formula, but it change meaning of "coefficient" too. to set "color" then I asked.
    This part i do not understand you want to compute the resulting color of a object for a given absorption coefficient and travel distance?

  8. #8
    Join Date
    Jan 2007
    Posts
    314

    Default

    its the option 2

  9. #9
    Join Date
    Oct 2015
    Posts
    16

    Default

    Quote Originally Posted by JanJordan View Post
    its the option 2
    Thanks! Yes I convert formula for easy check how color value change with "distance and Coefficient value"
    (I seldom use "log" function then needed to convert function to imagine how each value work)

    Thank you for many detail answer politely with simple words which I can understand

  10. #10
    Join Date
    Oct 2015
    Posts
    16

    Default

    I planed to make another topic, but it is still things about iray volume. Then hope modelator still check this question

    After kind lecture of JanJordan's , I could understand mostly about iray volume absorption.and customized formula meaning.
    but I can not still understand clear, about "scattering" , and the scattering coefficient .

    I know I could use same " -log(e,color)/distance" which iray developer seems recommend for user as easy set volume parameter,
    and daz uber iray use same formula with "chromatic mode", to get "scattering coefficient" of the material volume
    as same as "absorption coefficient" value.

    the problem is, even though I can set scattering coefficient value by customized parameter,
    I still can not imagine well how actually it work as visible effect. about absorption, it seems easy for me.

    to think simple, I concenterate about values of "distance", and "color" after all ,these two user parameter values decide "scattering coefficient" of volume. as uiform value.
    then I hope to know, how we can think, "color" and "distance" effect for final render color?

    eg,, if I set distance as iray unit, 1.00, then set "color" as (0.5, 1, 1), how I can explain the effect?
    to think it easy, I set all translucency color is (1, 1, 1) for material, then remove reflection.

    so all light color component transmit (not filtered) (as skin diffusive transmisison)

    The "distance" is where we hope to "set color" from "hit point" I think.
    usually about skin, I may suppose to set it in range (0.01 to 0.05) (1cm to 5 cm) , then I set distance 0.05.
    I can imagin scatter " color" (R,G,B), but can no imagin, how it take count as visible rendered color,,,
    so if I set "color" (user parameter for scatter, ) as "0.5, 1, 1", what I will see on the point (set as distance 0.05)?

    I feel, I ask silly question, but hope to get clear imaginable way, to decide scatter parameter for my material volume,,
    (and I already set MDL , and compare with each value in ds shader mixer, and by MDL code too, with compare log X graph ^^;
    but I think I lost good imagination to think it reasonable for me,,
    then hope if jordan can teach me again, how think scatter effect ,, and sorry I know jordan already guide about scattering,
    but I can not still get clear imagination,,, actually how scatter work..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •