Slashdot Mirror


Ray Tracing for Gaming Explored

Vigile brings us a follow-up to a discussion we had recently about efforts to make ray tracing a reality for video games. Daniel Pohl, a research scientist at Intel, takes us through the nuts and bolts of how ray tracing works, and he talks about how games such as Portal can benefit from this technology. Pohl also touches on the difficulty in mixing ray tracing with current methods of rendering. Quoting: "How will ray tracing for games hit the market? Many people expect it to be a smooth transition - raster only to raster plus ray tracing combined, transitioning to completely ray traced eventually. They think that in the early stages, most of the image would be still rasterized and ray tracing would be used sparingly, only in some small areas such as on a reflecting sphere. It is a nice thought and reflects what has happened so far in the development of graphics cards. The only problem is: Technically it makes no sense."

26 of 266 comments (clear)

  1. This isn't what we need in games by Lurks · · Score: 5, Insightful

    I guess one has to state the obvious in that by moving to a process which is not implemented in silicon, as with current graphics cards, the work must necessarily be done in software. That means it runs on CPUs and that's something Intel is involved in where as when you look at the computational share of bringing a game to your senses right now, NVIDIA and ATI/AMD are far more likely to be providing the horsepower than Intel.

    But really, even if this wasn't a vested interest case (and it may not be, no harm exploring it after all) - the fact remains that we don't actually need this for games. Graphics hardware has gone down an entirely different route whereby you write little shader programs which create surface visual effects on top of the bread and butter polygons and textures. This is a well established system by now and has a naturally compressive effect. It's like making all your visual effects procedural in nature rather than giving objects simple real-world textures and then doing a load of crazy maths to simulate reality. It works very well. Rememeber a lot of the time you want things to look fantastical and not ultra-realistic so lighting is some of the challenge.

    Games aren't having a problem looking great. They're having a problem looking great and doing it fast enough and game developers are having a problem creating the content to fill these luscious realistic-looking worlds. That's actually what's more useful, really. Ways to aid game developers create content in parallel rather than throwing out the current rendering strategy adopted world wide by the games industry.

    1. Re:This isn't what we need in games by darthflo · · Score: 3, Insightful

      Keep in mind recent parallelization advances. According to TFA, raytracing performance scales almost linearly with the number of processors (factor 15.2 for four quadcore machines connected via GigE over a single core); both Crossfire and SLI don't scale remotely that great.
      If the parallelization trend continues like it's progressing now, manicore CPUs are probable to arrive before 2010. Also, both AMD and Intel appear to be undertaking steps in the direction of enthusiast-grade multi-socket systems, increasing the average number of cores once again. Assuming raytracing can be parallelized as gread as TFA makes it sound, rendering could just return to the CPUs. I'm no expert, but it does sound kinda nice.

    2. Re:This isn't what we need in games by Anonymous Coward · · Score: 1, Insightful

      Ray-tracing uses shaders too but in a more natural way. They define how an object is shaded, how light reflects on an object. That's what shaders in rasterizers are used for too, but they also use them to emulate a lot of effects that come naturally in ray-tracing. Shadows, reflections, lighting, ambient lighting...

      Ray-tracing versus rasterizing has little to do with fantastical versus ultra-realistic. All cgi in movies is rendered with ray-tracing (pixar's renderman is technically a rasterizer though, but not like the one used in games). Cars, Nemo, ... don't look realistic, they look fantastical.

      Ray-tracing gives the designers much more freedom. It's better in every way, except for speed.

  2. Wow. by SCHecklerX · · Score: 2, Insightful

    I remember some scenes that I would create with PoV to sometimes take several hours for a single frame to complete. Now we're looking at doing it in real time. Amazing.

  3. Now hear this by suso · · Score: 4, Insightful

    I get tired of hearing this talk about real time ray tracing. They might be able to get basic ray tracing at 15 frames per second or more. But it won't matter, the quality won't be as good as some of the high quality images that you see that take hours to render. Sometimes days.

    See, the two are incompatible because the purpose is different. With games, the idea is "How realistic can we make something look at a generated rate of 30 frames per second". But with photorealistic rendering the idea is "How realistic can we make something look, regardless of the time it takes to render one frame."

    And as time goes on and processors become faster and faster, the status quo for what people want becomes higher. Things like radiosity, fluid simulations and more becomes more expected and less possible to do in real time. So don't ever count on games looking like those still images that take hours to make. Maybe they could make it look like the pictures from 15-20 years ago. But who cares about that? Real time game texturing already looks better than that.

    1. Re:Now hear this by IceCreamGuy · · Score: 5, Insightful
      from TFA:

      At HD resolution we were able to achieve a frame rate of about 90 frames per second on a Dual-X5365 machine, utilizing all 8 cores of that system for rendering. The quote is referring to Quake 4. So they already can raytrace a semi-modern game at 90 FPS, and they have a graph that very clearly shows raytracing at a performance advantage as complexity increases. Just look at the damn graph (page three), the point where raster performance and raytracing performance intersect can't be more than a couple years off, and it's apparent that we may even have crossed that point already. Continue becoming tired of hearing about raytracing, the rest of us will sit patiently as the technology comes of age. Personally, I'm tired of hearing about this HD stuff, I mean, it's not like HD TVs will ever be mainstream, with their huge pricetags and short lifespans. Oh wait...
    2. Re:Now hear this by suso · · Score: 4, Insightful

      The quote is referring to Quake 4. So they already can raytrace a semi-modern game at 90 FPS, and they have a graph that very clearly shows raytracing at a performance advantage as complexity increases. Just look at the damn graph (page three),

      I don't have to look at the damn graph to tell you that what people are going to want is this

      And what they are going to get is this

      And, they should just be happy with this (which, is pretty awesome)

      My point is that real time photorealistic rendering will never catch up with what people expect from their games. It will always be behind. If all you want is mirrors, then find a faster way to implement them at the expense of a bit of quality.

    3. Re:Now hear this by The_Wilschon · · Score: 4, Insightful

      I think you still should look at (and understand) the damn graph. The point of the article was that if you want a given complexity of scene (which translates into quality of image), you only have to get a little bit more complex than current game scenes before current ray tracing techniques become faster than current raster techniques. Thus, ray tracing at 30 fps will look better than raster at 30 fps in the near future, perhaps already. Ray tracing is the quickest known route to better graphics quality at the same frame rate in games.

      Yes, what can be produced will still be behind what people want or expect. But ray tracing will be less far behind than rasters in the near future.

      All of this is according to TFA; I don't know much about this from a technical standpoint.

      --
      SIGSEGV caught, terminating

      wait... not that kind of sig.
    4. Re:Now hear this by RightSaidFred99 · · Score: 2, Insightful

      Again, your short-sightedness really amazes me. Have you not noticed how fast cores are being added? Look up Intel's Larrabee, for example. It's really a little silly to use the word "never" in this context. Unless you're being philosophical. Take for example youre first link. I'd bet you $50 that within 7 years we will be able to render that in realtime, at 1920x1200 resolution at 60 frames per second. 7 years is a lot sooner than "never".

    5. Re:Now hear this by Cornelius+the+Great · · Score: 3, Insightful

      I've been working with computer graphics for quite a while, and I have seen trends in realtime rendering switch paradigms. We went from ray-casting hexagonal rendering (Wolfenstein 3D) to 2.5D BSP sector engines (Doom, Duke3D) and then onto rasterized "true" 3D (Descent, Quake). Ray tracing is the next step. Remember when Quake was only playable at 320x200 resolution on the average PC at the time (Pentium 60), while Duke3D ran fine in SVGA? I do.

      It's like arguing that we should go back to raycasting because it can render a textured cube many times faster than a 3D rasterized engine could.

      You're being rather shortsighted.

      --
      Sigs are for losers
    6. Re:Now hear this by Cornelius+the+Great · · Score: 2, Insightful

      Btw, you do realize that 15 fps on a quad-core processor is done ON the cpu. You're comparing software rendering of raytraced rendering vs. hardware-accelerated rasterization. With the newest graphics cards, we're seeing just the first generation of hardware-accelerated raytracing. Give it some time.

      --
      Sigs are for losers
    7. Re:Now hear this by grumbel · · Score: 3, Insightful

      The problem I have with ray-tracing is that I find it hard to see its advantages. Sure, it can put out more polygons then raster and it can do reflective spheres and sharp shadow. But those things have very little to do with visual quality. Reflections are pretty much a non-issue, nobody really cares as long as there is something that looks somewhat close to a reflection and environment maps can get that done. Sharp shadows are actually extremely ugly and people are moving onto soft shadows now. Higher polygon counts, sure nice to have, but again not really all that important, slap on a few normal maps and you can have your 5'000'000 reduced to a 5'000 polygon model without noticeable detail loss.

      The majority of quality improvement these days seems to come from post processing effect and clever textures and programmable shader use. If you want to get fur on an animal via polygons you will have to spend a load of rendering time, but if you fake it with textures you can get pretty good results on todays hardware. Same with shadows and a lot of other stuff. Doing it 'right' takes a load of computing power, faking it works in realtime.

      I simply haven't seen all that much raytracing that actually could compete with current day 3D hardware, those that do look better then todays 3D hardware is done in offline renderers and takes hours for a single frame.

    8. Re:Now hear this by MrNemesis · · Score: 2, Insightful

      Sod the game - if there was an open source, cross-platform hardware, architecture agnostic accelerated RT API available (I'm assuming that vendor-specific OpenRT acceleration a la nVidia's OGL would still be closed source) that made RT viable for the mainstream (either for gaming or CAD/animation work), there'd be practically no difference between MS and everything else either for gaming (including consoles) or 3D workstation work, and D3D would no longer be the de feacto standard for accelerated 3D - that'd be a BIG win for open standards.

      Ah, a man can dream... :D

      --
      Moderation Total: -1 Troll, +3 Goat
  4. Re:Adaptive techniques: make or break by morgan_greywolf · · Score: 5, Insightful

    Linux hackers are far better coders then most people who use Visual Studio Um, those two groups aren't mutually exclusive. Many of us *nix hackers also have day jobs that require us to use tools like Visual Studio. You make assumptions that aren't true.

  5. Re:Adaptive techniques: make or break by Anonymous Coward · · Score: 1, Insightful

    HAHAHAHA OPEN SOURCE GAMING? Get out of your dream world. Clearly you are not too knowledgable about games my good sir.

  6. in the player's best interests, natch by Speare · · Score: 4, Insightful

    Daniel Pohl, a marketer at Intel

    There, fixed that for you.

    Raytracing the shiny first-intersection makes a lot of sense, even if it doesn't sell more CPUs. Sure, some day we will all have stunning holistic scene graphs that fit entirely within the pipeline cache of the processor, but it's not yet time for that.

    Every change in developing a game engine requires changes in the entire toolset to deal with how to produce assets, how to fit within render time limit budgets, and how to model the scene graph and the logic graphs so that both are easily traversed and managed.

    In the meantime, we have a pretty nice raster system right now, with a development strategy that provides for all those needs. You might not think that fullscale raytracing would upset this curve, but I'm not convinced. What do you do when a frame suddenly is taking more than 1/30sec to render, because the player is near a crystalline object and the ray depth is too high? How do you degrade the scene gracefully if your whole engine is built on raytracing? We've all played games where things like this were not handled well.

    I contend that game AI is sometimes more advanced than academic AI because game developers are results-oriented and cut corners ruthlessly to achieve something that works well enough for a niche application. The same goes for game graphics: 33 milliseconds isn't enough to render complex scene graphs in an academically perfect and general way, it will require the same results-oriented corner-cutting to nudge the graphics beyond what anyone thought possible in 33ms. If that means using raytracing for a few key elements and ray-casting/z-buffering/fragment-shading the rest of the frame, game developers will do it.

    --
    [ .sig file not found ]
  7. Re:Adaptive techniques: make or break by DeeQ · · Score: 3, Insightful

    This is by far the dumbest statement I've ever read. Somebody has never tried to get a job in the field before eh?

  8. Re:Adaptive techniques: make or break by morgan_greywolf · · Score: 3, Insightful

    Yes they are. If you get to use visual studio at work is because you are not good enough to be hired as a Unix coder. Um, yeah, right. There are far and away more Windows development positions than there are Unix development positions. And most enterprise apps these days aren't exclusively one or the other -- they are cross platform and mixed-language. So even a Unix developer might spend at least some time with Visual Studio.
  9. Hardware product dependence not good by dazedNconfuzed · · Score: 2, Insightful

    the fact remains that we don't actually need this for games.

    Your post is heavily dependent on availability of suitable hardware. Software can be ported and recompiled to new platforms, but hardware-dependent software has a short lifespan precisely because getting usable hardware doesn't last particularly long. There's a lot of otherwise good enjoyable games which are unplayable now because they depended on the early Voodoo cards or other unrepeated graphics hardware. Now with CPU power ramping back up (relatively speaking), we can pull away from lifespan-limiting dependence on dedicated graphics hardware, and move the full rendering process back to generic CPU hardware.

    Torques me off when I want to play something but can't - not because I don't have the horsepower, but because it requires obsolete cards.

    BTW: The article notes that RT vastly outperforms raster on very high poly count scenes - that alone is reason to switch.

    --
    Can we get a "-1 Wrong" moderation option?
  10. Re:Adaptive techniques: make or break by Anonymous Coward · · Score: 1, Insightful

    Why not use the old "ray-casting techniques" to take the light backwards from the camera? This would allow you to easily limit which areas of the screen received a full ray traced treatment. You would need to include reflectives as potential light sources for you back trace, but I don't see why it wouldn't be effective.

  11. Re:Well DUH!! by prefect42 · · Score: 2, Insightful

    I'm sure you thought you were being clever, but you weren't.

    If you knew anything about parallel algorithms you'd know that it's fairly common to have things that scale with more like 75% efficiency, and you're still happy. It's all down to how much communication is required, and how often it's required. With raytracing normally (as in, a decade ago when I knew anything about this) you'd parallelise over multiple frames. With real-time rendering you'd need to parallelise within a frame. Depending on your scene, there will be a static cost (bounding box calculations) in addition to the per-pixel costs.

    jh

    --

    jh

  12. Re:Adaptive techniques: make or break by Firehed · · Score: 2, Insightful

    Don't remind me. Exactly how a text editor can load slower than Photoshop will perplex me until the end of time.

    --
    How are sites slashdotted when nobody reads TFAs?
  13. Re:Adaptive techniques: make or break by Nullav · · Score: 2, Insightful

    Good luck with that. Plan on typing out a model?
    Ignoring that, taking into account that a coder/modeler isn't all that unlikely, you can't just slap up a game that's a notch above 'hello world' in complexity and wake up to a thriving community eager to have your children. If you want to start a game without paying people to work on it, it'll take time (probably months to years) and a few very interested/dedicated people to get it to go anywhere.
    Why do you think so few FOSS games have a plot?

    --
    I just read Slashdot for the articles.
  14. Re:Adaptive techniques: make or break by Cornflake917 · · Score: 2, Insightful

    I'm assuming you mean casting the rays from the light sources, instead of the camera.

    Starting the rays from the light source would be less effective because once you start adding a few more light sources to the scene you are going to have more sets of rays to keep track of then if you were to just cast the rays from the camera. Even worse, you would have to run calculations on rays that would never hit the camera. Either way, you would still have optimize the scene with BSP's or some sort of data structure to avoid unnecessary calculations.

    I'm starting to think you are suggesting what they are actually doing now.

  15. Re:Further Reading by DeadChobi · · Score: 3, Insightful

    I think the article that your blog entry points to is a much better read on the subject. The article linked in the summary gushes on about how it's finally possible to ray trace in HD in real time, but only if you're willing to build a small cluster computer. In addition, the summary's article goes on about how the ray traced model scales logarithmically while the raster model scales linearly, but it doesn't provide a very rigorous explanation of where the writer is getting these values from.

    In short, I don't buy the summary article's viewpoint because at times he can be confusing or ambiguous with respect to his "proof." I like the parent's linked article, because the author of that article at least provides something computationally meaningful to think about.

    --
    SRSLY.
  16. Re:Raytracing scales up far better... by daVinci1980 · · Score: 3, Insightful

    Disclaimer: I work for NVIDIA. I speak not for them.

    People keep saying this, that raytracing scales up better than rasterization. It's simply not true. Both of them have aspects that scale linearly and logarithmically. They do scale differently, but in a related sort of wy.

    Raytracing is O(resolution), and O(ln(triangles)), assuming you already have your acceleration structures built. But guess what? It takes significant time to built your acceleration structures in the first place. And they change from frame to frame.

    Rasterization is O(ln(resolution)), and O(triangles). Basically, in a rasterizer, we only draw places that we have triangles. Places that don't have triangles have no work done. But the thing is, we've highly pipelined our ability to handle triangles. When people talk about impacting the framerate, I want to be clear what we're talking about here: adding hundreds, thousands, or even a million triangles is not going to tank the processing power of a modern GPU. The 8800 Ultra can process in the neighborhood of 300M triangles per second. At 100 FPS, that'd be (not suprisingly) 3M triangles per frame.

    Modern scenes typically run in the 100-500K triangles per frame, so we've still got some headroom in this regard.

    Cheers.

    --
    I currently have no clever signature witicism to add here.