how many rays?

Discussion in 'Rendering Technology and APIs' started by Bumpyride, Jul 20, 2006.

  1. Frank

    Frank Certified not a majority
    Veteran

    Joined:
    Sep 21, 2003
    Messages:
    3,187
    Likes Received:
    59
    Location:
    Sittard, the Netherlands
    Well, it's exactly the same as collision detection over time. See the light as expanding rapidly in the form of (ultimately) a set of fast moving and expanding hexagons. And when they intersect, you split them up.
     
  2. Frank

    Frank Certified not a majority
    Veteran

    Joined:
    Sep 21, 2003
    Messages:
    3,187
    Likes Received:
    59
    Location:
    Sittard, the Netherlands
    Anyway, for something completely different: all the really hard problems in 3D tend to break down into not having a good spatial representation of the objects, and/or being able to determine the interactions.

    Isn't that the thing we should all spend lots of time on, and come up with something that does work?
     
    #22 Frank, Aug 2, 2006
    Last edited by a moderator: Aug 2, 2006
  3. KimB

    Legend

    Joined:
    May 28, 2002
    Messages:
    12,928
    Likes Received:
    230
    Location:
    Seattle, WA
    But your choice of resolution is the problem here. It's just intrinsically difficult to find the appropriate resolution setting.

    You could, of course, attempt some sort of hierarchical subdivision of the initial rays, but then it becomes difficult to find the appropriate level of division, and how do you know when you've missed an object entirely just because the resolution was set too low? And what about when you have a small, reflective object (like, say, a glass sculpture) that will require a lot of rays? If you're using a light-source-based dynamic resolution scaling system, it's rather likely that you'll pump a very large number of rays into the space near the sculpture that just aren't needed, and will also pump a large number of rays into regions of the sculpture that are reflected off-screen and never seen.
     
  4. Frank

    Frank Certified not a majority
    Veteran

    Joined:
    Sep 21, 2003
    Messages:
    3,187
    Likes Received:
    59
    Location:
    Sittard, the Netherlands
    Yes, but any way you look at it, you want some kind of geometry/collision detection scheme to determine where you want to send the rays in the first place, and you could even do away with the individual rays completely if you can break that geometry approach down into small enough surfaces. And in that case, a coarse first pass from the lights would also allow you to determine things like transparency, small objects and global lighting all in one go.

    There is nothing stopping you to do the final pass from the screen, and only send the beams you found out to really need. And add the coarse, first pass as global illumination.

    Which was the original question. ;)
     
  5. Ho_Ho

    Newcomer

    Joined:
    Oct 11, 2005
    Messages:
    21
    Likes Received:
    0
    Location:
    Estonia
    First, you could say that tracing dynamic scenes with very good data structures is basically solved. Here are three different papers on BVH/KD-tree hybrid structures. All three of them were designed independently of each other:
    http://graphics.cs.uni-sb.de/Publications/2006/bkd_gh06_final.pdf
    http://graphics.uni-ulm.de/BIH.pdf
    http://www.cgg.cvut.cz/~havran/ARTICLES/rt06submission.pdf <- might be offline from time to time.

    I've seen a 32bit P4 rebuilding the entire tree for ~10k triangles in less than a millisecond. With SAH kd-tree it would have taken ~80-150ms. Tracing the two is roughly equally fast.

    For HW, take a 8-pipeline ASIC running at 285MHz and optimize it. If you get into the same die-area as R600/G80 you should have something with at least 24-32 pipelines running around 500-700MHz. That would evaluate to roughly 1.5-10 billion rays per second on average. Should be good enough for most games for a while :)
    http://graphics.cs.uni-sb.de/~slusallek/Presentations/ANS06.pdf


    How many rays are needed? As have been said, depends on a scene.

    One scenario might be something like this:
    1280x1024 resolution
    adaptive AA with average of 2.5 rays per pixel
    20% of all primary rays generate a secondary ray (reflection, refraction)
    5 pointlights

    Summing those numbers up we have:
    1280x1024*2.5*1.20= ~4M primary rays per frame.
    Each of those rays generate 5 shadow rays totalling in around 20M more shadow rays. Intersecting of the shadow rays is a bit less expensive, I would say that those 20M shadow rays are about as expensive as 16-17M primary rays.

    So, in total we have ~22M rays per frame, at 60FPS around 1.3G rays per second. At 1600x1200 with the same settings it would be around 32M rays per frame or 2G rays per second.

    Current CPU's can archieve around 3-10M rays per second per core, Core2 about twice that.

    If you add stuff like area lights, GI and caustics things will of course get quite messy and much slower but it is the same with current rasterizers.
     
  6. Bumpyride

    Newcomer

    Joined:
    May 19, 2005
    Messages:
    55
    Likes Received:
    2
    Location:
    MS, USA
    I just read a paper about frameless rendering and I thought I'd put it here to see what some people think about it.

    www.cs.virginia.edu/~luebke/publications/pdf/afr.egsr.pdf

    I thought it was appropriate for this thread because this type of sampling is much more appropriate for ray-tracing than rasterizing. At any rate, frameless rendering randomly samples the pixels in the image rather than constructing whole frames before they're displayed. This paper describes an adaptive scheme where the sampling adapts to color gradients in time and space and a deep buffer is kept in order to reconstruct frames from a collection of older samples. When the scene is static it effectively performs anti-aliasing by being able to use older samples, and when the scene is dynamic it emphasizes the rapidly updating newer samples to be more responsive at the expense of image clarity. The paper claims that the adaptive frameless approach can give similar results with as much as 10 times fewer samples than a traditional approach.

    The loss of spatial coherence in the primary rays could be a performance problem, though. It also seems to me that dynamic geometry would need to be updated more rapidly using this approach as the scene is continually traced by random rays. The bound kd-trees that Ho_Ho mentioned can be updated very rapidly for objects that are moving coherently, but this would seem to make those costs even higher. On the other hand, a ten-fold reduction in samples could be a big win.

    Anyway, this isn't a particularly new idea, but I hadn't heard of it before so I thought I'd see what the general feeling towards it is.
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...