Announcement

Collapse
No announcement yet.

Complex fresnel using VRayOSLtex

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

  • #46
    Looks pretty cool! So OSL material is like IES for lights? Real world accuracy?

    Comment


    • #47
      Originally posted by artmaknev View Post
      Looks pretty cool! So OSL material is like IES for lights? Real world accuracy?
      Scanned materials would better qualify for this maybe ? OSL is just a shading language.

      mekene

      Comment


      • #48
        Originally posted by theedge View Post
        Scanned materials would better qualify for this maybe ? OSL is just a shading language.
        Yeah scanned> All. So lets start making home made scanner!
        CGI - Freelancer - Available for work

        www.dariuszmakowski.com - come and look

        Comment


        • #49
          Originally posted by artmaknev View Post
          Looks pretty cool! So OSL material is like IES for lights? Real world accuracy?
          No, osl is just a coding language that you can program texture maps and materials in. The map all the lovely people here has written just lets you use proper values for metals. Metals have a slightly different type of reflectivity to other things like plastic and glass and so the fresnel we have in the vray material doesn't have enough control to get something accurate. The vray material only has a single value for fresnel, the index or refraction, and this is too simple for metals. Metals need a refractive index (which is normally called the "n" value) and then another value called an extinction coefficient (a "k" value). With the two of those, you'll be able to get reflection curves that behave properly for metals. What's been linked on this page is a few different poster's osl map that makes a curve using the n and k values.

          There's a site called http://refractiveindex.info/ which has some data for various different types of metals. They've gotten samples of different types of metals and measured them to get their reflection levels and rather usefully you can get those levels back as N and K values, and with the different OSL maps we now have, we're able to use those n and k values to get the same reflection levels as the samples scanned. One relevant point though is that the data they have on the site is for the very specific metal object they scanned. Say for example you're trying to recreate a gold object and you have some reference photos that you're trying to match. Just by using the data on their site for gold, you'll end up getting the look of the gold object they scanned in, and the gold in their object may be more or less pure gold than the reference photo you're trying to match. The point is that scanned data is a very good starting point, but if it isn't the look you're trying to get right away, you'll still need to use your eye a bit to tweak things after.

          Comment


          • #50
            Thanks for the explanation, very useful!

            I wish there would be some kind of bridge between that site and s UI in max, it would be great to have that kind of site being a repo/database of shaders inside max, like a library. And if it's reading straight from the site, it would be growing/updating constantly.

            Stan
            3LP Team

            Comment


            • #51
              Updated the original OSL files with n and k removed from the UI as it was a bit misleading, you are choosing a color and not inputting the n and k directly.


              Originally posted by joconnell View Post
              The point is that scanned data is a very good starting point, but if it isn't the look you're trying to get right away, you'll still need to use your eye a bit to tweak things after.
              agreed

              Comment


              • #52
                i am a vray 2.40.04 user, i want to try the vrayOSLtex, but i cannot find this vrayOSLtex in my material editor, cannot anyone tell me where can get this?
                Best regards,
                Jackie Teh
                --

                3ds max design 2023, V-Ray 7 [7.00.03 build 32836]
                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


                • #53
                  not sure vray 2.4 supported osl maps.

                  Comment


                  • #54
                    Yes, OSL was added in V-Ray 3.0 officially.

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

                    Comment


                    • #55
                      Quick question, there is some material without K value ( http://refractiveindex.info/?shelf=3...tals&page=salt )
                      So, what K value i have to add ?
                      www.deex.info

                      Comment


                      • #56
                        None
                        n and k values as well as complex fresnel are only needed for metals.

                        Materials with just the n value - use the default vray fresnel option and set IOR=n

                        Originally posted by bigbossfr View Post
                        Quick question, there is some material without K value ( http://refractiveindex.info/?shelf=3...tals&page=salt )
                        So, what K value i have to add ?

                        Comment


                        • #57
                          Originally posted by viscorbel View Post
                          None
                          n and k values as well as complex fresnel are only needed for metals.

                          Materials with just the n value - use the default vray fresnel option and set IOR=n
                          Thanks, but i need to do this for each wavelength (RGB). So i can not use the IOR.
                          So we need to modified the OSL to add the possibility to activate or not K ?
                          www.deex.info

                          Comment


                          • #58
                            Not really, for materials that have greyscale specular reflections, it's enough to use the average visible light wavelength - 0.55
                            If you compare the results between the 3 rgb values, you will see that the change of IOR is in the range of 0.01 ... which is really not something you should worry about.

                            Originally posted by bigbossfr View Post
                            Thanks, but i need to do this for each wavelength (RGB). So i can not use the IOR.
                            So we need to modified the OSL to add the possibility to activate or not K ?

                            Comment


                            • #59
                              Modest attempt to create C++ Texmap plugin based on Vlado OSL code... Very much I hope that Vlado won't tear off to me the head Credits will be added and plugin will be free (if everything is ok) - it's my first attempt with Texmap C++ plugin (with geometry a bit simpler).
                              Click image for larger version

Name:	compFresnel_test001.jpg
Views:	1
Size:	233.8 KB
ID:	855931
                              So far more or less works and on V-Ray 2.x.x.
                              Regimantas Valiukas
                              SIGER STUDIO
                              www.sigerstudio.eu

                              Comment


                              • #60
                                Hehe nice; of course I don't mind.

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

                                Comment

                                Working...
                                X