Announcement

Collapse
No announcement yet.

Vray inner workings

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

  • Vray inner workings

    Good day forum, I'm a new user that's starting to get into Vray. I'm very curious about how Vray works but I'm having a hard time understanding it. I read everything I could about the software in the last few weeks and that's what I came up with:

    1.Primary rays are traced by the Image Sampler, at least 1 per pixel (?). They check what objects are visible, bring back infos about materials, etc. From this "base image" the secondary effects will be calculated; from GI to Reflections to Antialias.

    2.Secondary rays are traced from the intersection points of the Primary rays with the objects. They calculates GI, Refractions, Reflections, DOF, etc; the so-called "blurry effects".
    -The max number of secondary rays that can be traced is set by the Subdivs settings found in various tabs of VRays.
    -The adaptability of those rays is managed by the DMC Sampler.
    -The first bounces are calculated by the Primary Engine; subsequent bounces are calculated by the Secondary Engine.

    3.The Image Sampler can now add antialiasing to the complete image.
    -Fixed will just sample every pixel according to a fixed value;
    -Adaptive subds is adaptive, capable of oversampling and undersampling;
    -Adaptive DMC for some reason is related not only to the shooting of Primary Rays and calculation of Antialiasing, but will also add a further degree of adaptability to Secondary rays; every Primary ray shot by this sampler will spawn a number of secondary rays that's equal to Max Subdivs setting (found in the DMC Sampler) divided by Subdivs setting of every secondary effects. Maybe this was designed to make an image sampler not only capable of tracing primary rays and antialiasing but also capable of dealing with secondary rays?
    The other two samplers are completely detached from Secondary rays and from the DMC Sampler (?).


    Did I got this right?

  • #2
    You've got the basic ideas there. Here are a few links that might aid in your understanding:

    Toni Bratincevic's excellent Demystifying V-Ray DMC Sampler article:
    http://www.interstation3d.com/tutori...yfing_dmc.html

    My V-Ray DMC Calculator:
    http://www.cggallery.com/tutorials/dmc_calculator/
    Akin Bilgic | CGGallery.com
    Modeler & Generalist TD

    V-Ray Render Optimization
    V-Ray DMC Calculator

    Comment


    • #3
      Like RockinAkin said - you've got the basic idea of how Vray traces rays internally.

      Primary rays are traced by the Image Sampler, at least 1 per pixel (?) - this is true for Fixed and Adaptive DMC samplers, Adaptive Subdivision Sampler could trace 1 ray for a few pixels it is called under-sampling. Here you could find more information about that sampler:

      http://help.chaosgroup.com/vray/help...pler.htm#asubd

      The other two samplers are completely detached from Secondary rays and from the DMC Sampler (?). Thats true - only Adaptive DMC sampler is connected with the Secondary Rays adaptability. This connection exist due to some optimizations - since Adaptive DMC sampler sometimes is used with very high Max Subdivisions values (1/50) in order to clean some very finer detail like hair and let's say that for the worst case Vray will shoot 50 subdivisions(2500 samples) per a single pixel and then each of those 50subdivs(2500 samples) will shoot another 8(default) subdivisions (64 samples) - the total number of the rays will be:
      50(2500)*8(64) = 400subdiv(160 000samples) per pixel - which of course will lead to very slow rendering.

      From another stand point - the more Primary Rays are fired the less DMC rays are needed in order to generate a clean blurry result.
      For example if you have Fixed Image Sampler with value 1 and Material Subdivisions equals 8 this means Vray will shoot a single Primary Ray per pixel and then 8subdiv(64 rays) DMC rays for that pixel - however if we reverse those values i.e. Fixed = 8 Material = 1 Vray will shoot 8subdivs(64rays) per pixel and then from each of them it will shoot a single DMC rays.
      In both cases the final number of the rays is the same which means that the quality will be also the same. That's why the connection between the Adaptive DMC Max subdivisions and DMC rays subdivision exists.
      Svetlozar Draganov | Senior Manager 3D Support | contact us
      Chaos & Enscape & Cylindo are now one!

      Comment


      • #4
        Originally posted by RockinAkin View Post
        You've got the basic ideas there. Here are a few links that might aid in your understanding:

        Toni Bratincevic's excellent Demystifying V-Ray DMC Sampler article:
        http://www.interstation3d.com/tutori...yfing_dmc.html

        My V-Ray DMC Calculator:
        http://www.cggallery.com/tutorials/dmc_calculator/
        Thank you, that article was the basis from which I started learning how Vray works. By the way I remember interacting with you on another forum about CG, it's a small world (your calculator is great).




        Originally posted by svetlozar_draganov View Post
        Like RockinAkin said - you've got the basic idea of how Vray traces rays internally.

        Primary rays are traced by the Image Sampler, at least 1 per pixel (?) - this is true for Fixed and Adaptive DMC samplers, Adaptive Subdivision Sampler could trace 1 ray for a few pixels it is called under-sampling. Here you could find more information about that sampler:

        http://help.chaosgroup.com/vray/help...pler.htm#asubd

        The other two samplers are completely detached from Secondary rays and from the DMC Sampler (?). Thats true - only Adaptive DMC sampler is connected with the Secondary Rays adaptability. This connection exist due to some optimizations - since Adaptive DMC sampler sometimes is used with very high Max Subdivisions values (1/50) in order to clean some very finer detail like hair and let's say that for the worst case Vray will shoot 50 subdivisions(2500 samples) per a single pixel and then each of those 50subdivs(2500 samples) will shoot another 8(default) subdivisions (64 samples) - the total number of the rays will be:
        50(2500)*8(64) = 400subdiv(160 000samples) per pixel - which of course will lead to very slow rendering.

        From another stand point - the more Primary Rays are fired the less DMC rays are needed in order to generate a clean blurry result.
        For example if you have Fixed Image Sampler with value 1 and Material Subdivisions equals 8 this means Vray will shoot a single Primary Ray per pixel and then 8subdiv(64 rays) DMC rays for that pixel - however if we reverse those values i.e. Fixed = 8 Material = 1 Vray will shoot 8subdivs(64rays) per pixel and then from each of them it will shoot a single DMC rays.
        In both cases the final number of the rays is the same which means that the quality will be also the same. That's why the connection between the Adaptive DMC Max subdivisions and DMC rays subdivision exists.
        Thank you, this cleared a lot, it's great to hear from the developers themselves.
        So in other words Adaptive DMC was developed to render blurry effects-heavy scenes without wasting away enormous quantities of rays. I started using Vray in university and now that my career is about to start I decided to keep using it and buy a licence for myself. As I said I read a lot about the software, both the official help files and third-party materials, but I still can't get a couple of points:

        1-When does the Image Sampler add antialiasing? I assume that the it has to add it as the very last stage of the rendering process, when the image is already complete. At the same time, the Image Sampler traces the primary rays, and that's the very first step in the rendering process; but if the sampler would calculate the antialias at that moment, the secondary effects (GI, reflections, etc) would be left without antialiasing because they still haven't been calculated. I theorized that the Image Sampler works in two steps: it first renders a very basic "base picture", tracing 1 ray per pixel (like in the old raycasting); from that base picture it calculates the blurry effects, adding GI, area shadows, refractions, etc with secondary rays; as a final step, it retraces primary rays according to the Image Sampler settings, and add antialiasing on top of everything. Am I correct in this assumption?

        2-The Adaptive Subdivision sampler uses Min/Max rate instead of Min/Max Subdivs; I read contrasting information about what's the real number of samples here. I think it uses the infinite series 1, 4, 16, 64, 256, etc as in:
        rate of 0: 1 sample for pixel
        rate of 2: 4 samples for pixel
        rate of 3: 16 samples for pixel
        rate of 4: 64 samples for pixel
        rate of 5: 256 samples for pixel
        rate of -5: 1 sample for 256 pixels

        Thank you for your time.

        Comment


        • #5
          1-When does the Image Sampler add antialiasing?

          In Vray the whole rendering is based on the anti-aliasing, it begins with the first fired ray in the scene and it ends when all the pixels are calculated and arranged.
          It works like this - each pixel of the final image is represented by a single color, in order to determine this color as close as possible Vray have to calculate a lot things, like how many objects could be seen through this pixel , what are the materials of those objects , how much direct/indirect lights is captured on their surface and etc. Once all those rays are calculated their result is averaged and this is the final color of the pixel. So the anti-aliasing process start with shooting primary/camera rays , then from each primary ray contact point with geometry another group of DMC rays are fired , the result from those DMC rays is averaged and this is the final color for that particular primary ray. When all primary rays for those pixel are calculated their result is again averaged and this is the final color of the pixel. So the anti-aliasing according to my opinion is not on top of everything - it is just everything.

          2-The Adaptive Subdivision sampler uses Min/Max rate instead of Min/Max Subdivs;

          The word Rate is used because it is different from Subdivisions - they both determine the amount of samples/rays which will be fired.
          Subdivisions is the square of the Samples value i.e.

          Subdivision * Subdivision = Samples
          1*1 = 1
          2*2 = 4
          3*3 = 9
          4*4 = 16 and etc

          Rate means Samples = 2 on power of rate (2^rate) i.e.

          (rate -2) - 2 on power of -2 = 0.25 Samples per pixel (1 Sample per 4 pixels)
          (rate -1) - 2 on power of -1 = 0.5 Samples per pixel (1 Sample per 2 pixels)
          (rate 0) - 2 on power of 0 = 1
          (rate 1) - 2 on power of 1 = 2
          (rate 2) - 2 on power of 2 = 4
          (rate 3) - 2 on power of 3 = 8 and etc
          Svetlozar Draganov | Senior Manager 3D Support | contact us
          Chaos & Enscape & Cylindo are now one!

          Comment


          • #6
            I am new to the forum and I really love this thread, after using vray for sometime I can say that I can get fairly decent images with the limited knowledge I have. I always had a few issues when anyone at all tries to explain how vray works (not a technical guy). First of all

            How are rays shot from a camera? I just assumed that its like a real life camera and some flash of light emits and those are the rays from the camera, Idk.

            second

            When will there ever be a tutorial for non technical persons such as myself? I saw the demo done on novedge's website and I see that vray 3.0 now has a quick settings option, Can I simply use the new quick settings for all my scenes?

            i am really waiting for a great tutorial that finds a new way to explain this software, its frustrating using something to make great images but having to guess proper settings or have such limited knowledge of it. I am really speaking for myself but If there are others like me say something maybe
            Intel core i7-5960x cpu @3 GHz, GeForce GTX 970

            Comment


            • #7
              Originally posted by vray.curiosity View Post
              How are rays shot from a camera? I just assumed that its like a real life camera and some flash of light emits and those are the rays from the camera, Idk.
              Hi,

              Basically the Camera (Primary) rays are traced from the camera into the scene in order to determine what will be visible in the final image. You can imagine this as a grid in front of that camera representing resolution of your final render and vectors shot from the center of the camera, pass through the grid and hits an object in the scene.
              Then depending on the surface other rays are being shot (Shadow rays, reflection rays, refraction..e.t.c).

              You can see an example illustration of this process in our documentation here:
              https://confluence.chaosgroup.com/di...ic+Ray+Tracing


              When will there ever be a tutorial for non technical persons such as myself? I saw the demo done on novedge's website and I see that vray 3.0 now has a quick settings option, Can I simply use the new quick settings for all my scenes?
              We have some basic tutorials available here:
              https://confluence.chaosgroup.com/di...RAY3/Tutorials
              Also you could check our YouTube channel - ChaosGroupTV where we have a lot of tutorials and demo videos. Try the Search option and find the ones you are interest, for an example "Interior".

              The new Quick settings tool allows you to setup the major render settings and options very quickly. It could be used to control the final render quality/speed without worrying about all the different V-Ray options available in the Render Setup dialog.
              Tashko Zashev | chaos.com
              Chaos Support Representative | contact us

              Comment


              • #8
                thanks tashko.zashev, so you say the rays are first traced from the camera which means the light rays are out there bouncing around and as soon as a camera comes into the scene it tries to figure and follow the path of these light rays is it? and i will try vray 3.0 if its available for trial but having not to worry a whole lot about anti aliasing details would be amazing but then again in the back of my mind i think i would be short changing myself somehow by not knowing.
                Intel core i7-5960x cpu @3 GHz, GeForce GTX 970

                Comment


                • #9
                  Light Rays are fired from the all places where Camera Ray hits geometry. In fact almost all rays are fired from that place and this is necessary from optimizations stand point, there is no need to calculate objects which are not visible in the final render.

                  On the link bellow you could find some very basic Raytracing theory including very simple sketch how the rays are fired:
                  http://docs.chaosgroup.com/display/V...ic+Ray+Tracing
                  Svetlozar Draganov | Senior Manager 3D Support | contact us
                  Chaos & Enscape & Cylindo are now one!

                  Comment

                  Working...
                  X