Announcement

Collapse
No announcement yet.

Determining correct falloff

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

  • #16
    Haha! awesome man
    Now we can use the osl in both falloff slots and have a linear result. Thanks!

    So problem solved Grant, just need to use this little osl for correcting all your reflection maps

    Click image for larger version

Name:	perrrrfect.png
Views:	1
Size:	47.8 KB
ID:	855884

    Originally posted by Wobi View Post
    Yes, that does it:

    facing_ratio_linear.osl
    Code:
    shader facing_ratio_linear (
           output color Col_Out = color(0.5)
    )
    {
           float floatOut = acos (1.0 - (1 - (dot(normalize(N), normalize(I))* -1)))/(M_PI * 0.5);
           Col_Out = color(floatOut  , floatOut , floatOut );
    }
    Thanks Vlado!

    Comment


    • #17
      Haha! awesome man
      Now we can use the osl in both falloff slots and have a linear result. Thanks!
      In fact, you don't even need to use a falloff map anymore. You can just use an output map to alter the curve, since this should be a little bit more effective for computation, I guess.

      Comment


      • #18
        Yes, if you can recreate the same curve with an Output map, it's probably going to be somewhat more efficient than the OSL shader (there's some overhead involved with OSL, even if the shader is just one line).

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

        Comment


        • #19
          Now, could someone also show the difference this has on a material? Just curious to know if this was all worth it
          A.

          ---------------------
          www.digitaltwins.be

          Comment


          • #20
            Originally posted by Vizioen View Post
            Now, could someone also show the difference this has on a material? Just curious to know if this was all worth it
            It was worth it!
            Click image for larger version

Name:	Falloff Test RGB2.jpg
Views:	1
Size:	50.0 KB
ID:	855891
            Dan Brew

            Comment


            • #21
              Originally posted by Wobi View Post
              Yes, that does it:

              facing_ratio_linear.osl
              Code:
              shader facing_ratio_linear (
                     output color Col_Out = color(0.5)
              )
              {
                     float floatOut = acos (1.0 - (1 - (dot(normalize(N), normalize(I))* -1)))/(M_PI * 0.5);
                     Col_Out = color(floatOut  , floatOut , floatOut );
              }
              Thanks Vlado!
              I am vray 2.40 user, how can use the file?
              Best regards,
              Jackie Teh
              --

              3ds max design 2023, V-Ray 6, Update 2.1 [6.20.06 build 00000]
              AMD Threadripper 1950X @3.40 GHz | 64GB RAM | Nvidia RTX 3070 ti
              Website: https://www.sporadicstudio.com
              Email: info@sporadicstudio.com
              YouTube: https://www.youtube.com/c/SporadicStudio

              Comment


              • #22
                Originally posted by jackieteh View Post
                I am vray 2.40 user, how can use the file?
                As mentioned earlier it turns out that you can just as well use an Output map so don't worry about that OSL shader.

                mekene

                Comment


                • #23
                  Yes, if you can recreate the same curve with an Output map, it's probably going to be somewhat more efficient than the OSL shader (there's some overhead involved with OSL, even if the shader is just one line).
                  What I originally meant is that you don't need to put the OSL-Shader into a falloff map, but you can just use an output map with the OSL-Shader put into it. Since the output-map does less calculation then the falloff-map.

                  As mentioned earlier it turns out that you can just as well use an Output map so don't worry about that OSL shader.
                  Of course you can use an output map, but this will be not as precise as the OSL-Shader, since this will give you just an "eyeballed" curve and not a mathematically correct curve...

                  Comment


                  • #24
                    Plugging it into both slots of the falloff would make it quick and easy to convert old materials, where some folks have spent hours trying to match those pesky reflection curves

                    When making new materials, it does make more sense to run the osl through the Output map.
                    Last edited by viscorbel; 21-04-2015, 03:51 AM.

                    Comment


                    • #25
                      I'd say the difference between the eye-balled Output curve and the OSL curve would be so negligible as to not warrant the extra slow-down from OSL.

                      Thanks for bringing this up. Very very interesting, we've used Falloff maps in ExtraTex render elements and used them in comp to mask things and we've notice oddities that we were thought to some weird gamma issue. This makes a lot more sense all of a sudden.

                      I've reported this to heading of rendering engineering at Autodesk and it surprised him as well.
                      Maxscript made easy....
                      davewortley.wordpress.com
                      Follow me here:
                      facebook.com/MaxMadeEasy

                      If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

                      Comment


                      • #26
                        Originally posted by Wobi View Post
                        What I originally meant is that you don't need to put the OSL-Shader into a falloff map, but you can just use an output map with the OSL-Shader put into it. Since the output-map does less calculation then the falloff-map.
                        Ok, I misunderstood the original post. Sorry.
                        How would the final material setup look then when using the shader in an output map ?

                        mekene

                        Comment


                        • #27
                          That should be something like this:

                          OSL-Texture -> Output-Map -> Reflection-Color of VRay-Material

                          Since the OSL-Shader is like a Falloff-Map, just with a linear Falloff, there is no need to plug this into a Falloff-Map again. Of course, as Viscorbel mentioned, it makes sense when updating old materials which already have a custom curve in the Falloff-Map.

                          Cheers,
                          Ben
                          Attached Files

                          Comment


                          • #28
                            It would be pretty cool to have enhanced curves wihtin the VrayHDR Loader. So that you could save and load curves from a preset file
                            as well as script access (without the need to animate them in the first place).

                            Comment


                            • #29
                              Originally posted by samuel_bubat View Post
                              It would be pretty cool to have enhanced curves wihtin the VrayHDR Loader. So that you could save and load curves from a preset file
                              as well as script access (without the need to animate them in the first place).
                              +1 for a VRayOutputMap with better animation controls.

                              Technically the VRayLut or VrayICC already does this if someone wants to make a LUT to convert a Falloff to a linear Falloff.
                              Maxscript made easy....
                              davewortley.wordpress.com
                              Follow me here:
                              facebook.com/MaxMadeEasy

                              If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

                              Comment


                              • #30
                                Is this OSL only for reflection or should we use it on the Gloss Falloff as well ?

                                Click image for larger version

Name:	comp2.jpg
Views:	1
Size:	239.5 KB
ID:	855898
                                Using the falloff from the toycar in episode 04.
                                Last edited by dubcat; 21-04-2015, 06:00 AM.

                                Comment

                                Working...
                                X