Announcement

Collapse
No announcement yet.

Caustics and memory issues

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

  • Caustics and memory issues

    Since I dont consider this a bug but rather a underwork I post this here.
    When having a scene with multiple objects casting caustics, vray tends to perform big memory jumps on calculating caustics map. In this example I have 780 boxes casting causctis onto a plane in image 1. Spot light with decay and its cone is spreading well beyond the plane which makes light hit all the boxes with no occlusions. Quasi for gi. Caustics map is calculated at 400 mb in memory.



    Next I narrow down the hotspot and fall off of spot light towards the center of the boxe's location. So that the falloff occludes some of the boxes. This makes an intense hit on the caustics calculation, firing the photon map to be in 1.8 gb of ram and pushing this render to 2.5 gb of memory. I got 3gb switch so I can still render this, but barely.



    I did same setup in brazil and brazil was able to render this scene with similar settings with memory under 1 gb.

    Dmitry Vinnik
    Silhouette Images Inc.
    ShowReel:
    https://www.youtube.com/watch?v=qxSJlvSwAhA
    https://www.linkedin.com/in/dmitry-v...-identity-name

  • #2
    Hmm that is pretty damn weird.

    Im guessing that if your casting say 3000 caustic subdivs and the spot light is much bigger than your scene you are loosing alot of the subdivs?
    And when you restrict it to purely around the glass boxes your focusing all the subdivs into caustics?

    MAybe thats how it works..not sure to be honest. It is odd tho.

    Comment


    • #3
      well...in my understanding if the objects are occluded and cast no caustics and vray precalculatest that then it should be less memory less time?..
      I got 2500 caustic subdivs which is default. The same thing happens when there is 200 boxes in the scene.
      Dmitry Vinnik
      Silhouette Images Inc.
      ShowReel:
      https://www.youtube.com/watch?v=qxSJlvSwAhA
      https://www.linkedin.com/in/dmitry-v...-identity-name

      Comment


      • #4
        hmm Maybe,, have you tried with just one bax, and have the spot light really big and render, then focus the spotlight just onto that one box and render....any time difference?

        of course maybe it is just a bug

        Comment


        • #5
          I think DaForce was right, in the first example many the subs are spread out and only a portion are hitting the objects. I usually use a direct light for better control of the distribution. The brazil caustics do look nice especially for less memory overhead.
          Eric Boer
          Dev

          Comment


          • #6
            Yep seems i was right, just did a little test and the results speak for themselves.

            Caustics light subdivs set to 3000 for both tests.
            Spotlight hotspot @ 52mm Just enough to cover cup
            Caustics map size 684.4mb
            Total render time 3m45s



            Spotlight hotspot @ 333mm Way to big but just trying to prove a point
            Caustics map size 19.1mb
            Total render time 1m18s



            And as you can see there is a noticeable difference in the caustics

            So the caustic subdivs are evenly divided over the light area, so the best way to use caustics was the way i did it with a direct light and set the hotspot/falloff to be big enough to just cover the caustics emitting objects. That way you can use lower subdivs but still keep the quality and thus have a lower caustic map size.

            Comment


            • #7
              interesting daforce.
              Chris Jackson
              Shiftmedia
              www.shiftmedia.sydney

              Comment


              • #8
                Yeah i thought so.
                Although ...really.. it makes perfect sense. The light cast the caustic rays at the scene, for each ray that hits a caustic generating mesh its added to the caustic map, for each ray that doesnt hit a caustic generating mesh it gets discarded.
                And obvously the geneartion of the caustic map is alot quick when alot of it is discarded.

                Im curious and want to test out, if it really is worthwhile narrowing the hotspot to encompass just the caustic generating mesh or if you can make it big enough to cover the whole scene and then just up the subdivs, since alot of them get throw away it should be any longer in rendertime to get similar results.
                Although I cant help but thing that casting extra caustic rays has to take longer atleast a little bit and calculating the lost ones also must add abit of time to the equation.

                So i might run a little test when i get the change.

                Have a direct light with a square falloff and a glass cube on a plane.
                Set the hotspot to just encompass the cub and set the caustic subdivs at a nominal level. and render.

                Then double the area of the hostspot and double the caustic subdivs, and render. Now this should roughtl give the same caustic map size as roughly the same amount of caustic rays are being used to create the caustic map. But will the render time be any different? Im thinking it will by only a little because of the extra initial calculation time of casting and remove those unused caustic rays.

                I guess the best way is to have the tight hotspot around the object especially for the point of repeatablility...cause you would know what subdivs worked best, where if you had the larger hotspot your not really sure just how many rays/subdivs are being used for the caustics map

                Mmm somwhat interesting.

                wow....really fleshed that post out didnt I.

                Comment


                • #9
                  V-Ray may use more memory for photons than other engines, since it stores some additional information for each photon. You can limit the number of photons (and thus the RAM for the photon map) by adjusting the Max. density parameter. Using the Max. density wisely you can shoot as many photons as you like.

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

                  Comment


                  • #10
                    i see...imo its an underworked area of vray which needs some love.
                    Dmitry Vinnik
                    Silhouette Images Inc.
                    ShowReel:
                    https://www.youtube.com/watch?v=qxSJlvSwAhA
                    https://www.linkedin.com/in/dmitry-v...-identity-name

                    Comment


                    • #11
                      How does the max density work any differnet to having a focused hotspot and lowering the number of subdivs/photons.


                      Doesnt max density just discard and photons over a certain amount thus making it pointless casting "as may photons" as you want anyway?

                      Although i get the feeling im just not understanding the way max density works.
                      Certainly the times i have used it its given similar effects to just turning down the subdivs.

                      Comment


                      • #12
                        It depends on the values that you type. Even if you use the Max. density, shooting more photons still reduces the noise in the resulting photon map, so subdivs still matter.

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

                        Comment


                        • #13
                          ok it reduces the noise but does it make the actual caustics map more accurate? or is it kind of like blurring it out?
                          Does max density work in a way where it makes the caustics map have less details but still allows you to lower the noise?

                          Comment


                          • #14
                            Originally posted by DaForce
                            ok it reduces the noise but does it make the actual caustics map more accurate? or is it kind of like blurring it out?
                            Does max density work in a way where it makes the caustics map have less details but still allows you to lower the noise?
                            Yep.

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

                            Comment


                            • #15
                              Ahh I see. But for the most accurate you either need a really high max density...in which case why use it. Or just dont use it and increase the subdivs.

                              Cool. Thanks for you help on this Vlado

                              Comment

                              Working...
                              X