Announcement

Collapse
No announcement yet.

Best way scaling map inside shaders globally?

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

  • Best way scaling map inside shaders globally?

    Hi,

    Many times I have this problem: I create a complex shader (let's say it is containing: VRayTriplarTex, tiled bitmap, procedural noise, VRayCuravature, and VRayDirt). Everything is all set, a perfect material and I save it as 3dsMax scene.

    Then new project comes in; I want to reuse my shader. However the scale of new geometry doesn't fit the shader, I need to readjust it's UV tiles, Radius of VRayDirt, Scale of VRayCurvature..., etc. to make it same appearance as my old scene. Is there anything like a modifier or something I can scale up (or down) my shader globally? And if I collapse that modifier, it automatically updates all it's UV tiles, Radius of VRayDirt of my shader.


    Rgds,

    Chen

  • #2
    Your shaders should be made with real world scale, thus all you do with the new geometry is apply a UV map with real world scale. (After you make sure the new geometry is correctly to scale and reset the xform if you need to rescale it, which seems to happen with some clients files of mine)

    Real world scale does not work with 2d displacement however, so keep that in mind.
    WerT
    www.dvstudios.com.au

    Comment


    • #3
      For 2d textures (no vraydirt, curvature etc) you can use this shader:
      http://www.rensheeren.com/blog/osl-uvtransform/

      For other parameters you could possibly hook up the parameters with a multiplier when you create the shader, so you only need to adjust one parameter instead of many.
      Rens Heeren
      Generalist
      WEBSITE - IMDB - LINKEDIN - OSL SHADERS

      Comment


      • #4
        Originally posted by werticus View Post
        Your shaders should be made with real world scale, thus all you do with the new geometry is apply a UV map with real world scale. (After you make sure the new geometry is correctly to scale and reset the xform if you need to rescale it, which seems to happen with some clients files of mine)

        Real world scale does not work with 2d displacement however, so keep that in mind.
        tks, will try it out.

        Comment


        • #5
          Originally posted by Rens View Post
          For 2d textures (no vraydirt, curvature etc) you can use this shader:
          http://www.rensheeren.com/blog/osl-uvtransform/

          For other parameters you could possibly hook up the parameters with a multiplier when you create the shader, so you only need to adjust one parameter instead of many.
          looking pretty good tools, thanks for sharing.

          It is tedious to hook up those parameters, I wish they make a modifier or utility for this kind task.

          Comment


          • #6
            I haven't tried it (kinda racing the clock right now) but isn't that exactly what the UVWXform modifier is for?

            Comment


            • #7
              Originally posted by Deflaminis View Post
              I haven't tried it (kinda racing the clock right now) but isn't that exactly what the UVWXform modifier is for?
              The UVWXform modifier only transforms UVW coordinates, so stuff like VRayDirt size, TriplanarTex scale or EdgeTex radius aren't affected.

              Comment


              • #8
                I see. Interested to see if a solution comes up, good to keep in mind in the future.

                Comment


                • #9
                  Nothing all-encompassing that i can think of as a solution.

                  It is however quite trivial to script an interface to edit a selected object material's maps, catering for the presence and use of UVs, or the scaling needed for object/world XYZ placement.

                  The best way would be to make the shader be scale invariant, so drop things like dirt for curvature, where applicable, and so on, and make strong use of correct UV mapping where possible.
                  Anything explicitly referencing a world size will have to be manually refactored.
                  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


                  • #10
                    Might I suggest http://reformstudios.com/2016/04/21/...ssion-control/
                    Not entirely universal, but you can list all the vrayDirt maps in one view, and then apply a multiplier to any of the parameters as desired.
                    Patrick Macdonald
                    Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



                    Comment


                    • #11
                      Thank you guys for all the input, I thought ShaderFX might help, but it does not integrate well with Slate editor. So I guess best practice is to keep all my assets in the right scale.

                      But I hope we have this kind of utility in the future, definitely streamline our workflow.

                      Comment


                      • #12
                        Found "MapScalar modifier" fix most of my problem

                        Comment


                        • #13
                          Originally posted by hammerbchen View Post
                          Found "MapScalar modifier" fix most of my problem
                          Nice fine, I'd forgotten about this one.
                          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


                          • #14
                            Wow look at that! Never knew Map Scaler existed, thanks!
                            Rens Heeren
                            Generalist
                            WEBSITE - IMDB - LINKEDIN - OSL SHADERS

                            Comment

                            Working...
                            X