POV-Ray : Newsgroups : povray.general : prism 20% faster :) : prism 20% faster :) Server Time
5 Aug 2024 18:24:54 EDT (-0400)
  prism 20% faster :)  
From: Rafal 'Raf256' Maj
Date: 10 Aug 2002 19:06:04
Message: <Xns9267A9958F0Draf256com@204.213.191.226>
Hi,
I just found out that linear_spline prism can be render about 20% faster, 
just after changing it to mesh (or even - set of triangles)

union {
  tra(_h,_a,_b)  tra(_b,_c,_d)  tra(_d,_e,_f)  tra(_f,_g,_h)
  tra(_f,_h,_b)  tra(_f,_d,_b)
  tra(_hu,_au,_bu)  tra(_bu,_cu,_du)  tra(_du,_eu,_fu)  tra(_fu,_gu,_hu)  
  tra(_fu,_hu,_bu)  tra(_fu,_du,_bu)  
  qua(_a,_b,_bu,_au) qua(_b,_c,_cu,_bu) // front side
  qua(_c,_d,_du,_cu) qua(_d,_e,_eu,_du) // right side
  qua(_e,_f,_fu,_eu) qua(_f,_g,_gu,_fu) // back  side
  qua(_g,_h,_hu,_gu) qua(_h,_a,_au,_hu) // left  side
[...]
}

//---------------------

  prism {
    linear_spline linear_sweep
    0, _q, 8
    <_a.x, _a.z>
    <_b.x, _b.z>
    <_c.x, _c.z>
    <_d.x, _d.z>
    <_e.x, _e.z>
    <_f.x, _f.z>
    <_g.x, _g.z>
    <_h.x, _h.z>
  }

3-rd option is to use mesh{} instead of union

and...:

mesh  55 sec
prism 51 sec
union 41 sec

hmm personaly I would expect somthing different :)

is't this some kind of bug ? imho mesh should be the fastest ?

-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.