Results 1 to 9 of 9

Thread: LPE Light Path Expression

  1. #1
    Join Date
    Feb 2020
    Posts
    14

    Default LPE Light Path Expression

    hi all,

    What is the formula that is implemented in the engine for Rhino? How can we manage it for example the light absorption value of a glass?
    which "float" values correspond to the percentage values?

    ex:
    Absorption color RVB 128-128-128
    Absoprtion value: 0,5

    absorption = 50% or not?

    thanks

    Click image for larger version. 

Name:	Sans titre.jpg 
Views:	8 
Size:	124.4 KB 
ID:	10845
    Last edited by frédéric; 10th March, 2020 at 10:37.

  2. #2
    Join Date
    Feb 2020
    Posts
    14

    Default

    exemple:

    Click image for larger version. 

Name:	Sans titre2.jpg 
Views:	9 
Size:	204.1 KB 
ID:	10846

  3. #3
    Join Date
    Dec 2017
    Location
    Melbourne, Australia
    Posts
    343

    Default

    Firstly, it looks like you are using a custom MDL material, so the interpretation of this value will entirely depend on the implementation of the material_volume() part.

    However I think your main issue is you are specifying the colour in the user interface which uses sRGB, however when used internally these values are converted to linear colour space. To get these values you need to reverse the gamma correction applied in the sRGB values. As a result 128/128/128 is more like 0.216 than the 0.5 you are currently assuming.

  4. #4
    Join Date
    Feb 2020
    Posts
    14

    Default

    Quote Originally Posted by Paul View Post
    Firstly, it looks like you are using a custom MDL material, so the interpretation of this value will entirely depend on the implementation of the material_volume() part.

    However I think your main issue is you are specifying the colour in the user interface which uses sRGB, however when used internally these values are converted to linear colour space. To get these values you need to reverse the gamma correction applied in the sRGB values. As a result 128/128/128 is more like 0.216 than the 0.5 you are currently assuming.
    Hi Paul,

    Yes I am using an example of transparent materials from Substance Designer. We can see that the color and the absorption value are connected to the absorption component of the volume, how do the color and the value work together?
    Do you have a work reference or linear space conversation calculations to sRGB?

    [EDIT]:
    I do not use the Abbe number to characterize the glazing that I want to reproduce.

    thanks

    Click image for larger version. 

Name:	MDL.jpg 
Views:	9 
Size:	101.9 KB 
ID:	10847
    Last edited by frédéric; 10th March, 2020 at 11:47.

  5. #5
    Join Date
    Dec 2017
    Location
    Melbourne, Australia
    Posts
    343

    Default

    How they work together is being determined by Substance designer and its volume absorption function, not Iray for Rhino so you'd need to look at the MDL files it outputs to see what is happening. I took a look at their core MDL file and it has this:

    Code:
    export color volume_absorption(
    
        uniform float absorption = float(0) [[
            anno::display_name("Volume Absorption"),
            anno::description("Controls how much light is absorbed through the surface"),
            anno::hard_range(0.0,1000.0),
            anno::soft_range(0.0,1.0)
        ]],
    
        uniform color absorptionColor = color(1) [[
            anno::display_name("Absorption Color"),
            anno::description("Simulates shifts in color when light passes through the surface")
        ]]
    
    ) [[
        anno::display_name("Absorption"),
        anno::description("Provides an absorption coefficient for the volume"),
        anno::author(ALLEGORITHMIC_AUTHOR),
        anno::copyright_notice(ALLEGORITHMIC_COPYRIGHT),
        anno::version(6,0,1,"")
    ]] {
        return (absorption>0)? -math::log(clamp(absorptionColor, color(0.01), color(0.99)))*absorption*100.0 : color(0);
    }
    So this is how it is combining the colour and value together.

  6. #6
    Join Date
    Feb 2020
    Posts
    14

    Default

    Hi Paul,

    I'm going to look at that and when it comes to the combination of color and value that's what I thought but it's hard to understand. I come back to you Paul and thank you again for your quick and relevant answers.

    have a nice day

  7. #7
    Join Date
    Feb 2020
    Posts
    14

    Default

    ok,

    Why the difference to export MDL or MDL preset? The correct code seems to be the one found when you export the file as a preset?

    Click image for larger version. 

Name:	MDL_presetornot.jpg 
Views:	7 
Size:	733.3 KB 
ID:	10848

  8. #8
    Join Date
    Dec 2017
    Location
    Melbourne, Australia
    Posts
    343

    Default

    That would be more a Substance Designer question, however I assume in the case of the preset they are including everything needed within the one file.

  9. #9
    Join Date
    Feb 2020
    Posts
    14

    Default

    alright I'll ask Substance the question

    thanks Paul

Posting Permissions

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