POV-Ray : Newsgroups : povray.binaries.images : universal fractal macro (followed by 9 images) : Re: universal fractal macro (followed by 9 images) Server Time
18 Aug 2024 14:21:59 EDT (-0400)
  Re: universal fractal macro (followed by 9 images)  
From: Wlodzimierz ABX Skiba
Date: 25 May 2001 14:23:35
Message: <3b0ea327@news.povray.org>
Warp wrote in message <3b0e95da@news.povray.org>...
> This kind of behaviour disallows transformation optimizations (even
> a simple translate has to be stored as a transformation matrix). I wonder
> how much impact this has in rendering speed of objects which are copied
> many times (by just translating the copies or doing other optimizable
> transformations).
> I wouldn't even be surprised if the speed penalty was minimal.

The speed should be achived not by faster rendering but memory menagement. When
you use small part of memory you ommit swaping of memory. When you create one
tree it uses sizeof(TreeObject). When you create N copies of this tree now it
uses N*sizeof(TreeObject). When you use refer{} it uses only
N*(sizeof(pointer)+sizeof(matrix)). For small N perhaps your scene could fit
into cache of processor. For large N you don't need swaping. This is
speed-optimization. Not as algorithm. I know that transformation use time. But
sometimes it is faster than swaping of large scene. Also this could be faster
for parsing becouse when you copy traditional there is CopyObject runed which
copies all childrens of current object. When you use refferencing it only store
transformation and pointer (with bbox calculation etc.).

> Can you try with something like:
>#declare IndY = 0;#while(IndY < 10)
>  #declare IndX = -50;#while(IndX <= 50)
>    #declare IndZ = -50;#while(IndZ <= 50)
>      object { Obj translate <IndX,IndY*4,IndZ> }
>      #declare IndZ = IndZ+2;
>    #end
>    #declare IndX = IndX+4;
>  #end
>  #declare IndY = IndY+1;
>#end


I don't want built it into object{} statement. I prefer new refer{} statement
with integer referencing counter field within basic object's fields.
In your example there is only (10/1)*(100/4)*(100/2)=12500 and it should fit
into many RAMs. But imagine scene with CSG of 1000 objects copied 1.000.000
times ? Such scenes were inspiration.
And I'm sorry - I leave internet for 10 days and I can't answer next questions.
Best regards for whole week.

--
#macro Sig(A,B,X)_(A,B)_(B,X)_(X,A)#end#macro _(A,B)cylinder{<A.x,A.y,3>,<B.u,
B.v,3>.1,9}#end global_settings{max_trace_level 9}light_source{0 1}camera{up y
*4right-3*x}blob{_(<3,1>,<1,-5>)_(<2,-2>,<4,-2>)Sig(x,<-1,1.5>,<1,3>)_(z-1,z-4
)pigment{rgb 1}}box{-3 3pigment{rgb 0}finish{reflection 1}hollow} // POV-Ray31


Post a reply to this message

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