|
From: Bastian M. <bma...@we...> - 2013-09-01 09:32:49
|
Am 31.08.2013 23:19, schrieb Juhász Péter:
> Dear gnuplot list,
>
> continuing my recent series "exposing possible bugs by fun, useless
> scripts", here is a nice plasma effect:
>
Nice one! To improve the animation speed, I checked wether using "with
image" instead of pm3d would help. Tests were done without the colorbox
and key using the wxt terminal on Windows 8. Here are my results:
pm3d: 28 fps
with image: 40 fps
with image + refresh: 162 fps
Using the pseudofile '++', we can actually reuse the plot data with
"refresh". You can find the updated script below.
Bastian
----
reset
set sa 50
set isosa 50
set xrange [-10:10]
set yrange [-10:10]
unset colorbox
unset key
bind "Escape" "t = 10"
plasma(x,y) = sin(x / .8) + sin(y / 1.6) + sin((x + y) / 1.9)
pal(t) = sprintf("set pal model HSV functions frac(gray+%f),0.5,1",t)
frac(x) = x - int(x)
t = 0
start = time(0.)
eval pal(t)
plot '++' using 1:2:(plasma($1,$2)) with image
while(t < 3){
eval pal(t)
t = t + 0.01
pr t
refresh
}
print sprintf("%.2f frames/second", t/0.01 / (time(0.) - start))
reset bind
----
>
> set term x11
> set sa 50
> set isosa 50
> set pm3d
> unset surface
> set view map
>
> plasma(x,y) = sin(x/.8)+sin(y/1.6)+sin((x+y)/1.9)
> pal(t) = sprintf("set pal model HSV functions frac(gray+%f),0.5,1", t)
> frac(x)= x-int(x)
> t = 0
> while(t<10){eval pal(t); t= t+0.01; pr t; splot plasma(x,y)}
>
>
> With the x11 terminal I notice that there is "snowing" on the picture,
> that is, some of the pm3d rectangles have incorrect color in certain
> frames. Rounding or accuracy effect?
>
> I don't know if this is significant at all, but it doesn't show with the
> wxt or qt terminals.
>
> Peter
>
|