Best Ray Tracing algorithms

Started by
9 comments, last by MJP 11 years ago

Looking for opinions. I'm generating these structures for collision models to be used for bullet collision as well as to be used to bake global illumination light maps. Suggestions?

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

Advertisement
I'm not clear on what exactly your goal is... rendering algorithms? Generic collision ray casting? Global illumination solvers?

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Generic ray to triangle mesh intersection for physics as well as baking light maps. This is not for a ray tracing renderer.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

Generic ray to triangle mesh intersection for physics as well as baking light maps. This is not for a ray tracing renderer.

You might have better luck googling around for "ray casting" rather than ray tracing, as ray tracing is exclusively connotated to rendering.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

My personal favorite algorithm:

1. Download embree

2. Integrate the ray-tracing kernel into your engine/tools

3. Cast lots of rays

I've implemented the quad-BVH SIMD tree with pretty good success, 1.5 million rays/thread/second on a 3.4 GHz Core i7. It has a number of advantages over traditional BVHs and even KD trees, like doing 4 ray-bounding-box or 4 ray-triangle tests in parallel, plus it generates very shallow trees (no more than 6 or 7 levels). It's a little tricky to implement and you'll have to learn SSE to do it, but it's what I used in my sound propagation library to trace sound rays. It's going to be faster than ray packet tracers in most cases because you don't have to deal with incoherent rays.

3d Bressinham's is fast , and fast is good.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

3d Bressinham's is fast , and fast is good.

Bresenham is a ray marching algorithm. It's not useful for non-voxelized data sets.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Generic ray to triangle mesh intersection for physics as well as baking light maps. This is not for a ray tracing renderer.

What does your triangle mesh data look like? Some scenes are highly amenable to reduction by bounding-volume hierarchy trees; others by octrees or kd-trees; and still others are chaotic enough (like most indoor 3D shooter environments) that you'd need to customize the approach based on other factors.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

I second that the easiest solution would be to use Embree (or other ray tracing library). For high performance ray tracing you probably want either spend a LOT of time on optimizations (or use GPU and spend also a LOT of time on it). Currently state of the are are probably speculative gpu traversal kernels, SplitBVH for scene management (for high traversal speed, for fast build I'd say HLBVH build on GPU) along with Woop triangles (instead of standard). KD-trees aren't commonly used as they were (basically they're giving worse performance on GPU, and also are slower to build). Of course on CPU they're still wide-spread (they give probably best performance for random rays -> being very good for (pre)computing GI), quit fast KD tree ray tracer can be put together in like a month (for newcomer - if he wishes to learn and work hard). I can give you few numbers - SahBVH + Woop Triangles + standard while-while ray traversal kernel on Radeon HD 6a770 - approx 50 to 60 MRay/s (for primary, like 30% less for diffuse rays). Building this-like ray tracer will take you few weeks of hard work (if you know what you're doing - e.g. you wrote few raytracers & you know all languages you use as better as your native-language). You can do a lot better (even going over 100 MRay/s), but that takes quite a while of reading & understanding papers, doing experiments, etc. If you don't have time for this - just grab Embree (or other ray tracing library, there are also gpu ray tracers our there!), and you'll have it instantly.

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com

This topic is closed to new replies.

Advertisement