POV-Ray : Newsgroups : povray.general : ISO optimization : Re: ISO optimization Server Time
5 Aug 2024 18:17:18 EDT (-0400)
  Re: ISO optimization  
From: Rafal 'Raf256' Maj
Date: 5 Aug 2002 13:15:48
Message: <Xns9261C35851D0Draf256com@204.213.191.226>
Christopher James Huff <chr### [at] maccom> wrote in
news:chr### [at] netplexaussieorg 

> Yes, slow down. Computing a value from a voxel field is obviously
> slower than using an existing variable. 

not computing is needed, this voxel field will have no interpolation

just, for pixels in <0,0,0>-<1,1,1> tak max_gradient 2.0 
etc

> "optimized into set of boxes"...what do you think voxels are?

voxel is a set of SAME SIZE boxes, and therefore :
 
> And the memory...assume 32 bit floats are used instead of 64 bit 
> doubles, for compactness. A 128*128*128 field would have 2,097,152 

while I was thinking of something that.. hmm how to say it... like uhm 
antialias, or 3d version of binary-tree 

2d example for this :

11112222 start with 4 cubes and calcualte theirs max gradient.
11112222 if gradient is same in all 4 (or almost simmilar in some
33334444 threshold) -  make 1 cube with, end finish, if not :
33334444

1122  for each of 4 cubes, divide it into 4 smaller cubes, and repeat
3344  previous step

as in AA, we need to define max-recursion-level and threshold

example, we have a box and torus :

***
***
***  ** 
    *  *
     ** 

we will need :
- one big box in upper-left that covers ball,
- 2 boxes in lower-left and upper-right with max-gradient = 0
- several small boxes that will describe quite compicated shape of torus
- one medium box inside in torus with max_grad = 0 (hole in torus)

so we will need about 10 boxes, now think about :

************
************
************
************ 
*************
          *  *
           **

1 biig box + 3..10 smaller will describe this shape, as well as
regular gird of about 20x10 pixels

in 3d this approach will give even better results

implementation  - 'binary' tree, but each node wil have 4 sons, not 2



-- 
#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.