Results 1 to 3 of 3

Thread: So IRAY CANT Really MIX TWO or more MATERIALS VOLUMES ?

  1. #1
    Join Date
    Aug 2016
    Posts
    23

    Lightbulb So IRAY CANT Really MIX TWO or more MATERIALS VOLUMES ?






    HI EVERYONE !

    This is a Topic that IF I COULD I would TAKE TO SIGGRAPH 2017 !

    This Should be Obvious ...

    MDL HANDBOOK There is The Usual Method of Combining Materials Surfaces ( But Not Volumetric Surfaces ) At all ...



    Chapter 4 Combining distribution functions

    http://www.mdlhandbook.com/mdl_handbook/index.html


    ITS ALL GOOD ! But that is Just SURFACES Bsdfs Combining ...

    ---

    SO WHY THE HECK ! CANT WE COMBINE ALSO full SURFACES + VOLUMES MATERIALS IN IRAY !!

    As if we OVERLAY 2 MATERIALS With Any Combining Materials Function ...

    No matter what !
    ONLY the Base Volume Definitions Are Passed Trough !
    And there is NEVER in IRAY a Way to COmbine 2 Full Materials Properties with Surface and Volume ...

    Like in Every other Rendering EVen physically based unbiased Engine we CAN ...

    IN IRAY WE TRIED IN EVERY WAYS TO FAKE IT ... TO HACK IT !

    BUT THERE IS NO WAY WE HERE FOR MONTHS CAN FIND
    ON HOW TO SIMPLY PROPERLY COMBINE 2 MATERIALS
    WITH 2 SCATTERING/ABSORPTION COLOR & DEEP DIFFERENT VOLUMES VALUES !

    And we tried to Overcome this ...
    By Mixing All BSDFS Properties Betwen Materials Layers ...

    But .. There is no way ... its Simply Absurd ... we can find in IRAY on how to do this of MIXING VOLUMES !
    LESS WE ACTUALLY NEEDING TO HAVE 2 Duplicated GEOMETRIES WITH 2 DIFERENT VOLUMETRIC MATERIALS !

    ----

    PLEASE SOMEONE ENLIGHT US ...

    And Tell us THERE IS A WAY ...

    to Mix 2 Materials Volumes in IRAY ...

    ---

    As we must been doing something Wrong ... Or maibe is a BUG ? lol ...

    As There is REALLY ? No WAY The All Might IRAY can do this ??

    -----------

    So lets Stop with Teories and
    GO DOWN TO CODES ...

    HERE IS A EXAMPLE !




    We have a SIMPLE MATERIAL ...
    Simple Diffuse Transmission ..

    With Value 1 And Green color On Absorption
    And Value 200 and White Color on Scattering


    MAT 1 CODE

    Code:
    mdl 1.3;
    
    import ::anno::*;
    
    import ::anno::author;
    import ::anno::copyright_notice;
    import ::anno::description;
    import ::anno::display_name;
    import ::anno::unused;
    import ::df::diffuse_transmission_bsdf;
    import ::state::normal;
    
    using math import *;
    using limits import *;
    
    import ::math::log;
    
    
    
    export color volume(
    
        uniform float absorption = float(0) [[
            anno::display_name("Volume Absorption")
        ]],
    
        uniform color absorptionColor = color(1) [[
            anno::display_name("Absorption Color")
        ]]
    
    ) [[
        anno::display_name("Absorption")
    ]] {
        return (absorption>0)? -math::log(clamp(absorptionColor, color(0.01), color(0.99)))*absorption*100.0 : color(0);
    }
    
    
    
    export material GREEN_Material()
     = 
        let {
            bool tmp0 = false;
            material_surface tmp1(
                ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""),
                material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
            material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
            color tmp3 = color(1.f, 1.f, 1.f);
            material_volume tmp4(
                vdf(),
                volume(1.f, color(0.f, 0.34851f, 0.018215f)),
                volume(200.f, color(1.f, 1.f, 1.f)));
            material_geometry tmp5(
                float3(0.f),
                1.f,
                ::state::normal());
        } in
            material(
                thin_walled: tmp0,
                surface: tmp1,
                backface: tmp2,
                ior: tmp3,
                volume: tmp4,
                geometry: tmp5);
    AND WE HAVE A SECOUND MATERIAL ..

    That as you SEE its VERY Diferent on SCATERING & ABSORTION Behaviours !



    A BLUE ONE with Diferent Scatering VAlues !
    .
    Simple Diffuse Transmission ..

    With Value 2 And Blue color On Absorption
    And Value 1 and White Color on Scattering


    Code:
    mdl 1.3;
    
    import ::anno::*;
    
    import ::anno::author;
    import ::anno::copyright_notice;
    import ::anno::description;
    import ::anno::display_name;
    import ::anno::unused;
    import ::df::diffuse_transmission_bsdf;
    import ::state::normal;
    
    
    using math import *;
    using limits import *;
    
    import ::math::log;
    
    
    
    export color volume(
    
        uniform float absorption = float(0) [[
            anno::display_name("Volume Absorption")
        ]],
    
        uniform color absorptionColor = color(1) [[
            anno::display_name("Absorption Color")
        ]]
    
    ) [[
        anno::display_name("Absorption")
    ]] {
        return (absorption>0)? -math::log(clamp(absorptionColor, color(0.01), color(0.99)))*absorption*100.0 : color(0);
    }
    
    
    
    
    export material BLUE_Material()
     = 
        let {
            bool tmp0 = false;
            material_surface tmp1(
                ::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""),
                material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
            material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
            color tmp3 = color(1.f, 1.f, 1.f);
            material_volume tmp4(
                vdf(),
                volume(2.f, color(0.f, 0.001027f, 0.522522f)),
                volume(1.f, color(1.f, 1.f, 1.f)));
            material_geometry tmp5(
                float3(0.f),
                1.f,
                ::state::normal());
        } in
            material(
                thin_walled: tmp0,
                surface: tmp1,
                backface: tmp2,
                ior: tmp3,
                volume: tmp4,
                geometry: tmp5);
    NOW WE WANT AND DESPERATELY NEED TO MIX / OVERLAY THIS 2 SIMPLE MATERIALS VOLUMES !!

    WITH A SIMPLE BITMAP MASK !



    AND WE CANT FIND A SINGLE WAY OF DOING THIS !

    And for this Example we Had to do it in PHOTOSHOP !!

    BECAUSE IRAY CANT !!?
    Mix Material volumes ...

    Lol ...




    We Tried Every Way With Every BLEND, LAYER, MIX, CUSTOM CURVES ...

    ANd there is NO way of Simply Doing this that we can find ...

    ...

    Here is a Code TRY To mix Those Two Material Volumes ...
    With a Simple OVERLAY Weighted Layer ...

    Code:
    mdl 1.3;
    
    import ::tex::*;
    import ::anno::*;
    
    import ::anno::author;
    import ::anno::copyright_notice;
    import ::anno::description;
    import ::anno::display_name;
    import ::anno::unused;
    import ::base::file_texture;
    import ::base::mono_mode;
    import ::base::texture_coordinate_info;
    import ::base::texture_return;
    import ::df::diffuse_transmission_bsdf;
    import ::state::normal;
    import ::state::texture_coordinate;
    import ::state::texture_tangent_u;
    import ::state::texture_tangent_v;
    import ::tex::gamma_mode;
    import ::tex::wrap_mode;
    import ::df::weighted_layer;
    
    
    using math import *;
    using limits import *;
    
    import ::math::log;
    
    
    
    color volume(
    
        uniform float absorption = float(0) [[
            anno::display_name("Volume Deep")
        ]],
    
        uniform color absorptionColor = color(1) [[
            anno::display_name("Volume Color")
        ]]
    
    ) [[
        anno::display_name("Volume")
    ]] {
        return (absorption>0)? -math::log(clamp(absorptionColor, color(0.01), color(0.99)))*absorption*100.0 : color(0);
    }
    
    
    
    
    material add_weighted_layer(
        material layer = material()
        [[
            anno::display_name("Layer")
        ]],
        float weight = 1.0
        [[
            anno::display_name("Layer Weight"),
            anno::hard_range(0.0, 1.0)
        ]],
        material base = material()
        [[
            anno::display_name("Base")
        ]],
        float3 normal = state::normal()
        [[
            anno::display_name("Layer Bump")
        ]],
        uniform bool assign_layer_geometry_normal_to_layer_normal = true,
        uniform bool layer_surface_enable = true,
        uniform bool layer_backface_enable = true
    ) = material (
        thin_walled : base.thin_walled,
        surface : material_surface(
            scattering : layer_surface_enable ?
                df::weighted_layer(
                    weight: weight,
                    layer: layer.surface.scattering,
                    base: base.surface.scattering,
                    normal: assign_layer_geometry_normal_to_layer_normal ?
                        layer.geometry.normal
                        : normal
                )
                : base.surface.scattering,
            emission : base.surface.emission
        ),
        backface : material_surface(
            scattering : layer_backface_enable ?
                df::weighted_layer(
                    weight: weight,
                    layer: layer.backface.scattering,
                    base: base.backface.scattering,
                    normal: assign_layer_geometry_normal_to_layer_normal ?
                        layer.geometry.normal
                        : normal
                )
                : base.backface.scattering,
            emission : base.backface.emission
        ),
        ior : base.ior,
        volume : base.volume,
        geometry : base.geometry
    );
    
    
    
    
    
    
    
    
    
    
    export material MDL_Material(
        uniform float MAT_BLUE_IOR = 1.f [[
            ::anno::display_name("MAT BLUE IOR"),
            ::anno::in_group("MAT BLUE")
        ]],
        uniform texture_2d MATERIAL_MIX_texture = texture_2d("./4000PX_CHECKER_SHARP.jpg", ::tex::gamma_default) [[
            ::anno::description("The input texture"),
            ::anno::display_name("MATERIAL MIX texture"),
            ::anno::in_group("MATERIAL MIX")
        ]],
        uniform float MAT_BLUE_ABSORTION_DEEP = 2.f [[
            ::anno::display_name("MAT BLUE ABSORTION DEEP"),
            ::anno::in_group("MAT BLUE")
        ]],
        uniform color MAT_BLUE_ABSORTION_COLOR = color(0.f, 0.001027f, 0.522522f) [[
            ::anno::display_name("MAT BLUE ABSORTION COLOR"),
            ::anno::in_group("MAT BLUE")
        ]],
        uniform float MAT_GREEN_ABSORTION_DEEP = 1.f [[
            ::anno::display_name("MAT GREEN ABSORTION DEEP"),
            ::anno::in_group("MAT GREEN")
        ]],
        uniform float MAT_BLUE_SCATERING_DEEP = 1.f [[
            ::anno::display_name("MAT BLUE SCATERING DEEP"),
            ::anno::in_group("MAT BLUE")
        ]],
        uniform float MAT_GREEN_SCATERING_DEEP = 200.f [[
            ::anno::display_name("MAT GREEN SCATERING DEEP"),
            ::anno::in_group("MAT GREEN")
        ]],
        uniform color MAT_GREEN_ABSORTION_COLOR = color(0.f, 0.34851f, 0.018215f) [[
            ::anno::display_name("MAT GREEN ABSORTION COLOR"),
            ::anno::in_group("MAT GREEN")
        ]],
        uniform color MAT_BLUE_SCATERING_COLOR = color(1.f, 1.f, 1.f) [[
            ::anno::display_name("MAT BLUE SCATERING COLOR"),
            ::anno::in_group("MAT BLUE")
        ]],
        uniform float MAT_GREEN_IOR = 1.f [[
            ::anno::display_name("MAT GREEN OR"),
            ::anno::in_group("MAT GREEN")
        ]],
        uniform color MAT_GREEN_SCATERING_COLOR = color(1.f, 1.f, 1.f) [[
            ::anno::display_name("MAT GREEN SCATERING COLOR"),
            ::anno::in_group("MAT GREEN")
        ]])
     = 
        let {
            material tmp0(
                thin_walled: false,
                surface: material_surface(::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)),
                backface: material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)),
                ior: color(MAT_BLUE_IOR),
                volume: material_volume(vdf(), volume(MAT_BLUE_ABSORTION_DEEP, MAT_BLUE_ABSORTION_COLOR), volume(MAT_BLUE_SCATERING_DEEP, MAT_BLUE_SCATERING_COLOR)),
                geometry: material_geometry(float3(0.f), 1.f, ::state::normal()));
            float tmp1 = ::base::file_texture(MATERIAL_MIX_texture, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono;
            material tmp2(
                thin_walled: false,
                surface: material_surface(::df::diffuse_transmission_bsdf(color(1.f, 1.f, 1.f), ""), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)),
                backface: material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)),
                ior: color(MAT_GREEN_IOR),
                volume: material_volume(vdf(), volume(MAT_GREEN_ABSORTION_DEEP, MAT_GREEN_ABSORTION_COLOR), volume(MAT_GREEN_SCATERING_DEEP, MAT_GREEN_SCATERING_COLOR)),
                geometry: material_geometry(float3(0.f), 1.f, ::state::normal()));
            float3 tmp3 = ::state::normal();
            bool tmp4 = true;
            bool tmp5 = true;
            bool tmp6 = true;
        } in
            add_weighted_layer(
                layer: tmp0,
                weight: tmp1,
                base: tmp2,
                normal: tmp3,
                assign_layer_geometry_normal_to_layer_normal: tmp4,
                layer_surface_enable: tmp5,
                layer_backface_enable: tmp6);
    We tried Hundreds Ways During the Couple 2 Years ...
    ( Always thinking that "no It should be OUR fault" We should be doing something wrong ... )
    Or maibe is Just a "Optical ilusion" ... We Just Could not Believe it !

    But SImply NO ! There is no Freaking way we can find
    TO SImple Mix VOLUMES Scatering & Absortion in IRAY .
    BE with Just FLOATS or Much Less with COLOR MAPS ...

    Mixing Materials ! In IRAY Always Assume the BASE material VOLUME Values ...
    And we Simple Canot Blend / Overlay / Or Mix Volumes ?

    Is this Right ?

    IRAY just Can NOt Do it ?

    We Just Cant Have Several Scattering Materials Overlays ??

    IS THIS A IRAY LIMITATION ??

    EACH MATERIAL / NO MATTER HOW MANY MATERIALS YOU TRY TO OVERLAY ...
    IN IRAY WE CANOT MIX OR OVERLAY MATERIAL VOLUMES WE CAN ONLY HAVE 1 BASE VOLUME ?

    Unless we Of course ... Duplicate the Geometry and Scale it down to make REAL VOLUME MATERIAL LAYERS ?

    ...

    OK SO THIS IS OCTANE RENDER ! AND A 5 SHADERS OVERLAY SOLUTION FOR SKIN SCATERING ...



    AND HERE THE NODES



    AND AS YOU CAN SEE ! EACH MATERIAL HAS ITS OWN INDEPENDENT "MEDIUM" SCATERING ABSORTION ...
    And THEY PROPERLY MIX As VOLUME MATERIALS SHOULD MIX

    ...

    NOW IN IRAY " WE " JUST CANT DO THE SAME ! NO MATTER WHAT !

    NOW IMAGINE THAT WE HAVE TO ASK OUR CUSTOMERS ...
    To Duplicate the Geometry of Their Characters 4 TIMES ...
    And Apply 4 SHaders ! To Each Geometry !

    JUST TO HAVE SAME RESULT AS IN OCTANE ...

    ( Isnt that Ridiculous ? But is what in IRAY MDL is Happening ! )

    And for 2 Years we been trying to Hack Someway Out of it !
    And we did ask help ... at some point ! No one could answer us ...

    And we been always "embarassed" to deal with this " Iray Materials Volume Overlays Problem" Because its RIDICULOUS !

    When we OVERLAY ENTIRE MATERIALS, We Should Overlay Complete Functions of it ! SURFACE & VOLUME Mediuns Should mix !
    And we CAN do that In Every Renderer Even in Game Engines ! WHY not in IRAY ?

    We Been asking Severall Companies that work with MDL ...
    As ALegorithmic Staff And Daz ... And NO ONE can Answer us why this happens ...

    Well its because IRAY its a PHISICAL ENGINE ?
    So to Mix Properly Volumetric Materials ...

    We Have to Duplicate Geometry and use Severall materials in Each Geometry ...
    Because IRAY is a PHISICAL ENGINE ? ..
    ...

    Well Pixar Renderman & Arnold & Octane & Cycles & Maxwell All they are Phisical Renderers ...
    And there we can do this !! Its a Simple Thing ! Should be !

    Iv been working for 20 years with all kinds of rendering Biased unbiased to realtime engines there is ...
    And ... I dont know ...

    Dont tell-me we canot do this in IRAY in 2017 !! ...
    As i just find it ABSURD !!

    There must be a WAY ! ...
    Even if Someone Code a Custom Volumetric BSDFs / MATERIALS MIX Mdl NODE or something to Happen ...


    IF NOT ! SO PLEASE MDL & IRAY DEVELOPERS GUYS !! PLEASE FIX IT SOONER !!!
    We been Waiting for this VOLUMETRIC Materials Mix Solution In Iray over 2 Years !




    THERE MUST BE A WAY WE CAN MIX & BITMAP VOLUMETRIC DEEP TROUGH LAYERS !
    AND DO SCATERING & ABSORTION VALUES IN SEVERALL MATERIAL OVERLAYS IN IRAY ??


    And if we CANOT ...

    Right now ...
    CAN WE AT LEAST HACK IRAY PHISICS ?

    USING "GLOSSY, REFRACTION, BACKSCATERING, ROUGHNESS AND IOR"
    TO DRIVE VOLUME SCATERING & ABSORTION DEEPNESS "Overlays" Effects
    BITMAP MASKED BETWEN MATERIALS BSDFS SOMEHOW ??

    ....

    I am Sure That EVEN IF IRAY CANOT MIX VOLUMES Right now ...
    there must be a Way to Hack Materials to Change
    Scatering & Absortion Values TROUGH BSDFS Properties Overlayering ?

    We been Trying for years ! But the Solutions are Terrible Looking and So hard for users to tweek ! ...

    BUT HOW CAN WE DO THAT OF MIXING VOLUMETRIC MATERIALS LAYERS PROPERLY ?




    ( IF SOMEONE WANT TO HELP ! )

    Please Do not do it with just "Words" but with Sending Codes EXAMPLES please !

    So we can Do it Faster BY CODE EXAMPLE ... We reaaly need a Fix for this ...
    As we have Customers waiting for better solutions ...





    Some help and Enlightment In this Curious Case !
    Would be Reaaly good !




    THANK YOU SO MUCH ! FOR ALL AWESOME IRAY MDL COMMUNITY SUPPORT !




    PS: I attach The Stanford Dragon / That we Uvmapped and the MDL files ...
    For whoever want to give it a TRY ! On more than words !

    -------------------------

    DOWNLOAD HERE :

    MIXING_VOLUMES_OVERLAY_IN_IRAY.zip

    -------------------

    Maibe someone Can do this for us ! ?

    RULE: Dont touch the SURFACES ! Must be PURE VOLUMES MIXING !
    Mixing Scatering & Absortion Values Betwen Materials !

    We need at least 6 MATERIAL VOLUMES Overlays !!

    Maibe Iray Developers need to ADD some kind of DIFERENT VOLUME BSDF To be Done in IRAY !
    So we can Have Overlay volumetrics ?? Driven by Volume BSDFS At the SUrface level Directly ?

    THIS SIMPLE THING OF PROPERLY MIXING MATERIAL VOLUMES IS SOOO MUCH NEEDED !!


    THANKS SO MUCH FOR LISTENING !

    SOULS STUDIO


    ( Density Mapped Volumetric Scatering & Absortion Bsdf Material Mediuns Overlays in Real World )


    Attached Files Attached Files
    Last edited by SOULSSAGA; July 30th, 2017 at 17:56.

  2. #2
    Join Date
    Jan 2007
    Posts
    314

    Default

    Because its a mathematically non trivial problem

    non uniform volumes are under investigation for Iray in the sense that you should be able to vary absorption and scattering. Varying ior, which would be necessary for a full mixing of volumes is out of scope for now.

    So if you have a *3d* checkerboard texture, you will be able to mix 2 different values for scattering and absorption kind of like you did, just that it will look *very* different from your simple 2d composite which just does not look like mixing 2 different volumes at all, but like a simple composit.
    With a simple 2d bitmap it can not work since it gives only information at the surface level, but we information for the volume!

    The octane renderer is actually no proper mixing *in the volume* but essentially a 2d composit. For skin this is *mostly* ok since values change rather gradually, but for the checker example and 2 radical different volumes it just gives completely wrong results.

    You are asking for 2 very different things here:
    1. mixing of volumes. This will not help you with your skin example but allow, to some degree, the glass ball and the japanese food.
    2. 2d parameterized approximative skin rendering (like in all the links you added to the other posts) where you essentially ignore some of the complexity of light transport in skin: is also on our wishlist but is completely independent of mixing of volumes. Right now iray (photoreal) does not have such approximations but always fully path traces volumes.

  3. #3
    Join Date
    Aug 2016
    Posts
    23

    Thumbs up


    THANKS A LOT FOR YOUR COMMENT !


    Ok ! For now We canot Change "The non trivial" IOR ! No Problem ! We Can just leave IOR to 1 or near
    Then we Just Overlay And MAP Severall BSDFS of severall types ! Glossy Specular Refraction Roughness ...
    Were we can Control Volumes Setups on SUrface level ... For that we Can then SKIP IOR ! ...
    As we can Emulate Ior Changes With Glossy Refraction Roughness ...

    BUT MIXING ABSORTION SCATERING, DEEP & COLORS ! ! Its Awsome That we at least can MIX that ! Betwen Layers !
    And its something we are not able, no matter how we try it or push it ...

    ---------------------

    1) - Could you PLEASE send some CODE Examples of how can you Mix 2,3,4 ( Diferent : Absortion, Scatering ) VOLUME Materials Layers ! On top of Eachother ! With Different Scattering & Absorption Deep & colors !
    WITH 3D TEXTURES , 3D PERLIN NOISE or LINEAR 3D VOLUME RAMP CURVES or However !!



    As long as we Can Control the "mix Amount" and we can Generate Different 3D Textures Is all good !

    But we reaaly here CANOT do that without Code Examples Please ....

    --------------

    - We Dont have the SLIGUEST idea on how can we plug "3D Textures" or "3D Noise" to Drive A Mix Between 2 Materials !! In Iray !

    We tried everything, and we could not ! We searched on HOW for 1 Year and HALF Since your last comment ! ...
    But the last codes on "Volume Ramp" by Curves did not do anything To this Problem ... as is not 3D textures !

    The code You Given us back there ! Got no Solution for Mixing Materials ! Volume Based ...

    Code:
    
    mdl 1.3;
    
    import df::*;
    import base::*;
    import math::*;
    import anno::*;
    
    
    
    export material softedge(
        uniform color color_0 = color(0.),
        uniform color color_1 = color(1.),
        uniform color color_2 = color(.5),
        uniform color color_3 = color(.1),
        uniform color color_4 = color(0.)
    )
     =  material(
        surface: material_surface(
            scattering: df::measured_curve_layer(
                curve_values: color[](color_0,color_1,color_2,color_3,color_4),
                layer: df::diffuse_reflection_bsdf(tint: color(.8,.5,.9)),
                base: df::specular_bsdf(tint: color(1.0), mode: df::scatter_transmit) 
            )
        ),
        ior: 1.0,
        thin_walled: false
    );
    
    export material true_softedge(
        uniform float base_thickness = 1.0, //in m
        uniform color volume_color = color(.9,.9,.9), // avoid 1 and 0 values since those are unrealistic
        uniform float scattering_ratio = .9
        )
     =  material(
        surface: material_surface(
            scattering:  df::specular_bsdf(tint: color(1.0), mode: df::scatter_transmit) 
        ),
        volume: material_volume(
            scattering_coefficient: (base_thickness <= 0)? color(0): math::log(color(1.-scattering_ratio)) / - base_thickness,
            absorption_coefficient: (base_thickness <= 0)? color(0): math::log(volume_color) / -base_thickness
        ),
        ior: 1.0,
        thin_walled: false
    );
    Best Part of that Is the MEASURED Curve layer !

    But we Tried ! Using a Measured Curve Layer DONT Mix Volume Scatering + Absortion ...
    It just Falls Back to FIRST MATERIAL Volume Scatering Absortion ...
    As all other Weighted or Blend Layer Material Mix types ...



    Code:
    export material blend(
        material base = scratched_plastic()
        [[
            anno::display_name("Base material"),
            anno::description("The material the blend is based on")
        ]],
        material blend =  scratched_metal()
        [[
            anno::display_name("Blend Material"),
            anno::description("Surface properties to use for the blend")
        ]],
        float weight = 0.
        [[
            anno::display_name("Blend weight"),
            anno::hard_range(0.0,1.),
            anno::description("Blend weight or mask texture")
        ]]
    )
    [[
        anno::display_name("Surface blender"),
        anno::description("Blend surface characteristics of 2 materials or mask them using a texture")
    ]]
     =  material(
        surface: material_surface(
            scattering: df::weighted_layer(
                weight: weight,
                layer: blend.surface.scattering,
                base: base.surface.scattering
            ),
            emission: base.surface.emission
        ),
        volume: base.volume,
        ior: base.ior,
        thin_walled: base.thin_walled,
        geometry: base.geometry
    );
    As you see in all MATERIALS BLENDER we are Just Mixing Surfaces ...

    We need to mix "volume: base.volume," Description ...

    With like a ::mdl:math::lerp(curve3d_or_3DPerlinNoise_here, Volume_1, Volume_2)

    ... or something ... Trivial like that !! Lol ...


    ---

    Anyway ! If we can do it with Measured Curves ... As they are 3D Volume Screen Space ...
    BUT HOW CAN WE APPLY THEM FOR MIXING and MASKING 2 MATERIALS SCATTERING VOLUMES ?
    ...

    There is NO WAY we could Figure Out ...

    And there is few to NONE control ! ( nothing like controling things by bitmaps and UVS ))
    Iray Should Easily Be more developed to do That !! !

    ---

    But if we can control with 3D Noises Or Curves then its better than Nothing !

    But we need to know how to generate and plug those !

    ----

    There is no Examples in Watsoever no place !
    ( Actually no one i know in whole internet knows that )

    As "3D Volume Texture"s in IRAY for everyone is a MITH !

    ( Is something Mdl Programmers tell you when they have nother excuses ! )



    ----

    Is there yes Texture_3D() ! But no one knows how to use or Generate or do Anything ! With it !

    CAN WE GENERATE AT LEAST IN IRAY PROCEDURALLY THOSE 3D TEXTURES TO DRIVE WHOLE MATERIAL MIXES SOMEHOW ?

    THERE IS NO WAY TO DO IT IN TRIPLANAR PROJECTION ? Like Converting the 2D Texture Deep in 3D By Triplanar or Cylindrical Normalized Projection !?

    ---




    MAIBE WITH PERLIN NOISES TYPE OF 3D TEXTURES THEN ??


    But how can we Plug that to a MATERIAL NORMALIZED WEIGHT Mix Or OVER LAYER ?

    UPDATE: WE TRIED WITH PERLIN NOISES TO DRIVE THE MATERIAL MIX OR ADD WEIGHTED MATERIAL ! AND IT DOES NOTING ! WHATSOEVER ! The Material Doesn't Respond and do not Mix With Perlin Noises or Direct Input Floats ! Either way !

    That is Because the FLOATS Inputs & outputs are Different .. So need to be Converted right ?

    But how can we do that ?? ... ho lord ...

    ---------

    It Would REAALY Help the Whole COmmunity if you can PLEASE send Codes Examples explaining that !

    ------

    SIMPLE 3 MATERIALS OVERLAYED ON TOP OF EACHOTHER ( WITH DIFERENT ABSORTION, SCATERING VALUES ) MASKED SOMEWOW !

    ---


    Can you PLEAASE Show us how to Plug things up ... With A Simple 3,4 Volume Materials Layers Overlayed MDL Code Example

    Otherwise, not us or Anyone in the Whole MDL Community , FOR YEARS Is going to ever GRASP That !

    ----



    Sorry to ask too much ! But i'm just being Realistic !

    If IRAY can do Things as that ! IRAY needs more MDL codes Examples !

    - If not , Some more courageous people like me Pushing it lol ...

    Otherwise people are not Going to use EVER Iray to even at its 15% Potentials !

    ---

    MIXING WHOLE MATERIALS SCATERING, ABSORTION , VOLUMES IS QUITE A BIG THING ! !

    It should be more easy !!

    ---

    The WHole Community needs a CODE EXAMPLE of that Happening !

    Otherwise No one will ever do MATERIAL LAYERS in Iray PROPERLY ! !



    ----

    THANKS SO MUCH FOR YOUR TIME !

    Thanks so much for Your Support !

    THANKS FOR EVERYTHING !



    ______

    PS: There is a BUG With Mixing Materials / Bsdfs With .JPG Image Masks !!
    WIth JPG Do not work ! With .PNG Images, It Actually WORKs !!

    We just Found out 2 Hours ago ... After Months Trying the wrong way !
    Cant even explain that either, but that is whats hapening !




    THANK YOU !

    __

    SOULS STUDIO
    Last edited by SOULSSAGA; July 31st, 2017 at 03:20.

Posting Permissions

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