3Delight Surface and Lighting Thread

1151618202152

Comments

  • Mustakettu85Mustakettu85 Posts: 2,933
    edited December 1969

    Here are some notes that those who switched to the "raytrace" hider and enjoy writing their own shaders might be interested in.

    I've been exploring how to best combine the awesome GI cache and SSS, and here's what I came up with:

    - never use faceforward() in your SSS shaders! It really messes up things;
    - for best results with GI caching, SSS should be of the new "raytrace" type: this will handle GI better and eliminate alias-y artefacts that sometimes happen with the old type (you can use the old type fine most of the time, but under certain circumstances there may be edges of your model at which these artefacts appear in the form of jagged black lines, and I hate that);
    - however, explicitly enabling this new SSS type to work in DS is different to the published examples, since the subsurface() shadeop refuses to properly handle the "type" "raytrace" parameter; it will have to be specified as a RiAttribute, same as "samples" and all the actual scatter parameters (it means they all go into the rendertime script); "model" "grosjean" and "irradiance" are okay when passed to the shadeop itself;
    - the normal (in the sense of "normalise(N)") parameter is essential to the "raytrace" SSS type! It won't work with just P. Old shaders cannot be converted to the new type without adding the normal parameter in the source code (how do I know? I tried adding the "type" attribute to US2 rendertime script, and 3Delight threw error messages about missing parameters and did not compute SSS);
    - this new SSS algo is sample-based, so it means it will be noisy; 64 samples is a good mid-quality starting point; 512 should be clear enough for most cases, 256 is okay.

    Sometimes this new SSS type does weird things to certain geometry, but it's probably the problem of the models (I saw it with David3 with elf-ear morphs on the ears and the Utah teapot obj, and these models are fairly old), not the algorithm.

    Notes on my shader in the render attached:

    - it uses two speculars, which is not very 21st century apparently LOL (there should be more work involved to get a realistic layered BRDF), but hey, I like the look;
    - a 3Delight's oldschool specular() with a high roughness (0.73) so that it spreads over the surface, high strength attenuated with proper 1.5 eta fresnel: gives this "rim" effect, most noticeable on the nose here; it also has some procedural noise;
    - a bsdf() shadeop doing a Cook-Torrance specular with 1.7 eta, roughness 0.35 on skin and 0.2 on lips; also with noise, but I guess its effect is not that pronounced when also using specular maps (or the frequency is too high for this shot);
    - the diffuse inside the subsurface() is bsdf() doing an Oren-Nayar with 0.3 roughness (I do not add it the the final colour, it's only for the SSS);
    - somehow the results of bsdf(), whether for specular or for diffuse, do need to be multiplied by PI to look good (otherwise they are too dark); it's probably connected to the integration done in illuminance() loop, but I don't know for sure. I'm not that good at maths.

    Transmapped hair and GI:

    - I still prefer to exclude hair from GI ("occlusion" off in UberSurface), not just because it's still faster (say, 6 mins with hair excluded vs 12+ mins with hair included), but also because including hair in GI will sometimes produce artefacts with the "raytrace" SSS somehow. And the difference in the final look is subtle (well, in my case and to my eye =))

    V2_newskin_256samples_6min45sec.png
    583 x 700 - 594K
  • Mustakettu85Mustakettu85 Posts: 2,933
    edited December 1969

    wowie said:

    Skin texture is V4 Elite Amy. I just love all those skin details. :)

    Looks awesome! Which figure is this, G2F? Are these her default eyes, or did you use any morphs on them?

    I'd be very grateful if you shared some tips on material settings you use for the cornea and/or eye reflection. I still don't like the way the eyes generally look in my renders, unless I stick a favourite reflection map onto them...

  • Kevin SandersonKevin Sanderson Posts: 1,643
    edited July 2014

    For the code you posted earlier, what do you suggest for nDepth and are there any numbers that should be plugged in? the rest of it earlier seems pretty easy ... but I may have more questions.

    // Set the Max Diffuse Bounce Depth
    // Attribute "trace" "maxdiffusedepth" [ n ]


    aTokens = [ "integer maxdiffusedepth" ];
    aParams = [ nDepth ];
    Renderer.riAttribute("trace", aTokens, aParams);


    // Specular bounce attribute
    var nDepth = RenderOptions.rayTraceDepth;
    // Find the "Max Specular Bounce Depth" property
    oProperty = oOwner.findProperty( "Max Specular Bounce Depth" );
    // If the property was found and it's an int property
    if( oProperty && oProperty.className() == "DzIntProperty" ){
    // Set the max ray depth according to the value of the property
    nDepth = oProperty.getValue();
    }


    // Set the Max Specular Bounce Depth
    // Attribute "trace" "maxspeculardepth" [ n ]

    aTokens = [ "integer maxspeculardepth" ];
    aParams = [ nDepth ];
    Renderer.riAttribute("trace", aTokens, aParams);

    Post edited by Kevin Sanderson on
  • Mustakettu85Mustakettu85 Posts: 2,933
    edited July 2014

    For the code you posted earlier, what do you suggest for nDepth and are there any numbers that should be plugged in? the rest of it earlier seems pretty easy ... but I may have more questions.

    These should be picked up by Script 2 from Script 1 (Script 1 is (yourname).dsa from the resources\Scripted Renderer\(yourname) folder, Script 2 is the one in scripts\support\DAZ\ScriptedRenderer\(yourname2)) and assigned the "Max Diffuse/Specular Bounce Depth" params we should first insert in the render settings generator (the buildRenderProperties() function in the Script 1). In the code I provide for those, I set the default to 5 for diffuse bounces and 1 for specular (my current shader does not explicitly trace secondary specular bounces, anyway, and neither does UE2).

    These repeating patterns in the code -

    var nDepth = RenderOptions.rayTraceDepth;// Find the “SOMENAME” propertyoProperty = oOwner.findProperty( “SOMENAME” ); // If the property was found and it’s an int propertyif( oProperty && oProperty.className() == “DzIntProperty” ){// Set the max ray depth according to the value of the propertynDepth = oProperty.getValue();}

    - are clones of the basic DAZ construct that reads those values from the script No 1 and assigns them to nDepth. nDepth is simply a temporary variable that then passes its values to the appropriate RiAttributes or RiOptions below.

    Post edited by Mustakettu85 on
  • wowiewowie Posts: 2,029
    edited July 2014


    Looks awesome! Which figure is this, G2F? Are these her default eyes, or did you use any morphs on them?

    I’d be very grateful if you shared some tips on material settings you use for the cornea and/or eye reflection. I still don’t like the way the eyes generally look in my renders, unless I stick a favourite reflection map onto them.

    Yes. Genesis 2 Female. The head morph is actually Olympia 6, though the body is Victoria 6.

    The eyes diffuse/bump texture is not Amy though, it's maelwenn's Emma.

    Settings for the cornea
    Opacity is 0% so I turned off everything that depends on opacity (diffuse, transluency, velvet etc).
    Refraction is enabled at IOR of 1.4
    First layer specular is 100% at 192,192,192 with a glossiness of 7.5% and sharpness of 90%.
    Fresnel for the first layer specular is 100%, at a falloff of 1 and sharpness of 80%
    Reflection is enabled, set to raytrace with a strength of 30 at 192,192,192.
    UberSurface 2 misc options is enabled except for trace displacements and fantom.

    Settings for the eye reflection/surface
    Opacity is 0% so I turned off everything that depends on opacity (diffuse, transluency, velvet etc).
    Bump is enabled at 25% with a min/max value of -0.010/0.010. Bump map is of course loaded into the strength slot. Will generally differe from set to set, but the difference should be negligible since min/max value is set quite low. They're just there to 'break' up the reflection/specular highlights a bit.
    First layer specular is 100% at 192,192,192 with a glossiness of 45% and sharpness of 60%.
    Fresnel for the first layer specular is 25%, at a falloff of 0.75 and sharpness of 50%
    Reflection is enabled, set to raytrace with a strength of 30 at 192,192,192.
    Second layer specular is 100% at 192,192,192 with a glossiness of 5% and sharpness of 25%.
    Fresnel for the first layer specular is 100%, at a falloff of 1.5 and sharpness of 90%
    UberSurface 2 misc options is enabled except for trace displacements and fantom.

    Some tips for eyes:
    * You can't use SSS on the sclera since you'll lose the very fine details there (capillary veins near the 'outer' sclera). I work around this by mixing first layer and second layer diffuse with different roughness and strength.
    * Add a bit of specular to the iris, just to give them a little bit of highlight. Don't forget to use a bump/displacement so it doesn't look uniform across the surface.
    * Don't forget about the tear part of the eye (above the lower eyelids). They help provide hints of wetness to the eyesurface.

    Post edited by wowie on
  • Kevin SandersonKevin Sanderson Posts: 1,643
    edited December 1969

    Thanks, Mustakettu85, I'll give it a whirl and see if I did it correctly soon. Gotta run back to work now.

  • Kevin SandersonKevin Sanderson Posts: 1,643
    edited December 1969

    And wowie, thank you for those details!!

  • Mustakettu85Mustakettu85 Posts: 2,933
    edited December 1969

    wowie said:

    Settings...

    Some tips for eyes...

    Thank you very very much! Will definitely give your settings a try.

    Would you consider using refraction on the tear?

  • evilded777evilded777 Posts: 2,482
    edited December 1969

    Ok, rejoining the discussion from over in the Ubersurface tutorial thread. Some interesting stuff with the scripted renderer. I must look a that.

    What is the deal with progressive rendering? I wasn't using it, heard something bad and took it as gospel. Tried it out, liked it... Then compared a render vs bucket and didn't like the progressive results so much. The progressive was kinda washed out, defiantly grainier occlusion. Is there stuff one needs to know to use this effectively?

  • wowiewowie Posts: 2,029
    edited July 2014


    Thank you very very much! Will definitely give your settings a try.

    Would you consider using refraction on the tear?

    You could, but I think it's unnecessary for a small surface and very small part of the render that the extra effort and penalty on render time.

    Post edited by wowie on
  • Richard HaseltineRichard Haseltine Posts: 107,893
    edited December 1969

    Progressive render did have a major memory leak initially, which made a lot of us shy away from it - I wa amazed when told to try it on a painfully slow scene and found it gave a massive speed boost. However, you are right that for some lights it can be noisier than standard rendering (I found it very much worse using the Bounce setting for uberEnvironment).

  • wowiewowie Posts: 2,029
    edited July 2014

    I see Richard have chimed in as well.

    As I noted in the Ubersurface thread, the progressive rendering uses the raytrace hider, which is very fast when rendering objects with lots of polygon and opacity maps (think hair). I don't generally use the bounce GI mode of UE2 (since it's very, very slow) so I never used it.

    What I really like about progressive rendering is that it solves texture seams issues with some texture/character set. It is almost like using shading rate below 0.5 (which means your UE2 samples and shading rate must be adjusted as well). Below are renders without and with progressive rendering with the same shading rate (shading rate is set to 1).

    For that seam to disappear, I'd have to bump the shading rate to something like 0.2 or 0.1, which makes renders with any kind of transmapped surfaces very, very slow.

    I also like the fact that the progressive renders picks up details from bump maps and spec maps much better, again generally similar to what you get if you use shading rate below 0.5.

    2.jpg
    800 x 1040 - 188K
    1.jpg
    800 x 1040 - 169K
    Post edited by wowie on
  • SertorialSertorial Posts: 962
    edited July 2014

    wancow said:
    VWrangler, I'm told SSS should be as high as 90 and Diffuse as low as 10 percent... because skin is transparent down many, many layers.

    Yes, I use 100% SSS and only 5% diffuse (otherwise all that diffuse reflection of light wipes out your nice subsurface effects). Here's an example of my 100+5 with Vicky4 (props to Mustakettu85 for getting me this far!)

    Of course, the only problem with a diffuse setting of 5% is that the figure looks jet black in the viewport! (which can make posing a bit of a challenge)

    vicky_SSS.jpg
    1200 x 1200 - 96K
    Post edited by Sertorial on
  • evilded777evilded777 Posts: 2,482
    edited December 1969

    wowie said:
    I see Richard have chimed in as well.

    As I noted in the Ubersurface thread, the progressive rendering uses the raytrace hider, which is very fast when rendering objects with lots of polygon and opacity maps (think hair). I don't generally use the bounce GI mode of UE2 (since it's very, very slow) so I never used it.

    What I really like about progressive rendering is that it solves texture seams issues with some texture/character set. It is almost like using shading rate below 0.5 (which means your UE2 samples and shading rate must be adjusted as well). Below are renders without and with progressive rendering with the same shading rate (shading rate is set to 1).

    For that seam to disappear, I'd have to bump the shading rate to something like 0.2 or 0.1, which makes renders with any kind of transmapped surfaces very, very slow.

    I also like the fact that the progressive renders picks up details from bump maps and spec maps much better, again generally similar to what you get if you use shading rate below 0.5.

    Ok....woah. Shading rate of 1? I can get good results with a shading rate of 1? That's a game changer, even if I gotta figure out the grain and loss of saturation.

  • Takeo.KenseiTakeo.Kensei Posts: 1,303
    edited December 1969

    wowie said:
    I see Richard have chimed in as well.

    As I noted in the Ubersurface thread, the progressive rendering uses the raytrace hider, which is very fast when rendering objects with lots of polygon and opacity maps (think hair). I don't generally use the bounce GI mode of UE2 (since it's very, very slow) so I never used it.

    What I really like about progressive rendering is that it solves texture seams issues with some texture/character set. It is almost like using shading rate below 0.5 (which means your UE2 samples and shading rate must be adjusted as well). Below are renders without and with progressive rendering with the same shading rate (shading rate is set to 1).

    For that seam to disappear, I'd have to bump the shading rate to something like 0.2 or 0.1, which makes renders with any kind of transmapped surfaces very, very slow.

    I also like the fact that the progressive renders picks up details from bump maps and spec maps much better, again generally similar to what you get if you use shading rate below 0.5.

    Ok....woah. Shading rate of 1? I can get good results with a shading rate of 1? That's a game changer, even if I gotta figure out the grain and loss of saturation.

    Never had that problem with seams so I don't often go under shading rate 1. Interesting. Made a simple render. For me the quality is the same and didn't really see speed gain but I'll have to test with serious statistics. But I'm not really sure it can go quicker than point cloud rendering

    My biggest concern about progressive rendering was that is used more memory and I did have the memory leak problem. Seems to work better now but I only tested a simple scene. I'll try some bigger scene and see how it goes.

    @Muskat : No I didn't recreate the raytraced SSS. Just tested it as soon as I saw it in the release log of 3delight.

    I don't really remember what I was looking for in 3delight. May come back later

  • Richard HaseltineRichard Haseltine Posts: 107,893
    edited December 1969

    wowie said:
    I see Richard have chimed in as well.

    As I noted in the Ubersurface thread, the progressive rendering uses the raytrace hider, which is very fast when rendering objects with lots of polygon and opacity maps (think hair). I don't generally use the bounce GI mode of UE2 (since it's very, very slow) so I never used it.

    What I really like about progressive rendering is that it solves texture seams issues with some texture/character set. It is almost like using shading rate below 0.5 (which means your UE2 samples and shading rate must be adjusted as well). Below are renders without and with progressive rendering with the same shading rate (shading rate is set to 1).

    For that seam to disappear, I'd have to bump the shading rate to something like 0.2 or 0.1, which makes renders with any kind of transmapped surfaces very, very slow.

    I also like the fact that the progressive renders picks up details from bump maps and spec maps much better, again generally similar to what you get if you use shading rate below 0.5.

    Ok....woah. Shading rate of 1? I can get good results with a shading rate of 1? That's a game changer, even if I gotta figure out the grain and loss of saturation.

    Never had that problem with seams so I don't often go under shading rate 1. Interesting. Made a simple render. For me the quality is the same and didn't really see speed gain but I'll have to test with serious statistics. But I'm not really sure it can go quicker than point cloud rendering

    My biggest concern about progressive rendering was that is used more memory and I did have the memory leak problem. Seems to work better now but I only tested a simple scene. I'll try some bigger scene and see how it goes.

    @Muskat : No I didn't recreate the raytraced SSS. Just tested it as soon as I saw it in the release log of 3delight.

    I don't really remember what I was looking for in 3delight. May come back later

    In simple scenes it's still slower, in my experience, and still uses a bit more memory (but not a runaway amount).

  • evilded777evilded777 Posts: 2,482
    edited December 1969

    3Delight message #141 Severity 1: D2045 PixelFilter reset to Box 1x1 (display driver requirement).

    So what's this mean? I have never really understood the Pixel Filter... what it does, or how to use it.

  • Richard HaseltineRichard Haseltine Posts: 107,893
    edited December 1969

    If this is with progressive render it seems to be unavoidable, it's not entirely clear whether it matters or not - certainly progressive render looks different from plain 3Delight.

  • Mustakettu85Mustakettu85 Posts: 2,933
    edited December 1969

    When in doubt, render to RIB and look at the text inside... the only thing different about the progressive and REYES RIBS is the "Hider "raytrace" "int progressive" [ 1 ] " line in the progressive case.

    When I added the progressive option to Berto Durante's teapot.rib (not DS-generated), the standalone still resets the filter to box 1x1. Apparently it's nothing but the requirement of the progressive display driver. Box is a fast filter, faster than sinc, maybe that's why the DNA folks are using it for the progressive mode.

    Has anyone tried testing those grain-prone scenes with setting the filter to box 1x1 in the REYES hider? Maybe the filter is the reason for the grain? Because I never got that sort of grain when using the "raytrace" hider in non-progressive mode.



    In simple scenes it's still slower, in my experience

    That's indeed the way it should be, according to 3Delight devs: REYES is still faster for simple scenes, while the path tracer is much faster for complex ones.

  • Mustakettu85Mustakettu85 Posts: 2,933
    edited December 1969

    But I'm not really sure it can go quicker than point cloud rendering

    You mean for GI? I'd say GI cache is faster and more reliable for me than point-clouds. For instance, point cloud generation somehow does not see those surfaces that use no explicit diffuse (like, UberSurface2 with SSS only), and I haven't figured out why.

  • wowiewowie Posts: 2,029
    edited July 2014


    When I added the progressive option to Berto Durante's teapot.rib (not DS-generated), the standalone still resets the filter to box 1x1. Apparently it's nothing but the requirement of the progressive display driver. Box is a fast filter, faster than sinc, maybe that's why the DNA folks are using it for the progressive mode.

    I don't think it is needed, because the raytrace hider samples differently than the REYES one.

    From 3delight's manual:
    http://www.3delight.com/en/uploads/docs/3delight/3delight_39.html#SEC159
    "Can produce nicer refractions and reflections since there is one shading point per subsample and not per micro-polygon."

    There's no need to go into lower shading rate since it's already using subsamples.Since the pixels are computed more accurately, using more complicated filters is also not necessary and in fact introduces noise (blurring).

    Post edited by wowie on
  • Mustakettu85Mustakettu85 Posts: 2,933
    edited December 1969

    wowie said:

    There's no need to go into lower shading rate since it's already using subsamples.Since the pixels are computed more accurately, using more complicated filters is also not necessary and in fact introduces noise (blurring).

    But noise and blurring are mutually exclusive, aren't they?

    Filters are largely an artistic choice, anyway. I much prefer sinc to anything else, but there's folks out there who swear by the gaussian...

  • evilded777evilded777 Posts: 2,482
    edited December 1969

    In my tests last night, I noticed things that I had not noticed before: better hair -- more vibrant; clearer eyes -- not sure what that was, better specular? Definitely will be keeping to the progressive render. Cleared up some of the grain I was seeing with better settings on my AoA Ambient light.

    And whoever mentioned better bump was certainly correct. I was shocked to notice the detail I was seeing from the mediocre bump maps I was rendering with.

  • wowiewowie Posts: 2,029
    edited December 1969


    But noise and blurring are mutually exclusive, aren't they?

    Filters are largely an artistic choice, anyway. I much prefer sinc to anything else, but there's folks out there who swear by the gaussian...

    Well, all filters generally are meant to clear or at least hide artifacts that happens because you're taking shortcuts. :)
    What I mean is trying to get away with less samples, resolution or processing (or a combination of all three). If you have all three to spare, you don't need filters.

    I did a quick test awhile back and found that sinc is a good solution to catch most problems. The funniest thing is that renders are a little bit faster with 3 samples rather than 2. Quality wise it's very similar to 4 and 6 samples, more so if you're already rendering at high res (more than 1080p).

    In my tests last night, I noticed things that I had not noticed before: better hair -- more vibrant; clearer eyes -- not sure what that was, better specular? Definitely will be keeping to the progressive render. Cleared up some of the grain I was seeing with better settings on my AoA Ambient light.

    And whoever mentioned better bump was certainly correct. I was shocked to notice the detail I was seeing from the mediocre bump maps I was rendering with.

    I think that was me. :)

  • Takeo.KenseiTakeo.Kensei Posts: 1,303
    edited July 2014

    Did some test with the dragon slayer scene so that everybody can test the same

    I get some very surprising numbers

    Test Protocol : Load Dragon Slayer Tutorial scene
    Change Shading rate to 1
    Change Gamma to 2.2

    1/ Hit Render. Should be Reyes Hider
    2/ Activate Progressive rendering
    3/ Point cloud script. Cloud shading rate = 4. Simple Occlusion light disabled. Gamma 2.2. Shading Rate = 1
    4/ Export To RIB File. Render with latest external 3delight x64 v11.87
    5/ Add Raycache option to RIB
    6/ Disable Raycache and Enable Raytrace Hider in RIB
    7/ Enable Raycache and Raytrace Hider in RIB

    Rendertimes Results :

    1/ Normal (Reyes?) Total Rendering Time: 2 minutes 47.67 seconds
    2/ Progressive Raytrace Total Rendering Time: 3 minutes 48.79 seconds
    3/ PointCloud Total Rendering Time: 3 minutes 8.48 seconds


    4/ External 3DL Total Rendering Time: 11 minutes 6.48 seconds
    5/ External 3DL Raychache ON Total Rendering Time: 8 minutes 23
    6/ External 3DL Hider Raytrace Total Rendering Time: 6 min 45
    7/ External 3DL Raychache ON + Hider Raytrace Total Rendering Time: 5 min 06

    That is not what I expected. Some optimisations done from DAZ in the 3DL integration or a problem with my 3delight?

    Post edited by Takeo.Kensei on
  • Kevin SandersonKevin Sanderson Posts: 1,643
    edited December 1969

    The DAZ version of 3Delight can use unlimited cores for one computer. The free external 3Delight from DNA is limited to only 4-cores.

  • Takeo.KenseiTakeo.Kensei Posts: 1,303
    edited December 1969

    Test done on a Quadcore. No difference there

  • Kevin SandersonKevin Sanderson Posts: 1,643
    edited July 2014

    AMD or Intel? If it's Intel, maybe the unlimited/limited cores applies to the hyper-threading as well. So if you are using Intel, you have more threads available for the DAZ version so a boost in performance. I can't imagine it being optimized faster for DAZ.

    Post edited by Kevin Sanderson on
  • Takeo.KenseiTakeo.Kensei Posts: 1,303
    edited December 1969

    It's AMD. No hyperthreading.
    In fact my 3delight installation had a problem. After deinstalling and reinstalling I got some more logical numbers. Didn't work by just installing over the preceding one

    So here are the new serie for External 3delight. The new one has a counter performance with Raycache and Raytrace active

    Second
    External 3DL Total Rendering Time: 2 minutes 16. seconds
    External 3DL Raychache ON Total Rendering Time: 2 minutes 23
    External 3DL Hider Raytrace Total Rendering Time: 3 min 01
    External 3DL Raychache ON + Hider Raytrace Total Rendering Time: 3 min 06

    Reyes still winning. I'll try the other Tutorial scenes and if Reyes is still ahead, I'll try with more complex scene, lightning and shaders
    One thing is missing : Point cloud with external 3DL
    Question would be : when is a scene complex enough to get some gain over Reyes?

  • wowiewowie Posts: 2,029
    edited July 2014

    It's AMD. No hyperthreading.
    In fact my 3delight installation had a problem. After deinstalling and reinstalling I got some more logical numbers. Didn't work by just installing over the preceding one

    So here are the new serie for External 3delight. The new one has a counter performance with Raycache and Raytrace active

    Second
    External 3DL Total Rendering Time: 2 minutes 16. seconds
    External 3DL Raychache ON Total Rendering Time: 2 minutes 23
    External 3DL Hider Raytrace Total Rendering Time: 3 min 01
    External 3DL Raychache ON + Hider Raytrace Total Rendering Time: 3 min 06

    Reyes still winning. I'll try the other Tutorial scenes and if Reyes is still ahead, I'll try with more complex scene, lightning and shaders
    One thing is missing : Point cloud with external 3DL
    Question would be : when is a scene complex enough to get some gain over Reyes?

    The answer - throw in some transmap or fiber mesh hair.

    Post edited by wowie on
Sign In or Register to comment.