Looking for Iray MDL examples for VDF

13»

Comments

  • EsemwyEsemwy Posts: 578
    edited September 2015

    The '.tint' is the tint component of the texture_return called noise() defined at the top of the MDL file.

    I had to raise the absorption coefficient way up to get anything. There's something stranger going on.

    Here is a cube I rendered from slightly high and left.

    Here's the scene.

    I had to the absorption coefficient at color(.4).

    vdf_scene.jpg
    1010 x 998 - 65K
    vdf_strange.png
    500 x 500 - 59K
    Post edited by Esemwy on
  • jag11jag11 Posts: 885

    Yeah, strange, lokks like some king of atmosphere.. same MDL file?

  • EsemwyEsemwy Posts: 578
    edited September 2015

    Yep. No changes excpet to the value of the absorption coefficient.

     

    vdf_params.jpg
    181 x 212 - 17K
    Post edited by Esemwy on
  • EsemwyEsemwy Posts: 578

    Ok, it was just a wierd interaction with the background transparency. Absorption is working correctly.

    vdf_less_strange.png
    500 x 500 - 270K
  • mjc1016mjc1016 Posts: 15,001
    Esemwy said:
     

    It's getting a SIGBUS in one of the threads running libiray.so. This is always a programming error. I thought initially that they were overrunning a buffer because of the stack canary message, but looking closer it's more like they tried to access data on an improperly aligned address.

    If the above sentence is gibberish, please ignore it. If you're a software engineer, I'll gladly provide more, but it might injure others in the thread.wink

    That could also explain some of the odd crashes I get in Wine...and I think its somewhere else, like in the Studio exe itself, because it gives me the crash in 3DL (32 bit, can't run Iray), but almost all of them are 3DL.

  • ToborTobor Posts: 2,300
    Esemwy said:

    Ok, it was just a wierd interaction with the background transparency. Absorption is working correctly.

    Indeed it is.

    On the off behavior with the BG transparency, have you tried switching the Alpha mode to transmission objects, or primary? I guess we could also try a custom LPE here. Almost everything I do is with a transparency, so I'm always looking at the variations.

  • ToborTobor Posts: 2,300

    So, are you able to now reliably render now on your Mac, or are you using a Windows-based machine?

     

  • EsemwyEsemwy Posts: 578

    I implemented the noise in MDL instead of using bricks. It doesn't work, but doesn't crash. frown

    I'll play with it some more after dinner.

  • EsemwyEsemwy Posts: 578

    Anybody still watching and have time to try this out? It's pure MDL and still crashes DAZ (on OS X). The noise function is taken from shaders/iray/nvidia/noise_perlin_glossy.mdl, which works, but once I apply it to a volume, everything goes south.

    direct link

    mdl 1.0;import df::*;import base::*;import anno::*;export material noise_volume (    float ior = 1.0    [[         anno::display_name("Coating ior"),        anno::soft_range(1.0, 4.0),        anno::description("Describes the directional dependence of the reflection."            " Values around 1.5 are realistic, higher values will increase reflectivity for"            " surfaces facing the observer")    ]],    uniform float abbe_number = 89.30,    uniform color absorption_coefficient = color(0),    color noise_color = color(1.)    [[         anno::display_name("Color 1")    ]],    color base_color = color(0.)    [[         anno::display_name("Color 2")    ]],    uniform float3 scaling = float3(1. )    [[         anno::display_name("Scaling factor")    ]],    uniform bool absolute = false    [[         anno::display_name("Absolute noise")    ]],    uniform int levels = 3    [[         anno::display_name("Detail levels")    ]],    uniform float threshold_low = 0.5    [[         anno::display_name("Lower noise threshold"),        anno::hard_range(0.0, 1.0)    ]],    uniform float threshold_high = 1    [[         anno::display_name("Upper noise threshold"),        anno::hard_range(0.0, 1.0)    ]],    uniform bool apply_marble = false    [[         anno::display_name("Apply marble function")    ]],    uniform bool apply_dent = false    [[         anno::display_name("Apply dent function")    ]]) = material (    ior: base::abbe_number_ior(        ior: ior,        abbe_number: abbe_number    ),    surface: material_surface (        scattering:    df::specular_bsdf(            tint: color(1.0, 1.0, 1.0),            mode: df::scatter_reflect_transmit        )    ),    volume:  material_volume (        scattering: df::anisotropic_vdf(),        absorption_coefficient: absorption_coefficient,        scattering_coefficient: base::perlin_noise_texture(            uvw: base::transform_coordinate(                    transform: base::rotation_translation_scale(rotation: float3(0.), translation: float3(0.), scaling: scaling),                    coordinate: base::coordinate_source(coordinate_system: base::texture_coordinate_world, texture_space: 0)            ),            color1: base_color,            color2: noise_color,            size: 1.,            apply_marble: apply_marble,            apply_dent: apply_dent,            noise_phase: 0.0,            noise_levels: levels,            absolute_noise: absolute,            noise_distortion: float3( 0.0 ),            noise_threshold_high: threshold_high,            noise_threshold_low: threshold_low,            noise_bands: 1.0        ).tint    ));

     

  • jag11jag11 Posts: 885

    Well, just tested, no crash here, but no effect either...

  • EsemwyEsemwy Posts: 578

    Thanks. I posted a help desk ticket. The last one didn't go through apparently. This crashes at exactly the same address as the one you tested before. Looks like I'm SOL until DAZ releases a patch. 

  • jag11jag11 Posts: 885

    If you do any other render like for example v6 with other shaders do you get the same result, crash? Or just scripts dropped at shader mixer...

  • EsemwyEsemwy Posts: 578

    Oh, I only get crashes when trying to combine perlin noise with volumes. I can do uniform volumes. I can do perlin noise surfaces. I can render all day long with other materials, but Iray crashes when I try to render non-uniform volumes. 

  • ToborTobor Posts: 2,300
    edited September 2015

    What happens (crash wise) when you render this in Interactive mode instead of Photoreal?

    Aside that that, just caught something in the programming docs: "Iray Photoreal only supports a scalar scattering coefficient and hence  uses the luminance of that color for this." I take this to mean there's no per-pixel information that can be passed to the function. The value is stored uypon first execution and referred to for all pixels. I.e., as jag11 has noted before, it's read once and flatly applied. No texture (procedural or otherwise) can be used.

    So I'm curious: are you looking for a physically-based volumetric effect, or can you "fake" the appearance of the mist or fog or cloud that you're going after?

    Post edited by Tobor on
  • EsemwyEsemwy Posts: 578

    Strange. Did I misunderstand jag11's previous post? It seemed to me he had it working. Or is the picture posted just surface noise? Either way, it shouldn't crash the renderer. 

  • jag11jag11 Posts: 885

    Yep, I was only showing that the only noise I've got was on the surface and the accompanied image were the settings used.

  • ToborTobor Posts: 2,300

    You're right, it shouldn't crash the renderer, but I have a feeling there isn't much Da zcan do about this. If it's in the renderer code, it'll need nVidia to fix it. I don;'t know if the Iray codebase is precompiled, or object code compiled with Daz's own library, or what, but I'd wager Daz is not allowed, from a licensing perspective, to dabble with the actual nVidia codebase.

    From the same programming docs, it notes as a limitation of Photoreal that the scattering coefficient is a color in MDL; it then goes on to say that Photoreal only supports the luminance component of that color, as a scalar. If the luminance is immutable once set, texturing by means of this value will not work, sadly.

    I asked before if you're going after a physically-based solution, or if faking a varying volume would suffice. As I noted before, the latter can be done -- to a degree -- by using a texture in the Refraction Weight node. It obviously isn't physically accurate of anything.

  • EsemwyEsemwy Posts: 578
    edited September 2015

    Well, that about does it for that. I guess if I need heterogeneous volumes I have to use LuxRender. I'll look into the texture based approach in the refraction weight, but I don't think that'll get all the effects I want (especially snow).

    Tobor, I guess for fog, this isn't bad. I was looking for something procedural, but it seems that won't be an option in Iray for a while.

    It will work well enough for Streets of Old London, which is really what set me on this path to begin with.

    Note: For anybody that hits this thread at a later time, the info for this is attached below.

    clouds-inv.jpg
    2000 x 2000 - 397K
    surface-settings.jpg
    306 x 486 - 58K
    Post edited by Esemwy on
  • ToborTobor Posts: 2,300

    Esemwy, It was a noble effort! The effect looks pretty good, actually. 

  • jag11jag11 Posts: 885

    I agree, but definetly I'd go with volumes for that.

    fog-attempt.png
    1067 x 800 - 1M
  • EsemwyEsemwy Posts: 578
    jag11 said:

    I agree, but definetly I'd go with volumes for that.

    Is that Lux? At this point, I only know it's possible. I haven't actually done any work along those lines. 

  • jag11jag11 Posts: 885
    edited September 2015
    Esemwy said:
    jag11 said:

    I agree, but definetly I'd go with volumes for that.

    Is that Lux? At this point, I only know it's possible. I haven't actually done any work along those lines. 

    Iray. It looks weird 'cause I only droped some rocks, randomly placed and then I applied the fog settings and my best composition abilities.laugh

    Post edited by jag11 on
  • EsemwyEsemwy Posts: 578

    Is that Iray Uber or something else? Oh, wait, you mean you're using several volumes with odd shapes?

    jag11 said:

    Iray. It looks weird 'cause I only droped some rocks, randomly placed and then I applied the fog settings and my best composition abilities.laugh

     

  • jag11jag11 Posts: 885

    Just Iray Uber. There are several volumes(rocks), but you can use one or as many as you need to the desired effect. For speed on composition purposes I used http://www.daz3d.com/nature-rocks-pack-1.

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

    From the same programming docs, it notes as a limitation of Photoreal that the scattering coefficient is a color in MDL;

    It's even worse. As I've been told by the nice people over at the NVIDIA Advanced Rendering Forums, the scattering coefficient is currently only supported as grayscale, since for many SSS applications a greyscale/white scattering would be sufficient enough, as they say. And that this limitation will be changed in some future version of Iray.

    Post edited by Arnold C on
  • EsemwyEsemwy Posts: 578
    edited September 2015

    They hate us. That's the only explanation.

    Now I get to spend another couple of weeks doing this all over again in Lux. I spent 10 minutes this morning with Reality 4.1, but couldn't get the volume shader to apply properly. But that's a story for another thread....

    under-the-fog.jpg
    989 x 1600 - 189K
    Post edited by Esemwy on
  • ToborTobor Posts: 2,300

    I'm going to be upgrading my Reality (2.5) to 4.1. RDNA has the better price, and it's not looking like there are any upgrade deals Still, $25 is pretty cheap anyway. I haven't fired up Lux in over a year (yeah, I know I need the new version, which apparently comes with Reality this time around). It'll be like meeting an old friend again after a long time being in the Army...

  • EsemwyEsemwy Posts: 578

    I had 4.0, so the upgrade was free. I haven't used it that much, and it's been on the shelf since Iray hit the street. I have a Linux server with four GPUs that I'm setting up as a Lux render server. That should make things interesting. 

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

    They hate us. That's the only explanation.

    Nah, I'd say, they're just not that far into the development stage They might ignore or even dislike us... devil

    Hate is not what Yoda teaches... and we can really be happy he didn't write the handbook! laughcheeky

    For anyone interested in what I learned during my quest about absorption and scattering in Iray: I answered (my own! :P) question over at Nuts n Bolts.

    >>Hmm, that didn't work out as intended.<< surprise laugh cheeky

    Post edited by Arnold C on
Sign In or Register to comment.