GPU's and ray tracing

R3MF

Senior member
Oct 19, 2004
656
0
0
Intel are making a great deal of fuss about ray-tracing becoming viable on 8-16 core penrhyn systems, using the excellent work of Daniel Pohl at the recent IDF.

but why use CPU's?

i accept that raster based GPU's are not optimised to do ray-tracing calculations, but surely 128+ unified FP shader engines and run ray-tracing calcs faster than a generic x86 CPU.......................!?!?

please help me understand.
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
Ray tracing uses very simple vector calculations. So simple that I just wrote a MATLAB program to do ray tracing in about two hours. The way ray tracing works is to calculate where one vector will intersect the surface of a medium with a different refractive index. Once this intersection is achieved, Snell's law (n_1*Q_1=n_2*Q_2, where n is the refractive index and Q is the incident angle, 1 and 2 are the two different media interfacing at the surface) is the only calculation. Then, you just look for another point at which the ray will intersect with a surface, rinse and repeat. Thus, each ray can run in parallel to every other ray, but the calculations for each ray must be performed in series.

My particular application involves only one collimated light source in a 2-D plane, but doing this in 3-D becomes much more expensive. How expensive depends on the density of rays you need to obtain good image quality. There are a few simple averaging techniques I can think of that would make it more efficient, but by and large, the best image quality will always come from tracing one ray per pixel. This necessarily requires many in-series computations for complex scenes, while the number of parallel operations (number of rays) is pretty much fixed. I don't know that much about how GPUs work, but hopefully from this description you can figure out why a CPU or GPU might be better.
 

BrownTown

Diamond Member
Dec 1, 2005
5,314
1
0
Originally posted by: CycloWizardthe best image quality will always come from tracing one ray per pixel

Actually any raytracer worth its snuff will shoot MANY rays per pixel, but thats another discussion entirely. Anyways, I would bet that was the current programmability of GPUs they would in fact be better than CPUs for doing raytracing calculations. However what you really need is a raytracing processor (RPU?) what is specifically designed for this purpose. A GPU is designed to implement the standard graphics pipeline efficiently and will not be even remotely well used doing raytracing. However a "RPU" would have hardware acceleration for the major raytracing functions and so would be much better suited for this task than either a GPU or CPU could hope to be.

EDIT: for example I made a raycasting engine (completely different, but close enough idea) instanced on an FPGA which gave my P4 a run for its money in terms of FPS despite running at only 15MhZ, an ASIC CMOS design for a raytracing processor could EASILY beat 16 penryn cores despite having less transistors than a single penryn core. However there simply is no demand for such a product and until there is nobody is gonna invest 100+ million dollars to develop such a part. Although at some point in the future I do see graphics cards going this direction. Also, FWIW raytracing is EXTREMELY intuitive and models accurately the real wolrd interactions. The current graphics cards specify transforms explicitly, but the requisite computation are all done implicitly in raytracing. In other words all the complex effect you see in games occur naturally by raytracing without any need to do complex math. A single person fluent in C++ and computer graphics could probably write a raytracer that rendered better looking images than even the most advanced computer games in less than a year.
 

Modelworks

Lifer
Feb 22, 2007
16,240
7
76
I would almost kill for real time ray tracing.
Currently it can take 40- 3ghz cpus a little over 18 minutes to render a single frame.
using vray.
Great product if your really into rendering.
http://www.chaosgroup.com/software/vray/

works as good/better as mental ray , but I think its a bit faster.

Nvidia has a project that uses the gpu for rendering scenes exported from applications, but not in real time.
http://www.nvidia.com/page/gz_learn.html

I looked at using it for a time, but the effort involved in porting scenes to it wasn't worth the time saved.
I may check it out again when I get some time, looks like they improved some of it.





 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
Originally posted by: BrownTown
Actually any raytracer worth its snuff will shoot MANY rays per pixel, but thats another discussion entirely.
Like I said, my experience in ray tracing is extremely limited and is for purely optical purposes. So, just out of curiosity, why would you want more than one ray per pixel? Would you average the results when you were done?

I suppose if it were me and I had unlimited computational resources, I would start at one pixel that you would "see" and use a reverse iterative process to determine where it came from and, therefore, what you should see in that pixel. In practice, this is completely infeasible.
 

Modelworks

Lifer
Feb 22, 2007
16,240
7
76
Heres a screenshot from my default setup of vray.
It shows the options that are available on a commercial raytracer.
http://www.modworks.net/vray.jpg

Commercial ray tracers like vray are very detailed. Theres some 9 pages of options to adjust the output.

what I think would be more important is a real time radiosity engine.
Radiosity can make even a low resolution image look good compared to the raytraced only version.
http://en.wikipedia.org/wiki/Radiosity
 

BrownTown

Diamond Member
Dec 1, 2005
5,314
1
0
Yes, you do average the pixels coming out of each ray. It has to do with bad aliasing on sharp transitions and objects with finer details than the pixel size among other things. However I am pretty sure that real time raytracing algorithms only do 1 ray per pixel. this "vray" program and others do FAR more work than could possibly be done in real time, however you can cut out 90% of the work and still get an image that looks VERY similar. So, you will not be getting the "photorealalistic" effects of raytracers in real time for quite a while, but hopefully you can still get close.
 

R3MF

Senior member
Oct 19, 2004
656
0
0
so, will realtime raytracing with a visual impact at least as good as tomorrows raster games (read: Crysis) actually be achieveable on todays hardware (read: 8800GTx / 2900XT)?

cheers
 

NanoStuff

Banned
Mar 23, 2006
2,981
1
0
No, not even close. There is a point of complexity where raster graphics are actually slower than ray tracing, at which point it no longer makes sense not to ray trace, but that point is still well off into the future.
 

BrownTown

Diamond Member
Dec 1, 2005
5,314
1
0
Also, like I said, talking about graphics cards ala "8800GTx / 2900XT" in terms of raytracing is meaningless. These are highly optimized ASIC designs made for one purpose: to render the standard graphics pipeline as fast as possible. Talking about one of these chips for raytracing is like talking about using a dumptruck as a family car, sure you *could* drive to work in a dumptruck every day, but it is designed for something completely different and will be horribly inefficient for the use of personal transportation. The same is true for using a 2900XT for raytracing. They have done alot with programmable shaders to increase the types of work that can be done with these cards, but they can never be as fast as dedicated hardware.
 

R3MF

Senior member
Oct 19, 2004
656
0
0
but surely a CPU is an even more 'wrong' way to do rat-tracing?

so at what point do we get ray-tracing hardware, and does it evolve out of CPU or GPU technology, or does it spring from nowhere like the PPU?
 

BrownTown

Diamond Member
Dec 1, 2005
5,314
1
0
I would assume that GPUs would be better for raytracing than CPUs, but I am not 100% sure in that regard. Raytracing is pretty muc h the most absurdly parallel task ever created though, so in the age of multi core CPUs if they are looking for something that will actually scale with new cores then they will often use raytracing because it scales so well (every rendered pixel is independent of every other, only problem is sharing the cache). I would personally expect them to spring from the GPU arena due to the fact that these people have the most experience with graphics, and that graphics are their business model. However when you look at a huge company like Intel they might be more suited for the development of a radically new deisign simply given the number of engineers they have, and the financial backing they can procure. For example a processor like "Larabee" with many very simple X86 cores might be a good starting point. OR perhaps their 80 core design could be the foundation for a raytracing core.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |