Announcement

Collapse
No announcement yet.

An assortment of OSL shaders for your perusal

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

  • An assortment of OSL shaders for your perusal

    Hi everybody!

    I have some OSL shaders lined up for you which I'll post here one by one as soon as the page for the shader is done.

    To kick this off I present to you...
    The Reflector!

    Click image for larger version

Name:	reflector_screen.JPG
Views:	1
Size:	38.5 KB
ID:	884638

    Links
    Page:
    http://www.rensheeren.com/blog/osl-reflector/
    Download:
    http://www.rensheeren.com/osl/reflector_tex_v002.osl
    http://www.rensheeren.com/osl/rhfunctions.h
    Save both in the same folder, both are needed for the shader to work. Overwrite rhfunctions.h if asked.

    Features
    - Metals and non-metals. Uses complex Fresnel for metals and switches to non-complex for non-metals for quicker rendering.
    - Polarisation for both, should you want to play around with that.
    - Outside medium IOR, for example for objects under water.
    - Aaaand... rough Fresnel!


    ------ EDIT ------

    I've moved this post here!


    Here's a list of all the shaders posted in this thread instead.

    Overview page on my site here.

    Reflector
    Advanced reflections.

    ShowUDIM
    Shows where you are in UV/UDIM space! In text!

    Merge2
    Merge or blend two inputs using several different operations.

    CamMapScale
    A fix for the annoying CamMapPerPixel scaling feature in max.

    MixNormalMaps
    Blend normal maps together… correctly.

    ChannelSwitcher
    Shuffle or mix channels.

    UVTransform
    Transform textures by moving the UV space around.

    ArchGlass
    Simulate multi-paned window glass with only a single-sided plane object.
    Attached Files
    Last edited by Rens; 15-06-2016, 09:41 AM.
    Rens Heeren
    Generalist
    WEBSITE - IMDB - LINKEDIN - OSL SHADERS

  • #2
    That does look nice. I wonder why vray mtl does not have this by default?
    Dmitry Vinnik
    Silhouette Images Inc.
    ShowReel:
    https://www.youtube.com/watch?v=qxSJlvSwAhA
    https://www.linkedin.com/in/dmitry-v...-identity-name

    Comment


    • #3
      Originally posted by Morbid Angel View Post
      That does look nice. I wonder why vray mtl does not have this by default?
      Because there are only 24 hours in a day? Because we have also 100 other things to do? Like a denoiser, to take an example at random... Or ftupid Maya 2016.5 stuff... Will get to it, but in the meantime, this is exactly why you have OSL.

      Keep in mind that implementing glossy Fresnel properly is not possible with OSL, it must be done in the BRDF implementation itself. You can only get an approximation with OSL.

      Best regards,
      Vlado
      Last edited by vlado; 23-05-2016, 02:19 PM.
      I only act like I know everything, Rogers.

      Comment


      • #4
        Great work Rens, stuck in Clarisse land at the minute but gonna have a dig through this in July - osl seems really useful. Also just finished some film shots with Jan Volckmann - he's great fun to be around and does really subtle comp work.

        Comment


        • #5
          Very cool Rens.
          I'm using your mixNormalMaps map allmost every day. You really deserve your entry
          Looking forward to try this one and see your library grow.
          German guy, sorry for my English.

          Comment


          • #6
            Thanks!

            Originally posted by vlado View Post
            Keep in mind that implementing glossy Fresnel properly is not possible with OSL, it must be done in the BRDF implementation itself. You can only get an approximation with OSL.
            True! It's just a blend between the front facing (0 deg) reflection amount and the Fresnel curve, but it holds up surprisingly well.

            Originally posted by joconnell View Post
            Great work Rens, stuck in Clarisse land at the minute but gonna have a dig through this in July - osl seems really useful. Also just finished some film shots with Jan Volckmann - he's great fun to be around and does really subtle comp work.
            Hey John! How are things? This should work in Clarisse. Oh nice haha, say hi from me. : )
            Rens Heeren
            Generalist
            WEBSITE - IMDB - LINKEDIN - OSL SHADERS

            Comment


            • #7
              Originally posted by Ihno View Post
              Very cool Rens.
              I'm using your mixNormalMaps map allmost every day. You really deserve your entry
              Looking forward to try this one and see your library grow.
              Hehe thanks, glad to be in there. : )
              Oh yeah that reminds me, I'll post that one here as well.
              Rens Heeren
              Generalist
              WEBSITE - IMDB - LINKEDIN - OSL SHADERS

              Comment


              • #8
                And the second one!

                ShowUDIM
                For displaying the current UDIM tile number, very handy when working with UDIMs!

                Click image for larger version

Name:	showudim_rndr2.jpg
Views:	1
Size:	27.5 KB
ID:	862127

                Links
                Page:
                http://www.rensheeren.com/blog/osl-show-udim/
                Download links:
                http://www.rensheeren.com/osl/showUDIM_tex_v001.osl
                http://www.rensheeren.com/osl/rhfunctions.h
                Save both in the same folder (right click, save as), both are needed for the shader to work. Overwrite rhfunctions.h if asked.

                Features
                - Displays the UDIM tile number as text or as a colour value.

                How to use
                – Create a VRay OSL Texture map.
                – Load in the downloaded .osl shader.
                – Create a VRayLightMtl.
                – Plug the OSL map into the color.
                – Disable 'wrap texture coordinates' in the OSL tex!

                Click image for larger version

Name:	showudim_node.JPG
Views:	1
Size:	18.3 KB
ID:	862128
                Click image for larger version

Name:	showudim_ui.JPG
Views:	1
Size:	17.4 KB
ID:	862129
                Click image for larger version

Name:	showudim_wrapdisable.JPG
Views:	1
Size:	22.2 KB
ID:	862130
                Rens Heeren
                Generalist
                WEBSITE - IMDB - LINKEDIN - OSL SHADERS

                Comment


                • #9
                  Originally posted by Rens View Post
                  Displays the UDIM tile number as text or as a colour value.
                  That's very cool

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

                  Comment


                  • #10
                    Originally posted by Morbid Angel View Post
                    That does look nice. I wonder why vray mtl does not have this by default?
                    Well we have OSL. So we do have it. You can't implement all the things into the VRayMtl. I mean sure it would make sense but as I see it it is not a high priority issue since we are able to achieve it with OSL to a certain extend.
                    Software:
                    Windows 7 Ultimate x64 SP1
                    3ds Max 2016 SP4
                    V-Ray Adv 3.60.04


                    Hardware:
                    Intel Core i7-4930K @ 3.40 GHz
                    NVIDIA GeForce GTX 780 (4096MB RAM)
                    64GB RAM


                    DxDiag

                    Comment


                    • #11
                      Both very cool Rens!
                      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


                      • #12
                        Hi Rens,

                        Are these VRay OSL Texture maps compatible with Maya?
                        always curious...

                        Comment


                        • #13
                          yes they should be compatible I haven't checked these, but the iridescence.osl worked.
                          Dmitry Vinnik
                          Silhouette Images Inc.
                          ShowReel:
                          https://www.youtube.com/watch?v=qxSJlvSwAhA
                          https://www.linkedin.com/in/dmitry-v...-identity-name

                          Comment


                          • #14
                            Originally posted by Morbid Angel View Post
                            yes they should be compatible I haven't checked these, but the iridescence.osl worked.
                            Sweet...thanks Dmitry.
                            always curious...

                            Comment


                            • #15
                              Originally posted by vlado View Post
                              That's very cool
                              Thanks! With this it shouldn't be hard to make some 8-bit adventure game in activeshade mode. No need for a boss key hehehe : )

                              Originally posted by Dave_Wortley View Post
                              Both very cool Rens!
                              Thanks! I have a couple more ready to go in the next few days!

                              Originally posted by jasonhuang1115 View Post
                              Are these VRay OSL Texture maps compatible with Maya?
                              I haven't tested it yet, but if thin film works in Maya as Dmitry said then this should hopefully work as well. Texture/colour inputs are different in Max and other applications. The reflector shader just checks to see if VRay is used and then switches the input type, so if it works in Maya with VRay it should work everywhere. : )
                              Rens Heeren
                              Generalist
                              WEBSITE - IMDB - LINKEDIN - OSL SHADERS

                              Comment

                              Working...
                              X