|
 |
>> I was thinking more along the lines of each surface possibly having a
>> different code path for computing illumination. Rays in the same
>> bundle can't take different code paths.
>
> Sure they can, you just have an "if" in the shader code based on some
> flag in the ray data.
I was under the impression that all cores in the bunch would have to
take the same branch of the if - you can't have half go one way and half
go the other. (That's what makes it a SIMD architecture.)
I was also under the impression you can have predicated instructions,
however. (I.e., a single instruction that executes or doesn't based on a
condition. But not a whole alternate execution path.)
> Some things I think the CPU still needs to do, like preparing the ray
> data to put on the GPU at each step. It is quite hard to write a shader
> that does anything other than return one "output value" per "pixel", ie
> you can't write a shader that returns a veriable number of rays, the
> only thing you can do is return a flag set that means "spawn another ray".
> I was thinking more about how to store the scene on the GPU efficiently,
> if you just have a triangle list it is relatively simple.
Again, depends on whether you're writing a shader, or using a GPGPU system.
>> The only real problem is going to be trying to run something like
>> isosurfaces, which use adaptive space division; a GPU probably won't
>> like that.
>
> Nah it's no problem :-) Modern GPUs don't have any limit on loops or
> number of instructions or anything like that.
But they don't allow recursion. That's the issue.
>> Also depends on whether you're trying to write your code as a shaper,
>> or use a real GPGPU system. (Such as the OpenCL in the title.)
>
> I think something like a raytracer will be too complicated for a
> computer to try and figure out how to put it on the GPU the best way,
> needs to be hand coded by an intelligent person :-)
...and?
All GPGPU does is allow you to run programs on a GPU which don't
necessarily have to be shaped like shaders. You still have to write the
code yourself. It's just that you don't have to pretend it's
graphics-related even if it isn't.
> Damn. If you think up *anything* you think is new, you can be
> guaranteed that someone else somewhere has already thought of it :-)
> The internet just makes it easy to find that person!
I've had the same problem with mathematics my entire life.
Do you know how hard it is to draw a cube made of 8 cubes and measure
all their sides? Do you know how long it takes to expand (x+y)^9
manually, by hand? Do you have any idea how long it takes to figure out
what the pattern is and where it's coming from?
...and then I discover some entry-level textbook that tells me how some
dead guy already figured all this out several centuries ago. AND FOR
ARBITRARY EXPONENTS!! >_<
Why do I bother?
Post a reply to this message
|
 |