Announcement

Collapse
No announcement yet.

Filtering on gradient ramp maps

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

  • Filtering on gradient ramp maps

    Good day everyone,

    I have encountered a problem when rendering gradient ramp maps in 3ds Max 2020 and V-Ray Next 3.1.
    The map is applied to a cylindrical body, and depending on the camera location, the sides are all blurred and out of aligment. If the camera is perpendicular to the stripes everything is perfect, but angle the camera just right and the map is smudged all over the place. This doesn't happen with a bitmap. I've tried different filtering methods (image below is VRayLanczos at 2,0) but this happens with all of them.

    Click image for larger version

Name:	GradientProblem.jpg
Views:	594
Size:	358.6 KB
ID:	1081572

  • #2
    I can't seem to repro the issue here.
    It's best if you send the piece of scene shown here, the exact v-ray version, and a link to this thread, to support (@chaosgroup.com).
    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


    • #3
      I think its the gradient's mapping. I managed to produce similar results with a simple 90-degree rotation of the Ramp or with a Planar UVW map. Arnold seems to produce similar results. Increasing the cylinder sides, changing the coordinate system orientation (UV to VW worked well), or lowering the Ramp's blur seems to mitigate the issue. Do attach the scene here or send it to support as already mentioned.
      Aleksandar Hadzhiev | chaos.com
      Chaos Support Representative | contact us

      Comment


      • #4
        I indeed used a standard cylinder with its (cylindrical) mapping, and rotated the gradient 90deg. on W.
        The UVs do look good, though, seeing the other bitmap.
        But it could be they are not that simple, and the bitmap masks issues the gradient highlights (f.e. if the UV has broken up atlases, and such.).
        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


        • #5
          Thinking that a bitmap would solve the problem, I rendered the scene with it, and while less apparent, the smudging/blurring is still visible.
          I uploaded a test scene; please ignore the missing XRef error, a link left something I can't quite locate...the zip scene also includes a comparison with mentalray and the result I would expect from either a gradient ramp or a bitmap.
          Attached Files

          Comment


          • #6
            It's got to do with the UVs (they aren't straight. try with a uvwunwrap, you'll see).
            Arnold renders it identical, and the bitmap too shows issues when looking at the geo from a different angle than that of the camera.
            The issue is directly visible within the viewports, as well.
            Attached Files
            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


            • #7
              I just tested this and it works perfectly well if you simply reduce the blur, which in the image above is set at 1.0
              All I did was take it to .01 and the it as sharp as one would expect.
              That aside, what it does do with the blur is very odd indeed and looks like it has something to do with the ramp itself - it blurs it in a very unexpected way, heavily biased toward the sides.
              I tried a bitmap of the same stripe and the blur is as expected.
              https://www.behance.net/bartgelin

              Comment


              • #8
                Here is a comparison - very weird ramp stuff. More segments = smoother blur but it's still completely borked
                Attached Files
                https://www.behance.net/bartgelin

                Comment


                • #9
                  Yep, filtering will reveal the issue with distorted UVs.
                  The bitmap as well gets filtered unevenly because of that.
                  It's much better to fix the UV map, though, rather than reduce filtering.
                  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
                    Yeah it's clear that bad uvs will make it a bad result but my example is on a primitive, with or without its own generated coords.
                    So it is the ramp or its implementaion that is inherently broken in some way, it seems.
                    Not a Vray thing though, so probably not anything that can be done about it.

                    EDIT: I just noticed that it only seems to happen when the ramp is set to solid, so if keys are added close enough together to recreate the 'solid' appearance then the problem goes away and the blur can be left at default.
                    Last edited by fixeighted; 19-08-2020, 04:25 AM.
                    https://www.behance.net/bartgelin

                    Comment


                    • #11
                      Standard max map filtering (pyramidal) is simple and poor in results.
                      Summed area is marginally better, at the cost of speed and RAM, but is unavailable for procedurals.

                      Here, i simply added a cylindrical UV and (kinda.) lined it up with the stem (left one.).
                      Issue gone.
                      Attached Files
                      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


                      • #12
                        Thanks everyone, solved it...kinda. I had to straighten the UVs and reduce the blur to 0.2 to get the effet I wanted...with blur left to 1.0, the edges wouldn't be as sharp as I want (attached picture). Nice to know that mentalray wasn't precise enough to pick this up in renders.

                        I say "kinda solved" because I'd like to know if there are specific reasons why V-Ray had such a different way of filtering the gradient ramp and the bitmap in the first message, it almost looks like two mismatched maps for the gradient.

                        Comment


                        • #13
                          Briareos, take a look at the workaround I post above. Make your ramp not solid but linear, then put two markers close together where the colour changes.
                          As long as your uvs are ok this will be the best result I think.
                          In your image it's still warping the map/ramp at the edges.
                          https://www.behance.net/bartgelin

                          Comment


                          • #14
                            Originally posted by fixeighted View Post
                            Briareos, take a look at the workaround I post above. Make your ramp not solid but linear, then put two markers close together where the colour changes.
                            As long as your uvs are ok this will be the best result I think.
                            In your image it's still warping the map/ramp at the edges.
                            I read that, but and I want to keep the gradient with solid interpolation because Max's gradient ramp is finnicky and adding many points too close together will be a nightmare to maintain/modify.

                            I solved the warping above by reducing the blur to 0.2 (image is 1.0). It's good enough for what I want and keeps the gradient simple. Win win

                            Thanks again.

                            Comment


                            • #15
                              Fair enough
                              https://www.behance.net/bartgelin

                              Comment

                              Working...
                              X