|
![](/i/fill.gif) |
Invisible wrote:
>>> 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.)
In fact, I think NVidia does allow alternate code paths - but the unit
executes both code paths, and then discards the one you don't need.
> Again, depends on whether you're writing a shader, or using a GPGPU system.
Same thing nowadays, its just the shaders are written in a dialect of C
that's more capable than the ones used for graphics.
>> 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.
To be precise, they don't allow indefinite recursion. You can actually
have recursion where you specify the number of levels at compile time.
After that, however, you can't change it without compiling a new shader.
> 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!! >_<
Isn't that what Pascal's triangle is for?
> Why do I bother?
Be honest, it's because you enjoy it :)
Heck, I expanded the evaluation of a bezier patch to give cubic
functions by hand. A bicubic equation fully expanded takes about half
of a standard sheet of notebook paper, but then there's the derivation
which takes a few pages ;)
...Chambers
Post a reply to this message
|
![](/i/fill.gif) |