Home / Design / Seeing Ray Tracing in a Different Light

Seeing Ray Tracing in a Different Light

Imagination Technologies’ new Caustic Visualizer viewport renderer is a software plug-in–currently available for Maya and soon to be available for 3ds Max–that provides interactive ray tracing in a working viewport. The Visualizer viewport renderer becomes another viewport option, available in any Maya or Max viewport, providing globally accurate lighting, reflections and shadows.

Pacific Digital Image Visual Studios
Rendered directly in the viewport with Caustic Visualizer for Autodesk Maya 2013.  Triangles: 538,696; LIghts 10 + IBL. Artist: Ryan Montrucchio, model courtesy of Pacific Digital Image Visual Studios.

But Visualizer is more than just a render preview; it’s a fully functional viewport. You can select and manipulate geometry and lighting–do anything, in fact, that you would do in any viewport, but with the added benefit of interactive ray tracing.

Similarly, Neon for Rhino is a fully ray-traced viewport plug-in for McNeel’s Rhino 5, developed by McNeel in collaboration with Imagination Technologies/Caustic. Like the Caustic Visualizer, the Neon viewport supports all native rendering features while still allowing you to edit your models.

This tightly integrated, interactive ray tracing is cool, but to make it go really fast, you’ll need hardware help in the form of one of Caustic’s ray tracing acceleration cards.

Fundamental Differences

Caustic’s Series2 Ray Tracing Acceleration Boards are not your average graphics processing unit (GPU)-powered cards. Caustic cards are focused on ray tracing, and Caustic has developed a fundamentally different approach to solving the ray-tracing problem.

“GPU companies look at ray tracing as a computing problem: If I just keep adding more cores, I can solve this problem,” notes Imagination Technologies’ director of business development, Alex Kelley. “But that means I’m also adding more power. That’s why you see these GPUs consuming 120W apiece.”

But Kelley says ray tracing turns out to actually be as much a database problem as a computing problem.

Generally speaking, he explains, ray tracing works by casting rays from an imaginary camera, through the pixel plane of the final image and into the scene. When they intersect a surface, the program computes the color of the resulting pixel by combining the surface’s orientation and material properties with incoming light. That incoming light is affected by scene lights, cast shadows, reflective materials and indirect lighting (light bouncing off of other objects in the scene), and more.

It’s simple in principle. You can create a ray-tracing algorithm with astonishingly little code. Here’s a ray tracer that fits on a business card: cs.cmu.edu/~ph/src/minray/minray.card.c.

In practice, most rays don’t intersect most surfaces–and your algorithm spends most of its time running down dead ends. To speed things up, you must first create an “acceleration structure” that rationally divides your scene geometry into smaller regions to minimize the amount of time spent pursuing dead ends.

The nature of ray tracing, however, remains inherently random.

“When a ray hits a surface in the scene,” says Kelley, “it goes off in a random direction, hits another object, goes off in another random direction, hits another object. The challenge is maintaining all the scene information in cache in order to be able to compute the final shading for ]a given] pixel.”

GPU cards typically solve this challenge by requiring you to fit all scene geometry and textures in cache onboard the card. High-resolution textures quickly eat into the amount of amount of geometry you can place on a card, but once you have to reach across the system bus for data from main memory, the speed advantage of your GPU card disappears.

R2500
The Caustic Series2 R2500 Ray Tracing Acceleration Card retails for $1,495 (includes Caustic Visualizer).
R2100
The Caustic Series2 R2100 Ray Tracing Acceleration Card retails for $795 (includes Caustic Visualizer).

Shifting the Focus

Caustic took a different approach to speeding things up. “The ray/surface intersection part of the problem, which is a computing matter, was solved years ago through Moore’s law,” says Kelley. “So we said, ‘Let’s focus on the database problem.’”

How do you manage the random nature of ray bounces? Caustic’s solution is an algorithm that holds rays in mid-flight until it collects enough of them going in the same direction.

“You shoot an object from the camera and it hits an object,” says Kelley. “We will hold that ray; we won’t progress any further until we have a sufficient number of rays vectored in the same direction. That way, when a ray hits the final object in the scene, it’s likely that the shading information will be there–not only for that ray but, since we’ve been holding all these other rays in flight, for a lot of rays that will need that same shading information.”

This is a much more efficient approach to solving the database problem, minimizing the number of times a part of the scene is read from the memory.

“We developed a PCI Express card that does just that: It holds the acceleration structure and the geometry, and it does all the ray flow,” Kelley explains. “Then it tells the CPU ‘OK, we now know what pixel shading information is required, go shade it.’

Imagination + Caustic

Imagination Technologies, which acquired Caustic in 2010, isn’t a familiar name in the desktop 3D arena; it’s much better known in embedded systems. Developers of the PowerVR chip set, Imagination provides GPU cores for many smartphones and tablets.

The reason for the firm’s success, says Imagination’s Alex Kelley, is that it’s been able to provide a fast, low-power solution–thanks to its development of technology around deferred rendering. Caustic is using a deferred rendering algorithm for ray tracing, as well, he notes.

Eventually, Kelley adds, Imagination would like to take its ray-tracing application programming interface into its PowerVR chipset.

“They want to provide that ray-tracing capability to their customers in the future and, at the same time, grow up into the professional 3D marketplace with the Caustic add-in cards,” he concludes. “That’s where this is going. That’s the end game.”

“We break the problem into two,” he continues. “The database problem is solved by the card, and the shading is done–in this current generation–by the CPU. That’s our secret sauce.”

Caustic holds 21 patents on its approach, which it says yields efficiency gains up to 30 times over other ray-tracing algorithms.

Because the CPU does the actual shading, all the textures are kept in system RAM, freeing up space on the Caustic cards for more geometry. On the R2500 card, that amounts to about 120 million triangles. The end result is a fast, efficient card capable of supporting large geometries with comparatively low power.

Caustic’s R2100 card, with a single ray-tracing unit (RTU), draws a maximum of 30W. The R2500, with dual RTUs for dual-CPU workstations, consumes a maximum of 65W.

The Bottom Line

Caustic cards provide between two-and-a-half and five times the ray-tracing performance of a CPU alone, according to the company. Rhino, with its lower overhead, tends to gain more performance than Maya and 3ds Max. Starting at $795, they’re comparatively cheap and consume less power than comparably performing GPU-based cards.

Of course, GPUs are useful for other things as well–computational fluid dynamics (CFD), say, or high-end image processing. But if you’re a designer who’d like better ray-tracing performance, a Caustic card might just be your solution.

The Caustic Visualize plug-in doesn’t require hardware acceleration. You can download a free 30-day trial of the software here. Rhino 5 users can download the Neon plug-in free here.

Contributing Editor Mark Clarkson is DE’s expert in visualization, computer animation, and graphics. His newest book is Photoshop Elements by Example. Visit him on the web at MarkClarkson.com or send e-mail about this article to DE-Editors@deskeng.com.

About Mark Clarkson

Contributing Editor Mark Clarkson is Desktop Engineering's expert in visualization, computer animation, and graphics. His newest book is Photoshop Elements by Example. Visit him on the web at MarkClarkson.com or send e-mail about this article to DE-Editors@deskeng.com.