Hybrid Ray Tracing Feasability

Started by
11 comments, last by Krypt0n 11 years, 9 months ago
You can write almost any kind of illumination algorithm in a modern shader language, if you're clever and patient enough. A few minutes on Google looking for such projects might prove very informative for your search.

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

Advertisement
To make this as fast as possible you'll want to use all available features of the latest GPU's. I don't follow Cg very closely so I'm not sure if they're totally up-to-date on all modern GPU functionality, but that stuff is definitely available in HLSL and GLSL. Ideally you'll probably also want to make use of compute shaders or OpenCL, since they have a few features available to them that aren't accessible in pixel/fragment shaders. They also free you from having to work within a rasterization pipeline.
shaders are nowadays flexible enough to implement whatever you'd like to. Raytracing samples exist for quite a while e.g.
http://www.iquilezles.org/www/articles/simplegpurt/simplegpurt.htm
There were also some "eye iris" tracing and you'll also find some paper about traversing accelerator trees in shader (before there was opencl and cuda).

And the performance is really case by case dependent:

just porting 1:1 shader to opencl/cuda/cs usually slows you down a bit, just by exploiting the possibilities of compute units you then gian an advantage, sometimes you can be 10x as fast (or even more, it really is down to the task and implementation), but my point is, if you want and it's simpler for you, start with cg and switch once you reach the limitations or at least it become too rubbish to work around those.

This topic is closed to new replies.

Advertisement