POV-Ray : Newsgroups : povray.general : save hf pattern ? : Re: save hf pattern ? Server Time
5 Aug 2024 12:19:01 EDT (-0400)
  Re: save hf pattern ?  
From: Rafal 'Raf256' Maj
Date: 30 Sep 2002 15:00:37
Message: <Xns9299D5812679Craf256com@204.213.191.226>
ABX <abx### [at] abxartpl> wrote in
news:lbufpugbe3cien2isqkvbvi7gkudscq99c@4ax.com 

[...]

Maybe I didnt pointed where IMHO it could be usefull.
Generaly I think that POV can be about 100-1000% (!) faster in some complex 
scenes when using some optimization tricks. I have some ideas, probably 
most of them are not so good, but maybe at lest few can be usefull.

I know it would be best to implement them myself. Currently I'm 
implementing a path to speed up focal blur calculations :) It will have 
some limiationts but in some cases it should work about x2..x5 times faster 
with almost identical quality.
But this HF is someting too hard for me (currently).


Back to HF (sorry for long post) 
We have scene like :


// file - testscene.pov
[...]
height_field { ... }
height_field { ... }
height_field { ... }
height_field { ... }

now when we i.e. give it to a friend, (OR - use it in some multi computers 
network addon) we must render first 4 scenes, correct pathes to output of 
them, and finaly run main secene.

In my idea there is no need to even set save_file or load_file - all is 
"auto-magic" ;)

height_field { pattern 1000,1000 { x+y+z * sin(x  *10) } cache_data }

at first pass - on "new" computer (or after deleting of temorary data)
computer will take pattern formula and strip it from whitespaces/comments, 
to get "ID" of this pattern "x+y+z*sin(x*10)"

Computer counts this pattern in 1000x1000 resolution, and saves it (as 
suggested) as .png / .tga file.
File name is "testscene_cache0.tga"
Formula ID is saved in testscene_cache0.id - "x+y+z*sin(x*10)"

Same with other HF's creating testscene_cacheN.tga and .txt N=1..3

-------------

In next pass, if change is done onlyt to 3-rd HF formula,
1-st HF - computer searches all testscene_cache*.id 
at whe found that formula "x+y+z*sin(x*10)" is already saved on HDD - so 
computer just load's it. Same for other HF's except 3-rd.

Copmuter see that one of HF is not cached, so he recalucalets it (as in 
first-pass).

In addition computer may notice that one of files
cache_scene*.tga what NOT used, and computer may delay it (to save users 
HDD space) or better - this file can be deleteed i.e. after some time (like 
3 days) - something simmilar to i.e. WWW browsers cache.

-------------

In result, if we have 4 HF's each 3000x3000 with COMPLEX formulas and scene 
is simple in 640x480 then :

+ render time is not about 10:00 but about 0:10 
+ we can give .pov to any user without explaining him how to prepare all 
  HF's, or without sending him ~30 MB data.
+ we can run .pov %100 automaticly
+ HF's will be recalculated only if needed
+ users HDD space will not wasted by outdated cache files

- We have to write a patch.

What are other disadvantages ?

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