|
![](/i/fill.gif) |
Alain wrote:
>> Yeah, it's really horrible. POV's SDL wasn't meant to be quick at
>> everything...
>>
>> So far, my C++ implementation is very fast, for not being coded with ASM
>> and all. I was able to implement a few speedups, like not using
>> sqrt(x*x+y*y) for *every pixel*, but instead making a 1/4 circle 2D
>> array and picking from that.
>
> What's the fastest? sqrt(x*x+y*y) or sqrt(x^2+y^2)
> In POV-Ray SDL, the second, as sqrt(pow(x,2)+pow(y,2)), is faster. Don't
> know how it compare in C/C++ or other compiled languages.
>
> May be worth testing.
>
> Alain
Hmm, I was not aware that pow(n,2) was faster than n*n. I'll keep it in
mind next time the issue comes up. In my program, sqrt(x*x+y*y) is only
called at the very beginning to fill a small array.
Post a reply to this message
|
![](/i/fill.gif) |