Announcement

Collapse
No announcement yet.

Unclamped colors

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

  • Unclamped colors

    Is there a trick to make vray render the areas with uncpamped colors faster?
    I have a scene with some rear lights on a car with vray lights inside them, and when rendering with unclamped colors, it takes forever and a half to render the area with the lights.

    -Tom

  • #2
    Okay so Vray uses numerical thresholds to control all of it's sampling. When vray comes to two pixels beside each other that have a lot of contrast, it starts trying to anti alias the pixels and samples until the result it gets back is within your noise threshold. Let's take a dumb example here.

    Say for example you've got one pixel that has rgb values of 0.5,0.5,0.5 - a 50% grey. And then beside that you have a really bright pixel which is about 5.0,5.0,5.0 - a really bright white. When vray compares the two of those pixels it knows the edge where they meet will be quite hard so it starts to sample. So lets say we use a really simple aa filter that samples along the edge where our two pixels meet and gives you a middle value between the two. We'll also say that our threshold number for quality is 0.5. The first pass vray does, it hits the 0.5 grey pixel and 5.0 white pixel, so the gap between these two numbers is 4.5 - 4.5 is way more than our threshold of 0.5 so it'll do one round of sampling. It'll come pack with samples that are halfway between the grey and white pixel, so it'll be around 2.75 (average of 0.5 and 5.0). the gap between 2.75 and 0.5 is still too high (2.25) so vray does more sampling between our 0.5 grey pixel and our new 2.75 value, again makes a value between the two, which is now 1.625. The gap between 0.5 and 1.625 is 1.125 which is still bigger than our threshold of 0.5 so again it'll do more sampling. Again we get a halfway value between 0.5 and 1.625 which is 1.0625, which is bigger than our thresh of 0.5 so off we go again! Finally we get samples between 0.5 and 1.0625 which is 0.78, is the gap between 0.5 and 0.78 less than our threshold of 0.5? YES! About bloody time! So at this stage vray stop sampling and we all get on with our lives. This may not be entirely accurate to the way vray works but it's the rough principle.

    So in terms of your scene, you've got a few choices. One is to clamp the colours so that your very bright colours are more reasonable values to sample. You can clamp the colours down quite a bit without loosing all HDR values so you still get accurate blurs / glows and so on - I did the exact same type of thing as you recently with very bright vray lights inside of a light housing and I was using light values of up around 250 with a very small light (probably not very accurate!) so I was able to lamp the colours down to a value of 5 or 6 - still plenty of brightness left in to do post work and keep very hot values, but potentially a lot easier for vray to sample. Sub pixel mapping can help too while sacrificing a tiny bit of accuracy, what this does is takes all of the raw samples vray gets, and clamps the values down a tiny bit before passing them over to the aa sampler - again it's making the rgb values a bit more normal before vray starts doing it's threshold tests so it'll do less work.

    Comment


    • #3
      Thanks for the long explanation, I have a good grasp on the theory..
      I have tried to clamp at 4, but I felt I lost to much range. I might get away with 8.
      I was hoping that there was a way to sacrifice some of the quality around the hotspots, and still keep the quality on the rest of the image.

      -Tom

      Comment


      • #4
        Seems the only approach is killing the values or comp glows / blurs which at least have a good basis anyway :/

        Comment


        • #5
          It is a tricky issue; I haven't found a good solution so far. One of the proposed solutions was to use the "Don't affect colors" option for color mapping, but still use something like Exponential color mapping or Reinhard with burn close to 0.0 to kill the bright colors when V-Ray does the internal calculations. Then you can reapply whatever color mapping you need in post.

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

          Comment


          • #6
            Here are some practical examples of using the color mapping with "don't affect colors" to control the sampling of overbright areas. The scene is ultra simple - a very bright V-Ray sphere light, Adaptive DMC image sampler with 1/100 subdivs and color threshold 0.005.

            Here are some timings for different color mapping settings and the respective VRaySamplingRate render element. For all images, the "Don't affect colors" option was enabled so that we still get full HDR information in the resulting image.

            The final RGB image (practically the same for all cases):


            Linear color mapping, gamma 1.0, "don't affect colors" enabled, render time: 21.3s


            Exponential color mapping, gamma 1.0, "don't affect colors" enabled, render time: 6.3s


            Reinhard color mapping, burn 0.0, gamma 1.0, "don't affect colors" enabled, render time: 4.5s


            Linear color mapping, gamma 2.2, "don't affect colors" enabled, render time: 6.1s


            Exponential color mapping, gamma 2.2, "don't affect colors" enabled, render time: 5.9s


            Reinhard color mapping, burn 0.0, gamma 2.2, "don't affect colors" enabled, render time: 4.9s


            So as you can see, it can be quite an efficient way to adjust the sampling of HDR colors.

            Note that while the color mapping "Type" controls the sampling of overbright colors, the gamma correction is necessary for sampling dark colors. You can change the gamma value further to control the dark colors sampling (larger gamma values will put more samples in the dark areas).

            Best regards,
            Vlado
            Last edited by vlado; 24-02-2012, 04:57 AM.
            I only act like I know everything, Rogers.

            Comment


            • #7
              Thankyou Vlado, this is a very nice trick.
              Se image for rendertimes - the bottom one is with linear gamma 2,2 donĀ“t affect colors..

              -Tom
              Attached Files

              Comment


              • #8
                There you are then

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

                Comment


                • #9
                  Sneaky - I like it!

                  Comment


                  • #10
                    This thread is most important.
                    They are details which all the VRay users should know.

                    OakCorp Japan - Yuji Yamauchi
                    oakcorp.net
                    v-ray.jp

                    Comment


                    • #11
                      Originally posted by winberg View Post
                      Thankyou Vlado, this is a very nice trick.
                      Se image for rendertimes - the bottom one is with linear gamma 2,2 donĀ“t affect colors..

                      -Tom
                      What mapping type is ther first one?
                      for my blog and tutorials:
                      www.alfasmyrna.com

                      Comment


                      • #12
                        Originally posted by vlado View Post
                        It is a tricky issue; I haven't found a good solution so far. One of the proposed solutions was to use the "Don't affect colors" option for color mapping, but still use something like Exponential color mapping or Reinhard with burn close to 0.0 to kill the bright colors when V-Ray does the internal calculations. Then you can reapply whatever color mapping you need in post.

                        Best regards,
                        Vlado
                        Hi Vlado,
                        I am a bit puzzled.
                        Please confirm if I understand correctly:
                        The "Dont affect colors" option kills any color mapping type. But to use exponential or reinhard mapping still helps to have faster calculations and better AA at brigt points even though we get the unclamped render.
                        Is this what it means?

                        What do you mean to apply color mapping in the post? Do you mean to apply the Vray curves?
                        for my blog and tutorials:
                        www.alfasmyrna.com

                        Comment


                        • #13
                          Pixela you're totally right - "don't affect colours" leaves the final image the same but affects how vray does it's sampling. For example everyone that uses "don't affect colours" but still puts in gamma 2.2 in the gamma value is using it to force vray to sample more in the shadows, which otherwise would be noisy when your compositing program applies the gamma 2.2 curve. Using exponential or reinhard does the same type of thing but instead of putting more samples into the shadows, it's cutting off some of the really bright values when sampling to give you quicker results - in a way it's almost like using clamp output.

                          And colour mapping in post means that both exponential and reinhard are simple colour correction / exposure curves and you can replicate the exact same effect in most compositing programs on a float image.

                          Comment


                          • #14
                            Originally posted by joconnell View Post
                            Pixela you're totally right - "don't affect colours" leaves the final image the same but affects how vray does it's sampling. For example everyone that uses "don't affect colours" but still puts in gamma 2.2 in the gamma value is using it to force vray to sample more in the shadows, which otherwise would be noisy when your compositing program applies the gamma 2.2 curve. Using exponential or reinhard does the same type of thing but instead of putting more samples into the shadows, it's cutting off some of the really bright values when sampling to give you quicker results - in a way it's almost like using clamp output.

                            And colour mapping in post means that both exponential and reinhard are simple colour correction / exposure curves and you can replicate the exact same effect in most compositing programs on a float image.
                            Thanks for the explanation
                            for my blog and tutorials:
                            www.alfasmyrna.com

                            Comment


                            • #15
                              Does the Reinhard-Mapping also help with the problem of speckles in some glossy effects? Sometimes we get considerable "noise" or speckles with extremely high float values. These are really hard to sample.

                              Regards

                              Oliver
                              https://www.behance.net/Oliver_Kossatz

                              Comment

                              Working...
                              X