Back of the Business Card Ray Tracers

Basic ray tracing is a simple algorithm. As sometimes given as proof, there are two business card ray tracers I know of: Paul Heckbert’s and Andrew Kensler’s. You can see Andrew’s explanation here (as well as links to ports), the leet code here, and an involved revisit and optimization and CUDA-ization of this code by Fabien Sanglard here.

Andrew’s dates from somewhere during 2005-2009, when he was avoiding writing his thesis. Paul’s dates from 1987, including tricks he learned from Darwyn Peachey and Joe Cychosz. His links are here, the code’s here and unminimized here, and the whole thing is written up in Graphics Gems IV. Which I wish was free on the (legal) web at this point… But through the miracle of Google Books, you can find most of the article here and missing page 379 (just the code listing) here.

Yesterday I realized I likely had never seen the output of Paul’s ray tracer. I installed Ghostscript to look at his file, but it was pretty beat:

Yeah, definitely ray tracing, or something

So I compiled Paul’s minimized code, finding a few small syntax errors that VS 2019 didn’t like so much. Adding a PPM header to the image file dumped, it’s this:

32 x 32

So, better, I can see spheres. I upped the resolution – it took a whole 10 seconds to run on a single CPU:

1024 x 1024

Not stunning, but now I know!

And today I ran across a set of lecture slides from the University of Utah which shows both of these business-card ray tracers’ results, page 22 on. Oddly, the image shown there has different colors – maybe gamma correction or something?

Anyway, now you can say you’ve seen it, too. And here’s the back of my copy of Paul’s business card, in the flesh, as it were:

Me, I was thrilled that 34-year-old code basically still ran, with minimal messing about.

New Graphics Books, Fall 2021

Short version: see new book releases here.

Long version: All credit goes to Ibrahim Belabbaci for bringing these new books to our attention. Beyond Ray Tracing Gems II, he sent on five new titles released since June. One’s entirely free to download, and there are nice long excerpts of the rest on Google Books. You’ll see all the links on our page.

I was particularly happy to see that Lee Stemkoski coauthored the free one, Developing Graphics Frameworks with Python and OpenGL. Years ago he put up a marvelous website of three.js demos with clean source code, showing how to do each operation. It’s also nice to see that MIT Press is publishing more books on computer graphics. Anyway, go take a look at the updated page. Covers below.

Some Books

A few interesting books have come out recently. Full disclosure: I have an indirect connection to the first and third.

  • First one’s free to download: Ray Tracing Gems II. That link also notes where the Github code repo is, shows the Table of Contents, etc. You can also download individual chapters from Apress’s site. Oh, and here’s a funny review from PC Gamer.
  • Second one’s a reasonable introduction to the basic ideas behind 3D computer graphics: Computer Graphics from Scratch. This book has nothing to do with the computer language called Scratch (which No Starch also sells books about). There’s a free sample chapter on that page. Also, I noticed today that all No Starch Press books are 35% off until August 9th. I’m appreciating this publisher more and more, as they offer their books in a variety of unprotected e-book formats, including PDF.
  • Third one’s not about 3D graphics, but written by a graphics luminary: Deep Learning: A Visual Approach, by Andrew Glassner (who also wrote a foreword for Ray Tracing Gems II). This is an equation-light introduction to the field, instead using lots of figures to build up your understanding. There’s a free sample chapter and also a Github link. This repo has three more free chapters, about running scikit-learn and Keras. It also includes 870 figures from the book, all under the MIT License for reuse. Again from No Starch Press, so their discount applies, there’s a DRM-free PDF, etc.

Oh, and one more page from No Starch Press that made me laugh: their manga guides, such as this one

Check them out. As usual, they each have a free chapter available. From my brief sampling, they look fun but don’t appear dumbed down and are not shy about using proper math.

Free Intro to RT and ML & NN Courses

Two free webinar courses from SIGGRAPH 2021, run by Rajesh Sharma at Disney Animation, starting next week:

Introduction to Ray Tracing starts Tuesday, May 25th, running for seven sessions. It’s based on Pete Shirley’s Ray Tracing in One Weekend book (which is also free). Each class starts with a live conversation with a ray tracing luminary (or me). See here for the full description, syllabus, and YouTube links. You don’t need to register – just show up. But, when? Here’s a Google calendar for integrating into your own, and here’s a link for the ICS file for Outlook, etc. Course materials and prerequisites are here.

Machine Learning and Neural Networks starts Monday, May 24th, also seven sessions. Similar thing: see here for the description, syllabus, and YouTube links. Registration not required. Here’s the Google Calendar link and here’s the ICS link. Course materials and prerequisites (not many!) here.

Me, I hope to at least watch the first 10 minutes of every session to get a glimpse of what the experts are thinking about.

From Rajesh’s Linked-In posting:

Seven Things for May 13th, 2021

So much good stuff is going on:

  • The Graphics Codex is now free on the web. This thing’s both a good source of tutorials on all sorts of areas of 3D graphics, as well as a reference of handy code bits. It’s basically “stuff Morgan McGuire got interested in and decided to write up.” It’s best integrated source for learning about ray marching algorithms that I know. The book’s main site is here.
  • For ray marching, also see Inigo Quilez’s site (you know, the Shadertoy guy). This should be old news, but just in case… He writes on a bunch of topics and rarely publishes in journals or presents at conferences, so there’s a mess of useful bits on his site.
  • Speaking of Shadertoy: English Lane. Quite incredible (with maybe a few too many lanes, but that’s a niggle).
  • A Survey on Bounding Volume Hierarchies for Ray Tracing” is indeed a monster survey. Someone still needs to prove forming an optimal BVH is NP-hard. If you’re a professor, give it as a homework assignment “by accident” – someone will probably prove it and you’ll get to be on Snopes.
  • Running a virtual conference and want to know how to use OBS (Open Broadcaster Software)? Zdravko Velinov wrote a detailed article (two, actually) all about doing this for I3D 2020 and 2021.
  • Speaking of which, the I3D 2021 awards are here, with paper links here. Also, I3D 2022 is looking for more help, especially with publicity and website redesign – consider it! You can write them here.
  • I want this manga book, GPU Optimization: Getting Started, in English, now. I particularly appreciate the character with GPU cards for ears and a GPU chip as a third eye or whatever. Here’s a page after applying Google Translate:

Skribbl.io + computer graphics terms

One activity we did during Tuesday and Wednesday evenings after I3D sessions ended was to play skribbl.io (essentially, Pictionary) together. Quite fun! It’s maybe not ideal for an international audience, since it involves typing English words, but given that the winners were generally people from non-English-speaking countries, maybe that’s not so limiting. The good bits are that the game’s easy to learn and people can join or quit at any time. It also gets everyone talking and is free. Plus, it’s like 15 minutes or so for a full game, depending on the number of players.

Since I3D is about graphics and interaction, I made a custom list of graphics terms for people to draw. These can be pasted into the program when starting a match. Christoph Peters had this clever idea, but his phrase list on Tuesday was a bit ambitious: all the terms in the index of the PBR book. Turns out there’s a thirty-character limit… The next day I made a list from looking at a 3D graphics glossary and some other sources, culling out ones that seemed way too tough. Using this worked well for the one game we played with it (after a single game you’ll start to get repeats).

Here’s my list to paste in as custom words, most from last night and a few I added just now:

antialiasing, aliasing, alpha channel, ambient light, ambient occlusion, augmented reality, backface culling, baking, billboard, blending, bounding box, bounding volume, bump mapping, BRDF, cache, camera, clipping, collision detection, color bleeding, convolution, Cornell box, cube mapping, decal, deep learning, depth buffer, diffuse, fill rate, filter, fractal, global illumination, graphics processing unit, height field, interpolation, intersection, keyframe, level of detail, lighting, Manhattan distance, marching cubes, mipmap, multiprocessing, noise, particle, path tracing, penumbra, pipeline, point cloud, polygon mesh, post processing, refraction, shader, shadow, skinning, specular highlight, spline, sprite, Stanford bunny, stereo rendering, tangent, texture mapping, transform, transparency, umbra, Utah teapot, view frustum, virtual reality, voxel grid, wavelength, wireframe

Have fun! And good luck drawing “convolution,” that’s there mostly for “are you crazy?” value – you should edit the list as you wish.

A screenshot from last night’s game. My score’s low since I was aiming to give hints (and, yes, it should have been “multum” – didn’t help anyone anyway). If you host the game and provide the list, I recommend you take on this clue-giver role, too. But, type something each drawing, whatever the case. If you don’t make any guesses for a few turns you’ll get autokicked.

 

Seven Things for April 19, 2021

Seven things:

Seven Things for March 25, 2021

Seven things:

Seven Things for February 19, 2021

Seven things:

  • Cem Yuksel is posting video lectures for his Intro to Computer Graphics course at the University of Utah. Here’s the playlist (with more coming). You can also catch his latest lecture live. I (multi-task) watched the one on texturing yesterday and appreciated how he noted that we use (s,t) texture coordinates but usually call them (u,v). Practical advice for how the field actually works.
  • My go-to format for quickly writing out an image from some throwaway program is PPM. It’s easy enough to write from scratch each time, but here’s a page of code in just about every language under the sun for doing that. This will save me the five minutes of “oh, I forgot to put a carriage return” next time around. Plus, they give versions that write to the binary form of PPM, and some have fancier and nicer interfaces than I would have hacked. (If you need to output to a more serious image file format, I like LodePNG, C++ for PNG).
  • Speaking of languages, what is today’s top computer language, by popularity? No, not that one, nor that one. Answer here, by one estimate. Nice to know the Graphics Gem Repository code base is still relevant, despite it being 30 years old. Code doesn’t rust (though you may have to futz with the headers).
  • A surprisingly chewy set of slides with copious notes about ray tracing in Call of Duty: Modern Warfare. Bits of it are over my head without further reading, but it has great information about various bottlenecks encountered and solutions explored.
  • If you’re looking for a rabbit hole of articles to wade through (mixing my metaphors), consider Fabien Sanglard’s collection. Lots there, with a recent trend towards explaining the technical characteristics of a wide range of video game and GPU architectures. One example: a history of NVIDIA’s streaming multiprocessor.
  • A Taxonomy of Bidirectional Scattering Distribution Function Lobes for Rendering Engineers,” a workshop proposal for establishing a few terms as the ones to use. The title and subject probably don’t get your heart racing. What makes it entertaining are the xkcd-like cartoons explaining various book authors’ views. The recent Sci & Tech Oscars reminded me of it, as winners this year include some computer graphics people.
  • The sheer dedication of some artists is incredible. Simon Beck makes Andy Goldsworthy (who you should google if you don’t know) look a bit indolent.

I3D 2021 Posters Submission open

I3D Posters submission is open. The submission deadline is March 16th. Submitting a poster is a fairly easy way for researchers and developers in the field to get involved and receive feedback from their peers. We hope you can take advantage of it. One silver lining of our mutual circumstances: this year has the advantage of needing no travel budget.

Last year’s poster session was a highlight of I3D 2020 for me, as they were presented in a 3D VR space. I was particularly impressed by one presenter who brought up a screen and did live coding during their Q&A. We expect to have a similar space this year. My photo album of last year’s event is here.

The other I3D 2021 news is that we have just finished the first, major part of the paper review process. Keynote speakers are also lined up. We should soon be able to form a schedule and open registration, likely in early March. Like last year, registration will be free. Mark your calendar: I3D 2021 is April 20-22.

One photo below, to lure you into looking at the album 🙂 – there’s also a short video (no sound).