Jump to content

  • Log In with Google      Sign In   
  • Create Account


Best Ray Tracing algorithms


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 dpadam450   Members   -  Reputation: 826

Like
0Likes
Like

Posted 05 April 2013 - 03:24 PM

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?



Sponsor:

#2 ApochPiQ   Moderators   -  Reputation: 14104

Like
2Likes
Like

Posted 05 April 2013 - 03:46 PM

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

#3 dpadam450   Members   -  Reputation: 826

Like
0Likes
Like

Posted 05 April 2013 - 07:01 PM

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



#4 Bacterius   Crossbones+   -  Reputation: 7981

Like
0Likes
Like

Posted 05 April 2013 - 08:51 PM

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.


The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#5 MJP   Moderators   -  Reputation: 10117

Like
0Likes
Like

Posted 06 April 2013 - 12:24 AM

My personal favorite algorithm:

 

1. Download embree

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

3. Cast lots of rays



#6 Aressera   Members   -  Reputation: 1299

Like
0Likes
Like

Posted 06 April 2013 - 12:37 AM

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.

Edited by Aressera, 06 April 2013 - 12:42 AM.


#7 Norman Barrows   Crossbones+   -  Reputation: 1835

Like
0Likes
Like

Posted 06 April 2013 - 01:26 PM

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


Norm Barrows

Rockland Software Productions

"Building PC games since 1988"

 

rocklandsoftware.net

 


#8 ApochPiQ   Moderators   -  Reputation: 14104

Like
1Likes
Like

Posted 06 April 2013 - 06:30 PM

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

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

#9 ApochPiQ   Moderators   -  Reputation: 14104

Like
0Likes
Like

Posted 06 April 2013 - 06:32 PM

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.

Edited by ApochPiQ, 06 April 2013 - 06:32 PM.
Typo


#10 Vilem Otte   Crossbones+   -  Reputation: 1344

Like
1Likes
Like

Posted 06 April 2013 - 08:04 PM

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


#11 MJP   Moderators   -  Reputation: 10117

Like
0Likes
Like

Posted 07 April 2013 - 12:24 AM

 there are also gpu ray tracers our there!

 

Indeed. Optix is actually quite good, if you can live with the Nvidia-only restriction.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS