Announcement

Collapse
No announcement yet.

What are the light path expressions and how to use them?

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

  • #16
    Yes that's the conclusion I came to; that the very large bucket of info that LPEs represent is nicely cherry-picked in Vray, to provide the unarguably most immediately useful bits that make up e.g. LightMix.
    Anyone who cares to delve further into said bucket can now do so with raw LPEs. I now feel well informed, which is cool. Makes for interesting pub chat too, should they ever reopen that is
    https://www.behance.net/bartgelin

    Comment


    • #17
      Having parity of data between renderers will make a massive difference to us when we jump to vray 5 - the compositors (and pipeline tds) are going to be very very happy!

      Thank you chaos people xx

      Comment


      • #18
        So, i think i understand the general idea. Would i (for example as i need it for my current job) be able to use this to generate a mask for the entire contribution of an object to a scene? Ive got to be able to change background /set colour in post, and this is reflected, refracted, and also colours the scene via gi bounce.

        If so, any helpful instructions available?

        Ive not installed the beta yet, as its a live job, however it might be worth it for this (assuming its faster/better than setting up a seperate scene to generate the mask, as ive done before with great results)

        Comment


        • #19
          You will likely need some post, surely, but most of that can definitely be extracted via Labels.
          They are called "Labels" when they are in an expression, and they are called "Tags" when they are added to a node.

          In this simple test scene:
          Click image for larger version  Name:	rgb.png Views:	0 Size:	189.9 KB ID:	1073617

          Let's say i tagged the sphere with the tag "geo_sphere".

          The LPE would look like this
          Code:
          C.*.'geo_sphere'.*
          The result would be:

          Click image for larger version  Name:	LPE_Geo.png Views:	0 Size:	228.7 KB ID:	1073618

          If instead i wanted the selection by material, which is named "mat_sphere", the LPE would look like this:

          Code:
          C.*.'mmat_sphere'.*
          The m in front of the material label in the LPE identifies it as a Material Tag in the scene, so that the LPE parser knows where to look.
          The results here don't change because the geometry and the material are unique in the scene, and they both point to the sphere.

          Click image for larger version  Name:	LPE_Mat.png Views:	0 Size:	228.7 KB ID:	1073619

          You should notice that you will still need your filter REs as LPEs currently do not capture filter or raw elements, so you'll need to feed those REs to post to be able to effectively edit the textured stuff (trivial, often enough, but a bit more work to be aware of.).

          Lastly, here's an example of a "rough" LPE recomp.
          It's rough because i do not split any of the indirect contributions into specular/Reflection/diffuse (You'd need three LPEs to separate them, one per component.), and so the result is operating on the three at once, including the texture.
          It may be allright for some cases, and entirely inappropriate for others (also depending on the kind of Post operations one will use.).
          For a hue shift, like in my case, on the whole contribution of the object, it can easily be done with the method outlined here, which uses a minus, and a plus, with a CC on the LPE.
          So extremely simple compositing, all in all.



          Click image for larger version  Name:	LPE_Example.jpg Views:	0 Size:	1.09 MB ID:	1073629
          Click image for larger version

Name:	Comp.png
Views:	154
Size:	88.0 KB
ID:	1073630
          Last edited by ^Lele^; 07-06-2020, 10: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


          • #20
            thanks Lele, looks very promising. is the extreme noise in the LPE simply due to a very fast rendertime?

            if its slower to render than just rendering the scene again with desaturated materials and a 100% red set model, and all but set excluded from lights, to capture the interactions (what i did with great effect on the last iteration of the project) then it might not be worth it.. i expect you will suggest i have a play

            the correction is indeed a simple hue shift of the background.. we ended up using the mask i had generated on the final, rebuilt comp, rather than separating by element. it worked fine.

            Comment


            • #21
              Yeah, i rendered it cheap, so it's noisy as heck.
              It looks worse because it's extracted from its context (i.e. it's on black.): you'll notice the effect disappears when added back in.
              There should be absolutely no issue with noise, in the sense that it won't create more because of the LPE.

              The warnings about rendertime are due diligence on our part, not to be taken as the bane of all renders in the universe. ^^
              In the sample above, without the LPE it takes 34.2s, with 35.5s.
              The LPE is a simple one (i.e. it doesn't need to track rays for data very deep.) so mileage may vary depending on count and complexity.
              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


              • #22
                So, i finally found time to install vray5.. ive opened my current scene, added a "vraylightselect" set it to "light path expression" used the expression C.*.'mset'.* -the material i want is called "set"

                hit render, i get no extra elements in the vfb.

                what am i missing?

                i also tried the preset for material contribution, which was C.'mset'.*

                same result.

                i thought maybe i needed to add my lights to the lightselect despite the instructions saying its not necessary, but if i try to add lights, i select them to add, and nothing is added to the list.


                only difference i can see to what Lele set up, is the fact that the object with the "set" material on, is a matte object.

                cant see how that would cause the element to be completely absent from the vfb..?

                Comment


                • #23
                  ok so i got it to work, i had to set the lightselect to another mode, in order to allow adding of scene lights. then swapped back to LPE and it then worked as expected. a bit of a flaky workflow!

                  Comment


                  • #24
                    Originally posted by super gnu View Post
                    ok so i got it to work, i had to set the lightselect to another mode, in order to allow adding of scene lights. then swapped back to LPE and it then worked as expected. a bit of a flaky workflow!
                    Thanks for the pointer, will look into it.

                    Best regards,
                    Vlado
                    I only act like I know everything, Rogers.

                    Comment


                    • #25
                      Originally posted by super gnu View Post
                      ok so i got it to work, i had to set the lightselect to another mode, in order to allow adding of scene lights. then swapped back to LPE and it then worked as expected. a bit of a flaky workflow!
                      That's really strange. Can you give me more information - 3ds Max version, does it happen on a new scene? If it's only happening on a specific scene, can you send it?

                      You shouldn't need to add lights or change the mode to add lights. Also, even if the expression is wrong, the render element should still be visible in the VFB.
                      Radoslav Platikanov | V-Ray R&D

                      Comment


                      • #26
                        Hi, im using max 2018, with the beta2 version.

                        its literally the first render ive done in vray 5, its a live job, and ive signed some very scary NDA's so i cannot share the file. i have to use the LPA's on 6 other similar scenes, so ill let you know if it does the same thing with all of them.

                        Comment

                        Working...
                        X