Category Archives: Resources

Clearing the Queue (a little)

Well, let’s see how far I get tonight in clearing the backlog of 219 potential resources I’ve stored up. Here goes:

  • NShader – If you use MSVC and you write shaders, this one’s for you. It highlights shader text as you’d expect, highlighting function names correctly and generally making code more readable. Worthwhile, I’ve installed it, it’s fine. That said, you can get 90% of the way there (and for sure 100% virus free) by simply using “Options | Text Editor | File Extension” and setting extension .fx (.fxh, etc.), choosing Microsoft Visual C++, then clicking Add. Do it now.
  • Speaking of shaders, I lost much of a day tracking down a bug in Cg: writing code like this, “max(0,someVar);” gave different results than HLSL when someVar was a float. My advice: always use the floating point version of numbers in shaders. So “max(0.0f,someVar);” fixed the problem. Reported to NVIDIA.
  • Morgan McGuire pointed out that John Carmack now has a Twitter account. It’s pretty interesting, in that he’s writing a ray tracer in OpenCL and relearning or rederiving various bits of knowledge that are not really written down anywhere. The guy’s unnervingly productive: “Goal for today: implement photon maps and contrast with my current megatexture radiosity gathering.” But what will he do after lunch?
  • Speaking of Carmack, you must see the Epic Citadel demo for the iPad. Demo video here. Stunning.
  • Speaking of Morgan, his Twitter feed mentioned a number of new resources: a new demo (with complete source) of ambient occlusion volumes at NVIDIA, a demo of sample distribution shadow maps (optimized z partitions for cascading maps) at Intel, and an introduction to DX 11 at Gamasutra. He also points out some entertaining visual bits, like the fascinating style of Devil’s Tuning Fork and a game map scale comparison chart (wow, WoW is small!). Morgan and others’ free multi-platform G3D Innovation Engine is now in release 8.0, and is supposed to be good for students, researchers, and indie game developers.
  • Speaking of Intel, they actually have three new DirectX 11 demos with source, as noted in this Geeks3D article.
  • Implementing some form of an A-buffer (multiple fragments stored in a pixel) is becoming more common. It’s an algorithm that can perform antialiasing and, more importantly, order-independent transparency. We already mentioned AMD’s efforts using DirectX 11; Cyril Crassin has taken their idea and improved cache coherency a bit, creating an OpenGL 4.0+ version of the linked-list approach, with source.
  • I love the idea of driving rendering computations by drawing some simple quad or whatever on the screen and having the pixel shader figure out where, at what depth, and what normal the surface is actually located. The quad is like a bounding volume, the pixel shader essentially a ray caster. Naty sent on this link: the game Hustle Kings uses this technique to great effect for rendering its billiard balls – gorgeous. Video here. Perfect spheres here look lovely. I have to wonder how many triangles in a mesh would be visually identical at closest approach; it seems like the eye is quite good at picking up slight irregularities in tessellated spheres when they are rotating.
  • There’s also a pretty displacement mapping demo in OpenGL 4.0 showing GPU tessellation at work.
  • I like seeing that 3D printers are becoming still cheaper yet, $1500, and this one looks like a fairly clean system (vs. cornstarch dust everywhere, etc.).
  • There’s a basic object/object intersection library now available for XNA, GeometricIntersection.
  • Blending Terrain Textures is a nice little article on just that. Lerping bad, thresholding good.
  • Valve discusses how it worked with vendors to optimize graphics performance on the Mac.
  • NASA provides a fair number of 3D models free to download – 87 models and counting.
  • HWiNFO32 is a free utility which provides tons of information about your system. The thing that appeals to me is that it appears to show GPU memory load over time (and I verified the load indeed increased when I ran a game). I hadn’t seen this before, and thought it was essentially impossible for Vista, so this makes me pretty happy. I did just notice that my desktop icons all turned to generic white document icons and are unusable, and this happened some time around when I tried this utility. Hmmm.
  • Colors in Cultures infographic – I like the concept, it could have been interesting, but it’s mostly just hard to read in this form. Lots of world maps with the countries colored would have perhaps revealed more. Anyway, there’s their data, for remixing.

Now I’m down to 196 potential resources – good! More later.

Some quick bits

We’ve updated our portal page a bit: added Black Rock Studio’s nice publications page, added some film and commercial research labs’ publication pages, and fixed some links. Also, with a bit of regret, I removed the links to the Google Group pages for comp.graphics.algorithms and comp.games.development.programming.algorithms (though the FAQ for c.g.algorithms is still handy). These groups (and I assume most groups in general) have turned into spam repositories. The first group in particular has a special meaning for me, as comp.graphics.* is where I met a lot of graphics programmers back in the 80’s and 90’s and learned a bunch of techniques.

Happily, there are packrats on the internet; Steve Hollasch has a nice collection of the best of comp.graphics and other internet graphics sources. Some web-rot there with the external links, but the comp.graphics postings are solid. A few are dated, but there’s much that is still relevant today. I noticed a page I hadn’t seen before, a SIGGRAPH ’92 satire – some funny bits there (e.g. The Freehand Generation of Fractal Curves using only a Lightpen and Caffeine).

Which reminds me of a classic page that everyone should at least skim: “WARNING: Beware of VIDEA“. It’s about a bogus conference, now long-gone (though the so-called institute that ran it back then still held 23 conferences this year). Werner Purgathofer and colleagues submitted silly abstracts to this conference and all were accepted without review. Check out the abstracts on his page. Werner’s overview page also gives links to a number of related publications scandals: nonexistent peer review, plagiarism, automatic paper writing, etc. If nothing else, check out SCIgen if you haven’t seen it before.

Rendering Equation in Wired

I’ve been on vacation this week. Kayaked this morning, biked this afternoon (I sound so studly. but it’s all been fairly easy stuff, though sweaty). Catching up on my Wired magazines while waiting for the shower, I ran into this surprising article. Who would have thought the Rendering Equation would be a little article in any popular magazine, ever? Sure, it’s mostly Wired establishing geek-cred – the equation could really use a figure and a bit more explanation to appreciate it – but still fun to see.

SIGGRAPH 2010 resource links

Naty and I (mostly Naty!) collected the links for most courses and a few talks given at SIGGRAPH 2010; see our page here. Enjoy! If you have links to any other courses and talks, please do send them on to me or post them as a comment.

Personally, I particularly liked the “Practical Morphological Anti-Aliasing on the GPU” talk. It’s good to see the technique take around 3.5 ms on an NVIDIA 295 GTX, and the author’s site has a lot of information (including code).

New Site for “Advances in Real-Time Rendering” SIGGRAPH Course

The SIGGRAPH Course “Advances in Real-Time Rendering for 3D Graphics and Games” has been held since 2006 with a consistently high level of quality. However the hosting of the materials is scattered around a few different websites, and the older years suffer from broken links and other issues. We are happy to host the course’s new home on a subdomain of this site: http://advances.realtimerendering.com/. At the moment only the SIGGRAPH 2010 course materials are present, but previous years will go up shortly.

Fleet-Footed Faster Forward

The Fast Forward event at SIGGRAPH is set of very short presentations Sunday evening that runs through all the papers at SIGGRAPH. Lately SIGGRAPH has become a “big tent”, including a wide range of fields. This year there are, by my count, 133 SIGGRAPH papers, giving say 50 seconds to each presentation in the two-hour period. This is a pleasant-enough way to cull through all the papers and find which ones to see, and there is the occasional witty presentation, but to be honest, I’m a bit worn out on the method – too slow! In the past few years I find myself looking at my watch halfway through and thinking “egads, still another hour?” and my monocle pops from my eye with comic effect.

So I liked seeing that CGW is hosting a 3 minute 44 second video summary of some of the SIGGRAPH papers. Only 23 papers summarized, but I love that each gets just a sentence – you’re in, you’re out, and you have some sense if it’s a paper you need to see. I wish I had this for all the papers. Second in awesomeness would be a single web page that lists all the abstracts together, for a quick skim. I should write a Perl script that makes one from ACM’s SIGGRAPH 2010 TOC. Also at CGW’s site is a 2 minute 41 second (plus long credits) video summary of the Emerging Technologies area, purely visual – nice, it gives me a little taste, prepping my senses for what I will see there and want to learn more about.

Two and a Half Books

I’ve learnt of two new books in the past few weeks, worth mentioning as books to check out at SIGGRAPH (or using Amazon’s “Look Inside”, of course):

iPhone 3D Programming: Developing Graphical Applications with OpenGL ES, by Philip Rideout, O’Reilly Press. A better title might have been “Programming OpenGL ES on the iPhone”, as it focuses on OpenGL ES more than on the iPhone per se. Which is fine; there are already lots of iPhone programming books, and almost none that are focused more on OpenGL ES itself (the only other OpenGL ES 2.0 book I know of is this one). The book is C++ oriented, with some Objective C as needed for glue. From my brief skim, this looks like a well-illustrated, readable guide that hits many different effects: reflection maps, skinning, antialiasing, etc. That said, I haven’t yet had the opportunity to program on any mobile devices, so can’t give an expert review. When I do give it a try, this looks like the book I’ll read first.

Update: A draft of this book is free on the web, see it here. It looks to be essentially the same as the published work (but with some hand-drawn figures), and is nicer in some ways, as the pages allow color images (always good for a graphics book).

Light & Skin Interactions: Simulations for Computer Graphics Applications, by Gladimir V. G. Baranoski and Aravind Krishnaswamy, Morgan-Kaufmann Press. This one’s out of my league as a casual skim. Paging through and seeing “the eumelanin absorption coefficient is given by…” and “Scattering in either the stratum corneum or epidermis…” shows me how little I know of the world in general. Anyway, interesting to see a whole book about this critical type of material. Searching through it, there’s minimal coverage of, for example, d’Eon and Luebke’s work, so I can’t say it has much direct application to interactive computer graphics at this point.

That’s all for the real books…

The half a book (at best): Game GPU Graphics Gems: Real-Time Rendering The Redux (aka GGGG:RTRTR), by anyone who wants to edit it. When I “edited” the quasi-book Another Introduction to Ray Tracing a few months ago, I thought back then that I’d start another book for SIGGRAPH. Like the first stunning collection, this was an hour of work gathering Wikipedia articles (hardest part was choosing a cover). There are plenty more articles to gather about interactive rendering, and you’re most welcome to add any good ones you find to this book, make your own, etc. – it’s a wiki page, after all. More seriously, I like having a single, tight page of links to Wikipedia articles about interactive rendering, vs. wandering around and haphazardly seeing what’s there.

Another SIGGRAPH Scheduler

SIGGRAPH 2009 scheduleI’ve messed around with various scheduling methods over the years for SIGGRAPH, but find I dislike the form factor of PDA-like devices: you can see a few hours, or maybe a day’s activities at best. Taking notes can be tiresome, you need lots of clicks needed to find stuff, and sometimes the battery dies.

So for the past few years I’ve locked onto classic graphite stick & cellulose technology. Honestly, I like it a lot: folds up and fits in my pocket, it’s easy to see conflicts among events, I can instantly figure out when I’m free, and lots of room on the back for notes and whatnot. At the end of the conference I automatically have a hardcopy, no printing necessary. I mention it here as an honestly useful option, as this low-tech approach works for me. The main drawback is that you look like a nerd to other nerds. Hey, I like my iPod Touch, I’ll put the SIGGRAPH Advanced Program on it with Discover, but the sheet o’ paper will be my high-level quick & dirty way to navigate and write down information. It’s sort of how I like RememberTheMilk for reminders more than Google Calendar: I can enter data very simply, without time wasted navigating the UI. Now if only the sheet of paper would automatically unfold when I take it out of my pocket, I could increase efficiency by 0.43 seconds.

SIGGRAPH Scheduler & Course Update

For anyone still working on their SIGGRAPH 2010 schedule, SIGGRAPH now has an online scheduler available. They are also promising an iPhone app, but this has not yet materialized. Most courses (sadly, only one of mine) now have detailed schedules. These reveal some more detail about two of the most interesting courses for game and real-time rendering developers:

Advances in Real-Time Rendering in 3D Graphics and Games

The first half, Advances in Real-Time Rendering in 3D Graphics and Games I (Wednesday, 28 July, 9:00 AM – 12:15 PM, Room 515 AB) starts with a short introduction by Natalya Tatarchuk (Bungie), and continues with four 45 to 50-minute talks:

  • Rendering techniques in Toy Story 3, by John Ownby, Christopher Hall and Robert Hall (Disney).
  • A Real-Time Radiosity Architecture for Video Games, by Per Einarsson (DICE) and Sam Martin (Geomerics)
  • Real-Time Order Independent Transparency and Indirect Illumination using Direct3D 11, by Jason Yang and Jay McKee (AMD)
  • CryENGINE 3: Reaching the Speed of Light, by Anton Kaplayan (Crytek)

The second half, Advances in Real-Time Rendering in 3D Graphics and Games II (Wednesday, 28 July, 2:00 PM – 5:15 PM, Room 515 AB) continues with five more talks (these are more variable in length, ranging from 25 to 50 minutes):

  • Sample Distribution Shadow Maps, by Andrew Lauritzen (Intel)
  • Adaptive Volumetric Shadow Maps, by Marco Salvi (Intel)
  • Uncharted 2: Character Lighting and Shading, by John Hable (Naughty Dog)
  • Destruction Masking in Frostbite 2 using Volume Distance Fields, by Robert Kihl (DICE)
  • Water Flow in Portal 2, by Alex Vlachos (Valve)

And concludes with a short panel (Open Challenges for Rendering in Games and Future Directions) and Q&A session by all the course speakers.

Beyond Programmable Shading

The first half,  Beyond Programmable Shading I (Thursday, 29 July, 9:00 AM – 12:15 PM, Room 515 AB) includes seven 20-30 minute talks:

  • Looking Back, Looking Forward, Why and How is Interactive Rendering Changing, by Mike Houston (AMD)
  • Five Major Challenges in Interactive Rendering, by Johan Andersson (DICE)
  • Running Code at a Teraflop: How a GPU Shader Core Works, by Kayvon Fatahalian (Stanford)
  • Parallel Programming for Real-Time Graphics, by Aaron Lefohn (Intel)
  • DirectCompute Use in Real-Time Rendering Products, by Chas. Boyd (Microsoft)
  • Surveying Real-Time Beyond Programmable Shading Rendering Algorithms, by David Luebke (NVIDIA)
  • Bending the Graphics Pipeline, by Johan Andersson (DICE)

The second half, Beyond Programmable Shading II (Thursday, 29 July, 2:00 PM – 5:15 PM, Room 515 AB) starts with a short “re-introduction” by Aaron Lefohn (Intel) continues with five 20-35 minute talks:

  • Keeping Many Cores Busy: Scheduling the Graphics Pipeline, by Jonathan Ragan-Kelley (MIT)
  • Evolving the Direct3D Pipeline for Real-Time Micropolygon Rendering, by Kayvon Fatahalian (Stanford)
  • Decoupled Sampling for Real-Time Graphics Pipelines, by Jonathan Ragan-Kelley (MIT)
  • Deferred Rendering for Current and Future Rendering Pipelines, by Andrew Lauritzen (Intel)
  • PantaRay: A Case Study in GPU Ray-Tracing for Movies, by Luca Fascione (Weta) and Jacopo Pantaleoni (NVIDIA)

and closes with a 15-minute wrapup (What’s Next for Interactive Rendering Research?) by Mike Houston (AMD) followed by a 45-minute panel (What Role Will Fixed-Function Hardware Play in Future Graphics Architectures?) by all the course speakers Mike Houston, Kayvon Fatahalian, and Johan Andersson, joined by Steve Molnar (NVIDIA) and David Blythe (Intel) (thanks to Aaron Lefohn for the update).

Both of these courses look extremely strong, and I recommend them to any SIGGRAPH attendee interested in real-time rendering (I definitely plan to attend them!)

Four presentations by DICE is an unusually large number for a single game developer, but that isn’t the whole story; they are actually doing two additional presentations in the Stylized Rendering in Games course, for a total of six!

“Video Game Optimization” – a good book

I had the chance to spend some quality time with Preisz & Garney’s recent book “Video Game Optimization” a few weeks back, as I was trapped in a 14 hour plane flight. I hardly spent all that time with it, though I probably should have spent more. Instead, “Shutter Island” and “It’s Complicated” (with bad audio) are four hours out of my life I’ll never get back.

This book goes from soup to nuts on the topic: types of optimization, how to set and achieve goals, discussion of specific tools (VTune, PIX, PerfHUD, etc.), where bottlenecks can occur and how to test for them, and in-depth coverage of CPU and GPU issues. Graphics and engine performance are the focus, including multicore and networking optimization, plus a chapter on consoles and another on managed languages. Some of the information is in the “obvious if you’ve done it before” category, but critical knowledge if you haven’t, e.g., the first thing to do when optimizing is to create some good benchmark tests and lay down the baselines.

There are many specific tips, such as turning on the DirectX Debug runtime and seeing if any bugs are found. Even if your application appears to run fine with problems flagged, the fact that they’re being flagged is a sign of lost performance (the API has to recover from your problem) or possible bugs. I hadn’t really considered that aspect (“code works even with the warnings, why fix it?”), so plan to go back to work with renewed vigor in eliminating these when seen.

I also liked reading about how various optimizing compilers work nowadays. The main takeaway for me was to not worry about little syntactic tricks any more, most modern optimizers are good enough to make the code quite fast.

There’s very little in this book with which I can find fault. I tested a few terms against the index. About the only lack I found was for the “small batch problem“,  where it pays to merge small static meshes into a single large mesh when possible. This topic does turn out to be covered (Chapter 8), but the index has nothing under “batch”, “batching”, “small batch”, etc. There is also no index entry for “mesh”. So the index, while present (and 12 pages long), does have at least one hole I could detect. There are other little index mismatches, like “NVIDIA PerfHUD Tool” and “NvPerfHud Tool” being separate entries, with different pages listed. Typo-wise, I found one small error on page 123, first line should say “stack” instead of “heap”, I believe.

Executive summary: it’s a worthwhile book for just about anyone interested in optimization. These guys are veteran experts in this field, and the book gives specific advice and practical tips in many areas. A huge range of topics are covered, the authors like to run various experiments and show where problems can occur (sometimes the cases are a bit pathological, but still interesting), and there are lots of bits of information to mull over. Long and short, recommended if you want to know about this subject.

To learn more: first, look inside the book on Amazon. We mentioned here before Eric Preisz’s worthwhile article on videogame optimization on Gamasutra. A very early outline of the book appears on vertexbuffer.com. For me, it’s great to see that this is a passion for the first author – that comes through loud and clear in this book. I’ve added it to our recommended books section.

One little update: Carmack’s inverse sqrt trick, mentioned in the book on page 155, is dated for the PC. According to Ian Ameline, “It has been obsolete since the Pentium 3 came out with SSE. The rsqrtss/rsqrtps instructions are faster still and have better and more predictable accuracy. Rsqrtss + one iteration of Newton/Raphson gives 22 (of 23) bits of accuracy, guaranteed.”