Author Archives: Eric

Morphological Antialiasing

An Intel research group has put their papers and code up for download. I had asked Alexander Reshetov about his morphological antialiasing scheme (MLAA), as it sounded interesting – it was! He generously sent a preprint, answered my many questions, and even provided source code for a demo of the method. What I find most interesting about the algorithm is that it is entirely a post-process. Given an image full of jagged edges, it searches for such edges and blends these accordingly. There are limits to such reconstruction, of course, but the idea is fascinating and most of the time the resulting image looks much better. Anyway, read the paper.

As an example, I took a public domain image from the web, converted it to a bitonal image so it would be jaggy, then applied MLAA to see how the reconstruction looked. The method works on full color images (though has to deal with more challenges when detecting edges). I’m showing a black and white version so that the effect is obvious. So, here’s a zoom in of the jaggy version:

zoomed, no antialiasing (B&W)

And here are the two smoothed versions:

zoomed, original zoomed, MLAA

Which is which? It’s actually pretty easy to figure: the original, on the left, has some JPEG artifacts around the edges; the MLAA version, to the right, doesn’t, since it was derived from the “clean” bitonal image. All in all, they both look good.

Here’s the original image, unzoomed:

original

The MLAA version:

MLAA

For comparison, here’s a 3×3 Gaussian blur of the jaggy image; blurring helps smooth edges (at a loss of overall crispness), but does not get rid of jaggies. Note the horizontal vines in particular show poor quality:

3x3 Gaussian blur

Here’s the jaggy version derived from the original, before applying MLAA or the blur:

jaggy B&W version

7 Things for July 26th

  • Books, books, and more books: I received review copies of two books. Best of Game Programming Gems is as it sounds, certainly cheaper than buying the seven books in this series, no real review needed (look inside). Game Engine Architecture is about just that, how to make a professional-grade game rendering system, from soup to nuts (you can look inside). Eberly’s two books are the previous notable works in this area, but are quite different than this new volume. While they focus almost exclusively on algorithms, this book attempts to cover the whole task of developing an engine: what to use for source control, dealing with memory management and in-game profiling, input devices, SIMD, and many other practical topics. There is also algorithmic coverage of rendering, animation, collision detection and physics, among other areas. Naturally, the amount of information on each area is limited by page count (the book’s a solid 860 pages), but in my brief skim it looks like most of the critical areas and concepts are touched on. You won’t become an expert in any one area from this volume, but it looks like you’ll have some reasonably deep understanding of the elements that go into making a game engine. Quite an impressive work, and I know of nothing else in this area that is so detailed. I hope I get a chance to read it (who am I fooling? Though I do wish I had the time…) – well, at the least, it’s a place I’ll first go if I want to learn about a topic in game development that I know little about. If you’d rather wax nostalgic about great game engines you have known, as well as what the state of the are is, this article is for you (oh, yeah, the author of this new book works at the company that made #3).
  • Looking around for titles I’d like to look over at SIGGRAPH, I found these: Game Graphics ProgrammingProgramming the Cell Processor: For Games, Graphics, and ComputationIntroduction to 3D Game Programming with DirectX 10Ultimate Game Programming with DirectX, 2nd Ed., Advanced Game ProgrammingGame Coding Complete. Which all sort of sound the same (except for the Cell book), but I’d be happy to page through each and see if it looks promising.
  • There’s a worthwhile comparison of average vertex normal computation methods on the MeshLab blog. He gives the nod to Thürmer and Wüthrich’s method. You can try each of the three using MeshLab itself.
  • Sure, Spore didn’t light the world on fire as many of us hoped, but a lot of cool technology was explored. Chris Hecker has a worthwhile rundown of some of the great stuff they worked on.
  • There are some surprisingly affordable 3D stereolithography objects available on Shapeways. I bought Spiral Cage (tiny, but impressive, and so cheap), Clematis (looks delicate, but is quite springy), and Gyroid (pricier, but more sizeable and a fun form). It’s great to see so many people exploring such areas; here’s a detailed summary of resources. Even if you never plan on getting involved, the Flickr area dedicated to such techniques is worth a browse.
  • This one amused me: a cloud computing company had a contest that was meant to show off Ruby and cloud computing strengths. It was won by people brute-forcing the problem with GPUs: 16 used by the first-place winner (plus 117 CPU cores, which had less performance total than the 16 GPUs), 4 by the second. Steve Worley and others talk about the GPU approach on the CUDA forum (his program, shared with the community there, was used to win second place).
  • I admire the dedication.

7 Things for July 20th

While at SIGGRAPH I like to look at new books at the booths. One you may wish to check out is Graphics Shaders: Theory and Practice, from AK Peters (or just use “Look Inside” on Amazon). I received a review copy and skimmed through it. If you’re interested in programming in GLSL 1.2 (part of OpenGL 2.1), consider looking at this one. A minor problem is that it’s not quite as up-to-date as the Orange Book (now on OpenGL 3.1), but the difference in core concepts between language versions is not large. The Graphics Shaders book is full color and comes with a lot of GLSL code examples. It has a bias towards scientific visualization, though not so much that it neglects the basics. I particularly enjoyed the chapter on noise, as it gave one of the clearest explanations I’ve seen on the differences between various types of basic interactive noise functions. One or two elements in the book are a little weak – the flowcharts for pipelines are often too small and difficult to read, for example – but all in all this looks like a solid contribution to the field. Don’t expect more elaborate effects, e.g., shadows are not touched upon. It does cover the basics, plus some additional topics like image post-processing (not normally covered in texts I’ve seen). One of the authors wrote a nice learning tool for GLSL, glman, free for download. If you find you like this tool, definitely consider the book.

Another book I noticed recently is Fluid Simulation for Computer Graphics. This is a topic I know little about, I was just interested to see that there’s any book at all. It looks pretty equation-filled, so is definitely for the serious practitioner.

Speaking of fluid simulation, Intel has an article on this topic for games. One of the chief strengths of any publication is that its staff makes a decision based on merit as to what is published and what is culled. So, I have to admit to being leery of anything that says, “Sponsored Feature”, as that means editorial review and decision-making are gone. I tend to err on the side of ignoring such articles (there’s plenty to read already). That said, Intel’s had quite a number of these articles recently, including such topics as instancing, ocean fog, FFT’s for image processing, and quite a few on parallelism.

In the “clearing the queue” category of links, I don’t think I ever pointed out this handy page, which presents all AMD/ATI and NVIDIA presentations at GDC 2009.

There’s now a (not very active, but at least it exists) Microsoft DirectX blog.

On the OpenGL front, NVIDIA has introduced bindless graphics to help avoid L2 cache misses. I will be interested to see how APIs evolve, as the elements in the current APIs that are bottlenecks are not so much CPU or GPU limitations as due to the API constructs themselves.

Thing for the day: an advertisement with interesting stippling.

7 Things for July 19th

Seven more:

  • Michael Abrash has an in-depth article on rasterization on Larrabee. Perhaps a little too in-depth at times; just skim past the assembly instructions. I also found myself asking, “why do that?” – the key is to just keep reading. He tries to make his examples simple and comprehensible, but at the cost of sometimes feeling like they’re oversolving the problem. They aren’t, it’s just that the solution is in fact used in different circumstances in order to be efficient.
  • SIGGRAPH has an interactive rendering event summary page. This page is more for the art production side of things, though; Naty’s coursetalks, and production sessions summaries are more comprehensive and more useful for programmer attendees.
  • NVIDIA has a number of events they’re involved in at SIGGRAPH 2009. Here’s the list.
  • I love this sort of madness: a business-card ray tracer that does depth of field.
  • Accumulated SSAO: the idea of reprojection, of using previous results by finding where they lie on this frame’s view, is one that seems a tad expensive for interactive rendering. It’s hard to know anything about performance and quality from this page, but I thought it was interesting to see.
  • I mentioned Processing in the last post. Another language-related resource for graphics and game programming is pygame, a set of Python modules for writing games. A friend said he found this system to be pretty great, that he could whip up a fairly involved game idea in a few hours.
  • Scribblenauts sounds like the coolest game that will ever come out, period. Even if it’s only 1/10th as good as the previews read, it looks to be pretty darn entertaining.

7 Things for July 18th

Well, I have 69 links stored up, wade through them here if you want unedited content. I’ve decided that getting 7 links out per post is a good round number, so here’s the first.

  • This is my screen-saver du jour: Pixel City (put the .scr file in your Windows directory). It’s fully described (along with source) in this great set of articles; if you’re too busy to read it all (though you should: it’s an fun read and he has some interesting insights), watch the video summary on that page. If you feel like researching the area of procedural modeling of cities more thoroughly, start here.
  • The book Real-Time Cameras, which is about camera control for games, now has a sample excerpt on Gamasutra.
  • NPR: Forrester Cole has two worthwhile GPU methods for deriving visible line segments for a set of edges (e.g., computing partial visibility of geometric lines). He’s put source code for his methods up at his site, the program “dpix“. Note: you’ll need Qt to compile & link.
  • The author of the Legalize Adulthood blog has recently had a number of posts on using DirectX10.
  • DirectX9 is still with us. Richard Thomson has a free draft of his book about DirectX 9 online. He knows what he’s about; witness his detailed pipeline posters. The bad news is that the book’s coverage of shaders is mostly about 1.X shaders (a walk down memory lane, if by “lane” you mean “horrifically complex assembly language”). The good news is that there’s some solid coverage of the theory and practice of vertex blending, for example. Anyway, grist for the mill – you might find something of use.
  • Around September I have 6 weeks off, so like every other programmer on the planet I’ve contemplated playing around with making a program for the iPhone. The economics are terrible for most developers, but I’d do it just for fun. It’s also interesting to see people thinking about what this new platform means for games. Naturally, Wolfenstein 3D, the “Hello World” of 3D games, has been ported. Andrew Glassner recommended this book for iPhone development, he said it’s the best one he found for beginners.
  • Speaking of Andrew, he pointed me at an interesting little language he’s been messing with, Processing. It’s essentially Java with a lot of built-in 2D (and to a lesser extent, 3D) graphics support: color, primitives, transforms, mouse control, lerps, window, etc., all right there and trivial to use. You can make fun little programs in just a page or two of code. That said, there are some very minor inconsistencies, like transparency not working against the background fill color. Pretty elaborate programs can be made, and it’s also handy for just drawing stuff easily via a program. Here’s a simple image I did in just a few lines, based on mouse moves:
    Processing output
That’s seven – ship it.

Interactive Ray Tracing BOF at SIGGRAPH 2009

Pete Shirley’s organizing an interactive ray tracing Birds of a Feather meeting at SIGGRAPH 2009. The details, as copied from here:

Interactive Ray Tracing
A variety of academic and industry leaders provide presentations and demos, with questions and discussions encouraged.

Tuesday, 5 – 6 pm
Sheraton New Orleans
Waterbury Ballroom
Peter Shirley
pshirley (at) nvidia.com

I’ll be there to help out. Pete’s already lined up demos from NVIDIA, Intel, Mental, an Imageworks affiliate, Breda University (Arauna), and Caustic. Right now we’re searching out academic groups or anyone else that want to show what they’re doing in the area. If you’ve got something to show or know someone that does, please contact Pete and me.

Utilities

Three events have got me thinking about utilities: Christer Ericson’s post, getting a Mac laptop, and sending my older son off to college (to Northeastern, in Computer Science – not my doing, he just liked his high school courses in programming). There are tons of useful utilities, from file searchers to spyware detectors to sound editors, and plenty of pages covering these. Many I use, such as FileZilla, Picasa, MWSnap, GIMP. Some I’m undecided on, such as IrfanView vs. XnView for quick image viewing (XnView is currently winning, but what I really want is trivial individual pixel examination built in – just tell me the RGB(A) that the mouse is over and I’ll be happy forever). Update: XnView wins! Going to the View menu, Display Colour Information can be toggled on, doing exactly what I wanted. That said, see the Comments below; now I have another one to try out, ddsview.

However, three stand out as just plain great, that everyone should know about:

  • Beyond Compare 3: compares files, that’s it. I’d been using version 2 for years; 3’s seriously better, and I’m happy to pay for the upgrade. I’ve found that which “diff” program is best is a matter of religious debate among programmers. Most of us have a favorite and can’t understand why anyone would use anything else. Anyway, this is my choice – compare files or folders, copy differences from one to another, easily edit either file, create reports, compare images (though this feature needs more oomph), plus a great try-before-you-buy policy: 30 days of use before it expires, not 30 days from first use.
  • Dropbox: This is my new best friend. For a number of reasons, I found myself often moving files between various machines via a USB flash drive. Slow, and a giant pain. Dropbox makes life easy for this and 58 other tasks. Install it, create an account, and there’s now a folder on your machine. Install it on other machines. Now when you move a file to this folder, the file is automatically uploaded to their server, then downloaded to all your other machines, almost immediately available on them. You can also put files in a Public subfolder and right-click to get an URL for this file, allowing you to serve up files to the web – extremely easy to do, beats manually FTPing, and you get 2 Gigs of storage free. You can also make private folders that can be shared with others of your choosing over the web. My latest use is putting my bookmarks HTML file into dropbox and pointing all my browsers on all my computers to it – update the file in one place and every machine then uses it automatically. Lovely. One caveat: when you move a file to your dropbox folder, by default you’re really moving it, since the folder’s local – delete it from any machine and it’s gone (well, recycled, but only on that machine). I tend to copy files instead, to avoid surprises.
  • Windirstat (Disk Inventory X on the Mac): This free utility does a great job showing you what’s taking up all that disk space. One key bit of info, that’s not obvious from the interface: almost everything in the window can be clicked (and right-clicked) on, giving still more information. Plus, it’s the only utility in its class with Phong shading (I knew I could tie this post to graphics somehow).

More Statistics

One followup to Naty’s article (below): Ke-Sen Huang’s page has submission and acceptance stats for many recent conferences.

If you have five minutes to kill, it’s fun to search on various phrases at the Google Trends site. Buzzwords like “cloud computing” have trackable data, but most graphics terms don’t have enough traffic to be worth recording. Here are some examples of graphics-related terms that have sufficient hit-counts:

  • Ray Tracing – I like how Google Trends points out relevant articles for various spikes.
  • SSAO – some definite spikes there, and what’s with all the traffic from Brazil? Is this the end of some word in Portugese? But there aren’t really hits before 2007, so I guess it’s real…
  • Collision detection, SIGGRAPH, and computer graphics – is interest in these areas waning, or are they simply established and not newsworthy? But then, GPU is going up.
  • Companies and products are fun to try: Larrabee, NVIDIA, Crytek.
  • You can also compare various terms. Here’s “DirectX programming, OpenGL programming, iPhone programming“. Pretty easy to guess which one is going up. Surprisingly un-spikey for DirectX and OpenGL.
  • And of course, Real-Time Rendering – Various random spikes; South Korea loves us.
Happy hunting, and please do comment if you find any interesting results.

Bits of News

Just some quick bits to chew on for breakfast:

  • Microsoft announced Project Natal at E3; the (simulated) video is entertaining. Lionhead Studios’ demo is also worth a look. Somehow a little creepy, and I suspect in practice there’s a high likelihood that a user will quickly run off the rails and not do what’s expected, but still. Considering how limited the Eye Toy is compared to its hype, I’m not holding my breath, but it’s interesting to know & think about. (thanks to Adam Felt for the link)
  • New book out, Graphics Shaders: Theory and Practice. It’s about GLSL, you can find the Table of Contents and other front matter at the book’s site (look to the right side). I hope to get a copy and give a review at some point.
  • I mentioned Mark Haigh-Hutchinson’s Real-Time Cameras book in an earlier post. The, honestly, touching story of its history is republished on Mark DeLoura’s blog at Gamasutra.
  • Nice history of graphics cards, with many pictures.
  • Humus describes a clever particle rendering optimization technique (update), and provides a utility. Basically, make the polygon fit the visible part of the particle to save on fill rate. One of those ideas that I suspect many of us have wondered if it’s worth doing. It is, and it’s great to have someone actually test it out and publish the results.
  • This is an interesting concept: with an NVIDIA card and their new driver you can now turn on ambient occlusion for 22 games that don’t actually use this technique in their shipped shaders. In itself, this feature is a minor plus, but brings up all sorts of questions, such as buying into a particular brand to improve quality, who controls and who can modify the artistic look of a game, etc. (thanks to Mauricio Vives for the link)
  • Old, but if you haven’t seen it before, it’s a must: transparent screens.

Game Engine Gems CFP

As I mentioned in a previous post, Eric Lengyel is heading up a new project, a book series called “Game Engine Gems”. It turns out that we ran across the website before it was announced (moral: there’s no hiding on the internet). He’s sent out an official call for papers today – see the book’s website for basic information.

I’m posting today to mention a few dates not currently shown on the website (though I expect this will change soon):

  • August 1 – Final day to submit article proposals
  • August 15 – Authors notified of acceptance
  • October 15 – Final day to submit completed articles

Contact Eric for more information.