Slashdot Mirror


Refresh your Memory: Advanced Graphics Algorithms

subtle writes "DevMaster.net has posted an interesting article about advanced graphics algorithms. The article discusses six widely used algorithms in graphics rendering of indoor and outdoor environments, namely: quad-based static terrain, Roettger's approach to continuous levels-of-detail in terrain, real-time optimally adapting meshes, portals, BSPs and PVSs. In each case the algorithm is discussed and some aspects of implementation are considered, as well as analyize each algorithm for its application in modern graphics systems."

44 of 140 comments (clear)

  1. It has revolutionized landscaping by AtariAmarok · · Score: 4, Funny
    "The article discusses six widely used algorithms in graphics rendering of indoor and outdoor environments"

    I look forward to re-doing my back yard with a nice quadratic mesh algorithm with pseudo-fractal post-processing.

    --
    Don't blame Durga. I voted for Centauri.
    1. Re:It has revolutionized landscaping by Mister+Transistor · · Score: 2, Funny

      That has to beat mowing it!

      --
      -- You are in a maze of little, twisty passages, all different... --
    2. Re:It has revolutionized landscaping by Merlin42 · · Score: 4, Funny

      Are you going to Reticulate your Splines?

    3. Re:It has revolutionized landscaping by Short+Circuit · · Score: 2, Funny

      Boy, I miss SimCity 2000.

      One version would have this luscious female voice say "Reticulating Splines" whenever the game generated a new topology.

      Anyone know if the Windows version works well under WINE?

    4. Re:It has revolutionized landscaping by scooby111 · · Score: 5, Insightful

      It's easy to tell when slashdotters know nothing about a particular subject.
      We get to read lame joke after lame joke.

    5. Re:It has revolutionized landscaping by falzer · · Score: 2, Interesting

      I would have guessed he meant one of the platonic solids: teapotahedron

  2. In Case of /. by Anonymous Coward · · Score: 4, Informative

    AWESOME Rock Music Here
    ___

    Advanced Graphics Algorithms

    By: Henri Hakl

    1. Introduction
    Graphics representation of reality - or at least virtual reality - in games, simulations, movies, commercial and military applications have become increasingly convincing and immersed a growing audience in disbelieve - and at times even utter belief. This process has, in part at least, been facilitated by exponentially growing processing speeds and in more recent years the advent of hardware acceleration of graphics rendering.

    However, even in spite of being able to process several giga-flops every second, a brute force approach to rendering is not able to produce nearly as realistic real-time environments and worlds as we find portrayed in games and interactive simulations. The reason is that numerous algorithms are used that approximate or compromise reality in order to achieve interactive rendering rates. These algorithms include methods to simplify scenes, to efficiently cull invisible parts or to simply ignore realistic computations in favour of faster approaches that, though inaccurate, portray reality.

    Following the introduction we present a section on several graphics rendering concepts that feature in this article. In the remainder of this article we will discuss six popular algorithms for indoor and outdoor rendering of environments, namely:

    quad-based static rendering of environments
    a continuous level-of-detail (CLOD) rendering of height fields as described by Roettger et al [1]
    real-time optimally adapting meshes (ROAM) for terrain rendering
    portal-based rendering of indoor environments
    binary space partitions (BSP) of indoor environments
    potential visibility sets (PVS)
    We will discuss each approach, offering a high-level description of each as well as implementation considerations where appropriate. Finally each algorithm will be discussed in terms of its application in modern graphics system before we conclude the article.

    2. Concepts in Graphics Rendering
    This section offers a broad overview into several key concepts in graphics rendering. These include the graphics pipeline, vertex representations, scene reduction techniques and graphics models - for a more extensive description we refer the interested reader to Alan Watt's 3D Computer Graphics [2].

    2.1 The Graphics Pipeline
    Graphics rendering is concerned with reducing a scene, a collection of three-dimensional data, to a smaller, visible subset and rendering this subset. To render a scene subset we note that a scene consists of polygons that are usually reduced to sets of triangles for hardware rendering purposes. The rendering process goes through a graphics pipeline during which the vertices of a triangle are transformed according to the current point-of-view and then projected from world space onto screen space according to the viewing frustum. The point-of-view determines the position and direction from which the world is rendered, while the viewing frustum determines the scope of the field-of-view (FOV).

    After transformation and projection the triangle is lighted (meaning lighting calculations are performed on it) and clipped (meaning only visible parts are drawn) and then finally drawn to the graphics buffer. A number of approaches can be adopted during the drawing of the triangle, such as wire-frame only, solid, textured and bump-mapped.

    Wire-framing only renders the lines connecting polygon vertices, solid renders color information only, texturing uses bitmap or procedural data that is projected onto the polygon, bump-mapping textures the polygon and utilizes some form of shadowing technique that creates a sense of depth to the image.

    2.2 Vertex Representation
    The triangle vertices used during the graphics pipeline can be represented in a number of ways, the simplest being a triangle-list. A triangle-list simply stores the vertices in sets of three, corresponding

  3. Huh? by JohnGrahamCumming · · Score: 2, Informative

    Perhaps I missed "Graphics Algorithms 101" in a previous /. article, but after reading (or trying to read) TFA my response is: wibble.

    John.

  4. What happened to the days of... by SavedLinuXgeeK · · Score: 5, Funny

    for (int x = 0; x 320;x++) for (int y = 0; x 249; y++) drawpixel(x,y,data[x,y]) What ever happened to the simpler times...

    --
    je suis parce que j'aime
    1. Re:What happened to the days of... by Brie+and+gherkins · · Score: 2, Funny

      Commodore Pet - poke 32768,65

      --
      If I promise to be a good boy can I have some better karma?
    2. Re:What happened to the days of... by Ghoser777 · · Score: 3, Funny

      What, when less than signs where implicity understood by the compiler?

      :ducks:

      Matt Fahrenbacher

      --
      James Tiberius Kirk: "Spock, the women on your planet are logical. No other planet in the galaxy can make that claim."
    3. Re:What happened to the days of... by fforw · · Score: 4, Funny
      for (int x = 0; x 320;x++) for (int y = 0; x 249; y++) drawpixel(x,y,data[x,y]) What ever happened to the simpler times...
      trashing vertically through memory in an endless loop wasn't that good in simpler times, too. =)
      --
      while (!asleep()) sheep++
    4. Re:What happened to the days of... by TheBoostedBrain · · Score: 2, Informative

      That means..
      To write < you have to type &lt;
      and to write &lt; you have to type &amp;lt;

      --
      -- When did Ignorance Become a Point of View?
  5. Refresh...? by Ghoser777 · · Score: 4, Insightful

    I hate when something is called a refresher course when it's something I never learned to begin with...

    Matt Fahrenbacher

    --
    James Tiberius Kirk: "Spock, the women on your planet are logical. No other planet in the galaxy can make that claim."
  6. They forgot TNA by baudilus · · Score: 5, Funny

    They for the TNA Algorithm - Tactile Natural Assimilation, for realistic representation of the skin around a woman's Breasts and Backside. This is the money maker, used for everything from Tomb Raider (Lara Croft) to Mario's bulbous (read: breastlike) nose in the popular Super Mario Bros. games.

    An egregious ommision.

  7. Home and Garden Network by ArmenTanzarian · · Score: 4, Funny

    They have a show for this now, "Trading Mesh Algorithms with Pseudo-fractal Post-processing" or TMAWPFPP for short.

    Will they use quadratic?
    Who knows!?!

    Pure excitement...

  8. What, no Octrees? by mausmalone · · Score: 4, Interesting

    This is the first graphics programming article I've seen in a long time with no visual aids. I think the writer simply wanted to write a huge "smart" article so that he'd seem impressive. Missed some good algorithms for terrain rendering (tilemap, octrees, frustrum culling). If you want a really good site about graphics algorithms, check out Paul Debevec's homepage (famous for his contributions to The Matrix)

    --
    -=-=-=-=-=
    I'd rather be flamed than ignored.
    1. Re:What, no Octrees? by Aardpig · · Score: 3, Insightful

      The type of problems solved by Octrees are also solved by BSP algorithms. So to put both in the article would have been a little redundant.

      --
      Tubal-Cain smokes the white owl.
    2. Re:What, no Octrees? by farkinga · · Score: 2, Insightful

      The content of the article aside, its "smart" format is appealing on several levels.

      Among other things, it is a format that is immediately usable. That isn't to say that internet-magazine articles are generally difficult to read, but some are easier than others due to advertising, having the article split into several pages, etc.

      Also, this article is a more permanent statement: it can be referred to in the future, all at once, easily. There really is no reference value to most internet-magazine articles - they are so cumbersome and ephemeral that they quickly become part of the "forgotten internet."

      The archival policy of the hosting site aside, this article could, by virtue of the atomiticity of the information, have greater staying power than a traditional, graphically infused pop-article. It can be transferred to other locations trivially, and its potential use in more traditional contexts figures in favorably.

      Whether or not the content is of value is, again, a different question entirely.

      --
      ?/o
  9. Is H. Fuchs' first name... by Anonymous Coward · · Score: 3, Funny

    Holy?

    1. Re:Is H. Fuchs' first name... by jdh-22 · · Score: 2, Funny

      Nope, pretty sure it is Hafta.

      --
      Every Super Villan uses Linux.
  10. IAAGD by MaestroSartori · · Score: 4, Insightful

    (I am a Game Developer) and I'm trying to work out why this article was posted. Its too advanced for beginners, its not detailed enough for professionals. Its basically a list of the names & very basic approaches of a few graphics algorithms. I suppose people vaguely interested who know the basics but haven't tried some of these out are the target audience.

    Anyone there fit the bill? Did you like this article? Was it helpful and informative?

    1. Re:IAAGD by XMyth · · Score: 5, Insightful


      I suppose people vaguely interested who know the basics but haven't tried some of these out are the target audience.


      For any given subject, that's about 95% of the Slashdot crowd.

      =)

    2. Re:IAAGD by BillLeeLee · · Score: 5, Interesting

      Overall I enjoyed the article. I'm a complete beginner when it comes to computer graphics, but I'm really interested in computational theory and algorithms and I think I'm pretty good with those subjects (classes I've enjoyed the most on my road to being a CS major are algorithms and mathematical courses for the most part).

      The article touches on many subjects I haven't heard about and I learned what a BSP (binary space partitioning) tree is, at least. Graphics are probably the next thing I'll try to get into, and I still have an OpenGL manual lying around that's only been opened once.

      Perhaps as a game programmer, you'd probably see that it's not as in-depth as you'd want, and it's probably not simple enough to be understood by everyone, but the article caters to, I guess, intermediate level people with a developing interest in computer graphics? Hits the sweet spot with me. ;)

      --
      www.google.com
  11. Downloaded from Nintendo by AtariAmarok · · Score: 2, Funny
    "That has to beat mowing it!"

    Yeah, but since it was a version I downloaded from Nintendo.com, I have to periodically spray for pokemon.

    --
    Don't blame Durga. I voted for Centauri.
    1. Re:Downloaded from Nintendo by Short+Circuit · · Score: 4, Funny

      What pesticide do you use? They keep popping up whenever my cousin comes over.

  12. Outdoor environment rendering.... by old_skul · · Score: 5, Interesting

    This is a very hot technical issue in gaming right now. The last 5 years have netted us decent techniques for doing network communications for low-latency gaming; with those in place now, we turn again to graphics.

    Tribes and Tribes 2 were some of the first games to take on outdoor environments and do them well. Now, we have Unreal Tournament 2004 and Far Cry leading the pack with gloriously realistic outdoor playspaces.

    It's only a matter of time before next generation gaming engines like these turn to non-linear gameplay such as what's in GTA 3 and we wind up with a world simulation that has a level of realism approaching reality.

    1. Re:Outdoor environment rendering.... by Mr+Smidge · · Score: 2, Funny


      Hmm, that Far Cry game is a little different from what I'd normally expect from today's games.

      Although it has some nice outdoor scenes, from the pictures..

  13. What about voxels? by csirac · · Score: 4, Interesting

    Back in the day, I had a game on my Amiga called "Shadow of the Third moon", a space flight sim, that used voxels. It was quite a novelty at the time and I only had 16MB RAM.

    Now that even cheap 3D cards have 128MB RAM on them, average systems have 256MB RAM, where are voxels used now?

    google for voxels

    1. Re:What about voxels? by minister+of+funk · · Score: 2, Informative

      Didn't the pc games "Outcast" and it's sequel use voxels? I believe they did. They also used some skeletal animation and some interesting bone physics so that when my character strafed next to an incline, on foot would be higher than the other, his leg would be bent, and both feet would be in good contact with the ground. I've not seen another game do this, except maybe MechWarrior, but I don't remember.

  14. comp.graphics.algorithms FAQ by j1m+5n0w · · Score: 5, Informative

    This is one of the best collections of graphics algorithms on the net I'm aware of:

    comp.graphics.algorithms FAQ

    Another favorite of mine is Ray Tracing News, but there haven't been any new issues in a few years.

    What other people's favorite collections of algorithms?

    -jim

    1. Re:comp.graphics.algorithms FAQ by Smallpond · · Score: 2, Informative

      For the basics (Hardcopy only)

      "Principles of Interactive Computer Graphics", 541 pages, Newman & Sproull, 1979.

    2. Re:comp.graphics.algorithms FAQ by erich666 · · Score: 4, Informative
      My favorite collections of computer graphics algorithms are gathered on the ACM TOG reference pages, here and here. For real-time rendering topics in particular, I strangely enough like my own page (which needs a serious update, though - it's in the pipe).

      Thanks for the kind words about the Ray Tracing News. I actually have a new issue ready to go, it's just a matter of converting it to HTML. Tonight, I hope...

      - Eric

  15. Not advanced! by Junks+Jerzey · · Score: 4, Informative

    This stuff isn't advanced, it's basic. It's more a refresher course on fundamental methods of organizing scenes. There's nothing difficult or amazing about portals, for example. In fact, much of the tech outlined in the article is outdated. Portals and BSPs (for rendering, not collision detection) are of much less use than they used to be. This quote shows that the author is just reiterating Quake-era views and hasn't written a modern renderer: "BSP trees are supremely efficient in rendering indoor environments." This is completely wrong. On a modern graphics card, it's much faster to throw the scene at the GPU and it let it render it all than it is to iterate through a BSP. Much faster.

    1. Re:Not advanced! by Junks+Jerzey · · Score: 3, Interesting

      Ok, and what does the GPU do? Let me guess ... maybe using one of the well known algorithms? Ah, no, can't be, they are all outdated ... Ah I know: The GPU just throws it at the GPU ...

      The GPU just transforms vertices and draws triangles, plus it runs per-vertex and per-pixel shaders. It does nothing involving scene representation or high-level culling. It just draws everything you throw at it.

      BSP trees--for rendering--were useful back when there was a massive expensive involved in rasterizing each triangle on the CPU. You never wanted to draw a triangle, then have another one completely obscure it. But with modern graphics cards this is irrelevant. You just pass a bunch of pre-packaged vertices to the graphics card and it does the rest. You never want to break things down into individual triangles.

      So, no, the GPU doesn't use one of these "well known algorithms."

    2. Re:Not advanced! by Junks+Jerzey · · Score: 2, Interesting

      Hmm, Doom 3 makes extensive use of both - that's fairly current tech eh? :)

      Doom 3 does not use BSP trees for rendering. Neither did Quake 3. It uses BSP trees for other things, like collision detection.

      "Portals" used to mean something other than it does now. You used to clip polygons against a portal, because this was faster in software. Now you just say "please draw the rooms adjacent to the current room." The "clipping" happens automatically on the GPU. "Room based rendering" would be a better term than "portal." There's no magic to this at all. It's just simple and common sense.

    3. Re:Not advanced! by Mskpath3 · · Score: 4, Insightful
      No, but the point he's trying to make is that scene organization works at a differerent 'magnification' (for lack of a better term) these days. Back in the days of Quake 1 and Carmack's zero-overdraw schemes, there was a premium on every triangle and every pixel that had to be processed.

      Today, the issue is significantly different. Consider an old 'gigapixel' card. 1 billion pixels per second at 60 frames per second == 16.6 million pixels per frame. Even at 1600x1280 there's only about 2 million pixels onscreen at once. What does this tell you? You can now afford to sink some time into overdraw because it just doesn't matter.

      Also, consider the fact that 1600x1280 == 2.04 million pixels onscreen. Even if you draw a single polygon per pixel @ 60 hz, you're still only looking at 120 million polys/second. That's going to be a pretty reasonable number for next-gen hardware (Xbox2). What does this say? Well, unless you really need 1 poly per pixel, you can afford to draw some extra polygons.

      Now, let's say you've got a scene with 10,000 discrete objects. This is a pretty reasonable number these days. Even on a 3ghz processor, doing distance-to-plane checks for plain jane frustum culling is pretty darn expensive when done 10,000x per frame. Multiply that number by some constant C to do N world space occlusion checks. All of a sudden you're sinking multiple milliseconds into just doing scene graph traversal. Don't forget, you only get 16ms per frame @ 60hz. PVS on triangle strips or individual triangles? Teehee - you'll spend forever trying to process all that crap. Throw a simply quadtree or octree onto a scene, and cull at the object level (where object == say, 1000 to 10,000 polys). Let the video card deal with the little bit of extra overdraw and wasted polys. Point is, -you- have saved, say, 4+ milliseconds of raw CPU time. 4ms is a lot. Send that extra time to Havok or Karma. Send it to a fancy effects system. Don't waste it doing needless old-school culling. Don't forget, if you're doing things right, the 'rendering' is really just DMA slinging verts and textures in the background to the GPU. Paralellism with the GPU. These mega hoopdeedoo X800+ cards can deal with a little excess load.

      The point is, these algorithms are most decidedly not advanced. They're from 2-3 years ago! Quite literally, that's ancient history in the games world. Ridiculous, but true. The real brilliance of these new generation GPU's is not wacky implementation of bizarre obscure culling algorithms. The brilliance is that they are so powerful, they allow you to spend your programming time implementing beautiful shaders and effects. In 1-2 years, graphics programming will have truly morphed from glorified bookkeeping (managing and organizing data has been the hallmark of the 'hardcore' graphics programmer for several years now) into actual effects and shader programming.

      I cannot wait until dicking with exporters and preprocessors, and goofy custom renderers are a thing of the past. With some clever planning, graphics peeps will be able to really sink more and more time into making things beautiful, instead of being forced to be excessively clever to make things happen. There will always be room for 'real' advanced stuff (like modern GPU + CPU shadow techniques, spherical-harmonic lighting, and other esoterics), but the power of these new cards lies in freeing up graphics programmers to actually write graphics code instead of being accountants. That's the real practical results of this next generation of hardware :)

  16. no graphics in the article! by hqm · · Score: 3, Interesting

    There was not a single illustration in the article. That is kind of ridiculous.

  17. I don't mean to troll ... but: by Anonymous Coward · · Score: 2, Insightful

    This article is like the 10,000,000-foot view of these things.

  18. Voxels aren't used because cards don't support 'em by Paul+Crowley · · Score: 3, Informative

    I used to work for a voxel rendering company, Voxar. I developed the fastest software voxel rendering algorithm for opaque surface rendering of its time, around ten years ago. It wasn't used in games - and still isn't - because it'll always be a performance loser for gaming applications for as long as PCs include dedicated polygon hardware.

    Comanche Maximum Overkill does not use voxels. I don't know why they chose that word to refer to the heightfields they do use.

  19. Not supported by hardware by Sycraft-fu · · Score: 2, Insightful

    All current graphics accelerators that I am aware of don't do voxels. They start with polygons, apply transforms to those, apply textures, lighting and such, and then rasterize that to pixels. Well since they don't support voxels, a voxel based game would probably just suck. Graphics cards way outstrip CPUs in terms of crunching power because they are specialised for what they do. However that means that if you don't do things the way they want, they aren't useful and you are back to pure CPU processing.

    No one is going to be able to market a blocky looking voxel game next to stuff like FarCry and Half Life 2. Even if the voxel engine is "technically" superior, it's not going to matter because lacking hardware acceleration, the end result will be far less impressive.

  20. Refresh? by LoreKeeper · · Score: 5, Informative

    Heya :)

    I'm the author of the article. So I guess I can explain a few things.

    Originally the article was written 3 years ago as a technical report for a small course I needed to do. DevMaster found this work and asked me whether they could make it available.

    The course took place over 8 weeks, covering each algorithm in a week - and 2 weeks for the report at the end. The actual course work is still accessable at

    http://www.cs.sun.ac.za/~henri/advgfx.html

    And includes pictures and sources to keep everybody happy. ;)

    To those that are uncertain who the intended target audience is - well, originally my supervisor... ;) - hence the somewhat formal and academic style; however, in its current form as an article on DevMaster it is intended for intermediate readers. Those that look for some additional insight into (spatial) graphics algorithms. The article isn't a tutorial and (given its history) is not bothered with technical details, however, it does make reference to useful starting places for those that wish to explore the matter some more.

    Although I agree - pretty pics would've been nice. ;) Those that really need them should go to the website.

    The choice of algorithms reflects not the state-of-the-art, nor the best approaches to solving graphics issues. The algorithms were, however, easily accessable to me at the time - and hence featured in my one-algorithm-a-week plan.

    Somebody mentioned that BSPs are outdated, this isn't true - though they have been around for ages, they are still the work-horse for most indoor engines around. Sure, BSPs are rarely used for the actual rendering process (as mentioned in the article), but in terms of processability of spatial organization they are hard to beat.

    I stand to be corrected but I'm rather sure Doom3 makes use of some form of BSPs as well. That should be good enough for anybody.

  21. Lame joke by AtariAmarok · · Score: 2, Insightful

    Lame joke after lame joke, modded higher than you think they should be. Welcome to Slashdot, newbie!

    --
    Don't blame Durga. I voted for Centauri.
  22. OK, I'll bite by Latent+Heat · · Score: 2, Interesting
    I never could figure out what the buzzword "troll" meant, but I guess that I'll "bite."

    I make part of my living from commercial sale of scientific visualization software. It performs in software what used to require a $20,000 special-purpose instrument using embedded DSP processors (ouch, more buzzwords). The software is locked into Windows because it uses 1) CreateDIBSection() to allow direct manipulation of pixels in the manner of the post to which I was responding, 2) ScrollWindowEx() so the display can be scrolled using video card hardware, requiring the software to only redraw a small portion with each update, and 3) IDirectDraw::WaitForVerticalBlank() to synchronize scrolls and redraws with the vertical retrace for tear-free video.

    Those three calls in Windows came about because Microsoft was trying to wean game developers away from DOS, where the direct control of copying pixel values into a video frame buffer was highly valued. Those three calls were to make 2-D games possible under Windows; those calls also happened to make my data visualization software possible.

    There is almost but not quite like it in Java 2D. The direct manipulation of pixels is performed using multiple layers of objects pretty much according to the buzzword pipeline layed out in my original post. The vertical retrace synchronization is also there in some or another BufferManager object, but how it works on different OS's is anyone's guess. The hardware assisted scroll is not there, but hey, everyone is supposed to have such fast computers and video cards.

    I was also commenting on 3-D techniques. You got me on that one because I don't have a clue as to 3-D techniques apart from the buzzwords, but it seems I am going to have to learn the 3-D techniques because no one makes 2-D games anymore. My data display goes back some 50 years when it was implemented using hardware filters and thermal paper, and that type of data display will probably be the standard in another 50 years, and I am going to have to figure out how to implement when no one supports 2-D graphics anymore (i.e. pixel-raster displays -- first "they" wouldn't let us touch the frame buffer because that was "too device dependent" and now "they" -- Microsoft with Longhorn, but others will follow -- won't let us touch individual pixels any more).

    As software comes up with more advanced abstractions to separate software from specific hardware, it becomes increasingly hard to do interesting things apart from those things anticipated by the abstractions. I was seconding the view of the post to which I was responding that capabilities to do certain things will become lost.