Curyous
Curyous

Reputation: 8866

Is it possible to use GPU for raytracing without CUDA/OpenCL etc?

I'm working on Windows Phone 7 which does not support features like CUDA or OpenCL. I'm new to the GPU side of things, Is there anything on the GPU that I can use to help speed up raytracing? Like triangle intersection tests? Or selecting the correct colour from a texture?

Upvotes: 0

Views: 881

Answers (2)

CygnusX1
CygnusX1

Reputation: 21779

Raytracing is still a bit slow, even on modern average desktop PC. You can speed it up by shooting just primary rays, but then rasterisation methods will be actually better and faster.

Are you certain, you want to do ray-tracing on a phone, which has even less compute power than PC? They are not designed to do that kind of work.

Upvotes: 0

Chris Pitman
Chris Pitman

Reputation: 13104

CUDA and the like are really just higher level languages for programming shaders, so any platform that supports programmable shaders allows you some capability to run general purpose calculations on the gpu.

Unfortunately, it looks like Windows Phone 7 does not support custom programmable shaders, so GPU acceleration for a ray tracer is not really possible at this time. Even if it was, it is very difficult to effecticely use a GPU for raytracing because of several very anti-GPU characteristics:

  1. Poor memory coherency (each ray can easily interact with completely different geometry)
  2. High branching factor (shaders work best with code that consistently follows a single path)
  3. Large working set (A lot of geometry has to be accesable in memory at any one time to compute the outcome of even a single ray)

If your goal is to write a raytracer, it would probably be far easier to do completely on the CPU, and only then consider optimizations that are more esoteric.

Upvotes: 2

Related Questions