|
![](/i/fill.gif) |
First Thing, yes using patterns directly would be slightly faster
by removing per lookup approximately
10 multipulcations / divisions
5 add/subs
2 compares
1 or 2 function calls
(this is done from my color conversion so you can use red/green hf
images, and blending of colors of evalpigment, this is off the top of my
head so
for sake of argument lets triple these numbers)
How ever most patterns use noise which is a couple of magnitudes of more
adds and muls.
so depending on how much turbulence and which pattern you gain anywhere
from 0.01% to 50% gain, the 50% gain is if you use gradient with
no turbulence, might as well use y-floor(y) and possibly get an even
faster speed gain. but i would stay 99% of the functions the speed gain
would be less then %1
note on precision: colors do use floats, but some compilers reduce
doubles
to floats when they are told todo fast math, personally i compile
without fast math.
without the source in front of me i'm not sure if eval pattern does the
turbulence or not, however i don't see it a hard addition, just a
tedious
one. (as pattern in heightfields uses pigments too if i remember right
when i was trying to add a cap to 0..1 capability to use my fractal
terrains i haven't yet ben able to make sure it returns values between 0
and 1 .. i degress)
Chris Huff wrote:
>
> In article <386c87de@news.povray.org>, Nieminen Juha
> <war### [at] punarastas cs tut fi> wrote:
>
> > Chris Huff <chr### [at] yahoo com> wrote:
> > : Another advantage could be the increased precision, aren't color_maps
> > : limited to 255 levels of color?
> >
> > Says who?
>
> I don't know. Which is why I didn't state it as a fact. :-)
> I know they are limited to 255 entries, but I don't know how much
> precision a float value derived from a color_map would have. I haven't
> taken a close look at that part of the code. But the patterns can return
> double precision values, and they don't have to interpret a color_map to
> do so. This makes slightly less flexibility, you can't alter the
> waveform with a color_map, but could be a lot faster.
>
> --
> Chris Huff
> e-mail: chr### [at] yahoo com
> Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
![](/i/fill.gif) |