Announcement

Collapse
No announcement yet.

Self Illumination element different when using LightMix

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Self Illumination element different when using LightMix

    I've noticed the self illumination channel that is created when using the LightMix element is very different from the VraySelfIllumination element.

    The LightMix element includes the light contribution cast from self illuminated objects (VrayLightMtl) but the VraySelfIllumination element doesn't. The Lightmix element also doesn't show visible vray lights.

    Would be nice to have some consistency here. An option in the VraySelfIllumination element to include light contribution would be useful.
    Attached Files
    Last edited by justini; 14-11-2021, 01:52 AM.

  • #2
    They are two different things.
    The *lighting* contribution of a self-illuminated vrayMtl isn't included in the vraySelfIllumination, but in the GI (try with a back-to-beauty RE).
    Lightmix isn't "standard" compositing (in that it's only plus operations) and requires a different approach (in other words, the LPEs making it up are different.), so much so each light channel contains the whole light contribution, across diffuse, reflection, refraction, and volumes.
    Lightmixing and standard compositing do not mix easily.

    If you require something highly specific, you're better off with writing your own LPEs.
    Lele
    Trouble Stirrer in RnD @ Chaos
    ----------------------
    emanuele.lecchi@chaos.com

    Disclaimer:
    The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

    Comment


    • #3
      Originally posted by ^Lele^ View Post
      They are two different things.
      The *lighting* contribution of a self-illuminated vrayMtl isn't included in the vraySelfIllumination, but in the GI (try with a back-to-beauty RE).
      Lightmix isn't "standard" compositing (in that it's only plus operations) and requires a different approach (in other words, the LPEs making it up are different.), so much so each light channel contains the whole light contribution, across diffuse, reflection, refraction, and volumes.
      Lightmixing and standard compositing do not mix easily.

      If you require something highly specific, you're better off with writing your own LPEs.
      So that being the case, how would i go about getting the "light contribution" (or GI) of just the self illuminated objects in a unique element? There is no way of including vraylightmaterials in a lightselect, so creating a custom LPE is not an option from what i can see. The only way to do this is by using the Lightmix element, which isn't denoised and overrides all of the light selects.
      Last edited by justini; 15-11-2021, 02:52 AM.

      Comment


      • #4
        You can add specific material names as mask in LPEs, as of V 5.2. (edit: this could be done before, too. just in a slightly different fashion.)

        For example, if the shader is called "mySelfIllumMaterial", this expression captures all its contributions:
        Code:
        C'mySelfIllumMaterial'.*
        Last edited by ^Lele^; 15-11-2021, 03:09 AM.
        Lele
        Trouble Stirrer in RnD @ Chaos
        ----------------------
        emanuele.lecchi@chaos.com

        Disclaimer:
        The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

        Comment


        • #5
          Originally posted by ^Lele^ View Post
          You can add specific material names as mask in LPEs, as of V 5.2. (edit: this could be done before, too. just in a slightly different fashion.)

          For example, if the shader is called "mySelfIllumMaterial", this expression captures all its contributions:
          Code:
          C'mySelfIllumMaterial'.*
          ok I've tried the expression C<RD>.*O but it captures ALL the self illumination indirect light and it doesn't work when "Direct Illumination" is selected in the VrayLightMtl. How do i make it capture just the selected object or material and have it work with "Direct Illumination"?
          Last edited by justini; 15-11-2021, 07:34 AM.

          Comment


          • #6
            justini The DI VRayLightMtl's missing information is actually a bug, which I've already logged (internal bug-tracker id: VMAX-11625) for developer investigation. Also, currently, material labels work only for VRayMtls and VRayCarPaintMtls, so use object labels instead.

            EDIT: Yes, I meant labels.
            Last edited by hermit.crab; 16-11-2021, 06:50 AM.
            Aleksandar Hadzhiev | chaos.com
            Chaos Support Representative | contact us

            Comment


            • #7
              Originally posted by hermit.crab View Post
              justini The DI VRayLightMtl's missing information is actually a bug, which I've already logged (internal bug-tracker id: VMAX-11625) for developer investigation. Also, currently, material labels work only for VRayMtls and VRayCarPaintMtls, so use object materials instead.
              Thanks for the info. What do you mean by object materials? Can you help me with the correct expression to use? Thanks.

              Comment


              • #8
                Originally posted by justini View Post
                ok I've tried the expression C<RD>.*O but it captures ALL the self illumination indirect light and it doesn't work when "Direct Illumination" is selected in the VrayLightMtl. How do i make it capture just the selected object or material and have it work with "Direct Illumination"?
                While the direct lighting bug is confirmed (so you'll need to use object lights instead), labels work just fine for me with light materials.
                If you need to capture lighting on some geometric node, you'll need to pass it the object label (that's what Alex meant.), which works fine with object lights.
                You can define LPE labels in the v-ray object properties, and recall it in the LPE.

                The right order is to create the mesh, set its LPE label ("myMeshLight", f.e.), make it a mesh light, and set up the LPE
                Code:
                C'myMeshLight'.*
                This then works splitting components as well, so long as you specify the node labels you wish to capture (i.e. not the light's, or mesh light's.).

                Lele
                Trouble Stirrer in RnD @ Chaos
                ----------------------
                emanuele.lecchi@chaos.com

                Disclaimer:
                The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

                Comment


                • #9
                  Originally posted by ^Lele^ View Post
                  While the direct lighting bug is confirmed (so you'll need to use object lights instead), labels work just fine for me with light materials.
                  If you need to capture lighting on some geometric node, you'll need to pass it the object label (that's what Alex meant.), which works fine with object lights.
                  You can define LPE labels in the v-ray object properties, and recall it in the LPE.

                  The right order is to create the mesh, set its LPE label ("myMeshLight", f.e.), make it a mesh light, and set up the LPE
                  Code:
                  C'myMeshLight'.*
                  This then works splitting components as well, so long as you specify the node labels you wish to capture (i.e. not the light's, or mesh light's.).
                  So that expression is for meshlights where you've defined a LPE label for it.
                  What expression do i use for light materials (without Direct lighting)? The one you posted above (C'mySelfIllumMaterial'.*) doesn't show just the Gi for the specified material.. Excuse my ignorance... this is all new to me.
                  Last edited by justini; 16-11-2021, 01:01 AM.

                  Comment


                  • #10
                    Well, it seems i was wrong on a few counts, when talking of labels. Memo to self: check the log.
                    Labels for materials ought to be prefixed with an m: so not 'myLightMaterial' (this will look for a material named 'yLightMaterial', or for a node label called 'myLightMaterial'), but 'mmyLightMaterial'.
                    However, Alex was right: vrayLightMtl names do not register at all (i was getting something else, but the simple scene setup, and not checking the log, didn't allow me to differentiate.).

                    So, you should be using vrayMtl with self-illumination and GI checked (that is equivalent to a lightMtl without direct lighting active.).
                    Further, you shouldswitch to BF GI for secondary engine.
                    You should also ensuire the diffuse component of your vrayMtl is black, if you want a hole where the emitter is.
                    Finally, the expression to capture the diffuse contribution of that material's emission, is then
                    Code:
                    C'mmyLightMtl'<RD>.*O
                    .

                    I've attached you the RGB (notice the reflections in the shaders) and the LPE result.
                    Also, the zip contains the max 2022 scene as rendered.

                    LPEs are a covert art: they are devilishly complicated, as they are a proper language and the permutations are endless.
                    Most of them, however, will make absolutely no sense.
                    For my part, i use the LPE Builder tool as much as i can, and that helps me visualise the light path before typing away, which generally saves me a ton of trial and error.
                    Also, the Log will contain useful info on the LPE expressions, if not always resolutive.
                    Alas, they are complex, expect to have to put more effort into them than commonly warranted.
                    Attached Files
                    Lele
                    Trouble Stirrer in RnD @ Chaos
                    ----------------------
                    emanuele.lecchi@chaos.com

                    Disclaimer:
                    The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

                    Comment


                    • #11
                      ok thanks for checking. That works now, and you're right, it is complicated. The bug in the vraylight material notwithstanding, this seems like a terribly complex solution to get a GI lightselect element from a self illuminated material. I would propose adding this as option to the existing selfllumination element to make this easier and accessible to everyone.

                      Comment


                      • #12
                        If at all possible (not a given.) it'll take time.
                        For the while you're much better off splitting the faces the material is applied to, and making a mesh light out of it: then you can select that to get the indirect diffuse out of the Light Select.
                        Unless it's a textured LightMtl, and then LPEs are the way to go (with the caveats those imply, absent from standard LS workflow.).
                        Lele
                        Trouble Stirrer in RnD @ Chaos
                        ----------------------
                        emanuele.lecchi@chaos.com

                        Disclaimer:
                        The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

                        Comment


                        • #13
                          A needed update on this, justini .
                          The LPEs currently won't accept labels for the O (emissive) component, in whichever material type it's found.
                          The fact it returned something, and with the wrong syntax, was due to the parser defaulting to something or the other in some case but not some other. (-.-')
                          So the correct label approach is
                          Code:
                          C.'label'.*
                          as found in the manual.

                          For your specific issue, there is currently no way to achieve what you'd like with LPEs and emissive shaders of any kind, you should try and use mesh lights and LPE labels instead.
                          Devs are looking into both the issues and the requests, although it's too early to know what will be possible and what not.
                          Last edited by ^Lele^; 16-11-2021, 05:24 AM.
                          Lele
                          Trouble Stirrer in RnD @ Chaos
                          ----------------------
                          emanuele.lecchi@chaos.com

                          Disclaimer:
                          The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

                          Comment


                          • #14
                            That would probably explain why I was also getting a vraylightmtl contribution in there aswell. Thanks for the update/

                            Comment


                            • #15
                              Originally posted by ^Lele^ View Post
                              If at all possible (not a given.) it'll take time.
                              For the while you're much better off splitting the faces the material is applied to, and making a mesh light out of it: then you can select that to get the indirect diffuse out of the Light Select.
                              Unless it's a textured LightMtl, and then LPEs are the way to go (with the caveats those imply, absent from standard LS workflow.).
                              It's possible when using a Lightmix.

                              Comment

                              Working...
                              X