Canvases, HDR and Instances

Trying to get my head around canvases.

Is there a way to add instances of an object to a canvas? When I try it says there are no valid nodes. If I have a figure I have instanced, adding the original figure to the canvas does not add the instances too.

Also, the HDR does not come out on anything other than the full scene beauty layer. What I would like to do is to build the scene up using diffuse, glossy, specular and beauty layers to be able to tweak everything, but none of these capture the HDR. Is there a technique for getting the HDR in here somehow?

Any help appreciated!

Comments

  • SevrinSevrin Posts: 6,306
    edited January 2021

    Iray in DS doesn't currently recognize instances as node objects.  I posted a question a couple of months ago about that exact thing on the Ask Me Anything part of the Iray Dev Blog but so far it has received no answer.  I don't know if that's an Iray thing or a DS thing, though, so maybe the question confused them.

    You can sort of work around that, by creating a general Alpha canvas, and then creating Alpha masks along with node-selected Beauty masks (checkmark in Alpha box) for everything in the scene.  The instanced thing will be masked in the general Alpha canvas, but not the one made with selection.  The difference between the two (Subtract blend mode) will be a mask including just instances.  NB: the shadows of instanced objects will count as shadows of the original objects, so some manual mask and image manipulation (painting) may be required.

    With canvases, sometimes you have to do things backwards.  In a scene were you have an HDRI for background and lighting, and also other lighting, whether DS lights or emissives, you can isolate the HDRI image and lighting by creating a Beauty canvas and a Light Group canvas from a selection including all non-HDRI light sources, and then in an image editor, using the Subtract blend mode to obtain a canvas that includes only whatever lighting is provided by the HDRI, which will include the HDRI background image.

    The Beauty canvas is what you would get when you add (Add blend mode) Diffuse, Specular and Glossy in an image editor.  In a lot of cases, I'll create a Beauty canvas, a Specular canvas and a Glossy canvas and add in a bit of Specular or Glossy to bring out something I want to emphasize.  Specular for the eyes, for instance, or Glossy for jewelry, etc.  If you also get something else highlighted excessively in the process, you need to mask that out manually.

    Now, the above can all be done with just the canvas option Daz provides in Daz Studio.  These options are there to make canvases relatively easy to use.  Iray works with LPE (Light Path Expressions) and Daz Studio does the work of translating the options we choose into LPE to send to Iray.  You also have the option, via the LPE canvas option text box, to create your own LPE in which you specify, for example, that you only want a specular canvas of light coming from the environment, for example, on a specific scene object.

    Further reading:

    https://blog.irayrender.com/post/76948894710/compositing-with-light-path-expressions

    https://www.lightworkdesign.com/images/support/3dsMaxDocumentation/features/light-path-expressions.html

    Edit: Added what you get from DS Environment canvas alone.

    Squirrel-Canvas1-Beauty.jpg
    400 x 520 - 259K
    Squirrel-Canvas3-LightGroup.jpg
    400 x 520 - 67K
    Light Group Canvas subtracted from Beauty Canvas.jpg
    400 x 520 - 254K
    Squirrel-Canvas5-Alpha.jpg
    400 x 520 - 54K
    Squirrel-Canvas4-Beauty.jpg
    400 x 520 - 57K
    Squirrel-Canvas 4 subtracted from Canvas5-Alpha.jpg
    400 x 520 - 19K
    Squirrel-Canvas1 Instanced Squirrel Only-Beauty.jpg
    400 x 520 - 35K
    Squirrel-Canvas4-Beauty.png
    400 x 520 - 412K
    Squirrel-Canvas2-EnvironmentLighting.png
    400 x 520 - 673K
    Post edited by Sevrin on
  • Thank you, that is a very helpful and thorough answer! No going to pretend I understand every bit of it, but I will work at it : )

    Thanks again.

  • markusmaternmarkusmatern Posts: 558
    edited January 2021

    I found a way to render instanced objects to canvases using the Create Advanced Iray Node Properties script that comes with any DAZ Studio installation.

    This script (located in your content library: Scripts - Utilities) adds a property under the parameters of an object (or instances): Display - Rendering - Iray - Iray Handle

    This is a name for an object that can be accessed from the above mentioned LPE when using canvases:

    I attached a small example scene using this technique. The larger spheres are the original objects, the smaller spheres are the instances.

    Here are the canvases and the used Light Path Expressions:

    EnvSpheresRed:
    Le('SpheresRed1'|'SpheresRed2'|'SpheresRed3').*E

    EnvSpheresBlue:
    Le'SpheresBlue'.*E

    EnvFloor:
    Le'Floor'.*E

    SpotSpheresRed:
    <L'SpotLight'>('SpheresRed1'|'SpheresRed2'|'SpheresRed3').*E

    SpotSpheresBlue:
    <L'SpotLight'>'SpheresBlue'.*E

    SpotFloor:
    <L'SpotLight'>'Floor'.*E

    SpotAllSpheres:
    <L'SpotLight'>('SpheresRed1'|'SpheresRed2'|'SpheresRed3'|'SpheresBlue').*E

    With this technique you can group obects and lights just by giving them the same name (Blue Spheres), or by naming them individually (Red Spheres) and using a more comlex LPE.

    duf
    duf
    Instances_ColoredSpheres.duf
    39K
    Instances_ColoredSpheres.duf.png
    91 x 91 - 6K
    Instances_ColoredSpheres.jpg
    1280 x 720 - 87K
    Instances_ColoredSpheres-EnvFloor-LPE.jpg
    1280 x 720 - 62K
    Instances_ColoredSpheres-EnvSpheresBlue-LPE.jpg
    1280 x 720 - 57K
    Instances_ColoredSpheres-EnvSpheresRed-LPE.jpg
    1280 x 720 - 60K
    Instances_ColoredSpheres-SpotAllSpheres-LPE.jpg
    1280 x 720 - 98K
    Instances_ColoredSpheres-SpotFloor-LPE.jpg
    1280 x 720 - 69K
    Instances_ColoredSpheres-SpotSpheresBlue-LPE.jpg
    1280 x 720 - 49K
    Instances_ColoredSpheres-SpotSpheresRed-LPE.jpg
    1280 x 720 - 71K
    Post edited by markusmatern on
  • SevrinSevrin Posts: 6,306

    That's pretty cool.  Thanks.

  • Awesome! Thank you markusmatern

Sign In or Register to comment.