POV-Ray : Newsgroups : povray.binaries.images : isoteapot : Re: isoteapot Server Time
16 Nov 2024 14:20:21 EST (-0500)
  Re: isoteapot  
From: Rafal 'Raf256' Maj
Date: 13 Jan 2003 19:39:06
Message: <Xns930310AB16E24raf256com@204.213.191.226>
ABX <abx### [at] abxartpl> wrote in
news:aju52vkn21i8o83452s558bq1p00t9ot05@4ax.com 

> Sure, you can. So what is the first? I have also some isosurface
> related ideas and I would like to listen your proposition before
> coding anything. 

Most simple - to buid complex bounding boxes, or rather bounding shapes. 
And to use 2 shapes. Bound and InnerBound. 

Best scene to ilustrate this speed up is :
  + simple isusurface (i.e. sphere, torus, blob etc)
  + but with displaced surface (i.e. +f_noise3d(x*10,y*10,z*10)*.1)
  + casting a big shadow (i.e. on plane under surface)
  + with area light

Shape A is stanart bounding_box - it covers MINIMU area where MIGTH be our 
isosurface

Shape B (inner-bounding) is a simple shape that coverw MAXIMUM area where 
MUST be our isosurface.

When ray (or shadow-ray) hits shape B - it is 100% shure that shadow is 
there (we do not have to do isosurface calculations). If it hits neither 
boxes - there is no shadow (this is now - standart bounding box).

Example :

        * light                

   ..........  <-- isosurface
  ...........
  .......... 
   ..........

----------------- plane






        * light                

   ..........  <-- isosurface
  ..XXXXXXX..
  ..XXXXXXX.    X-the inner bounding box
   .XXXXXXX..

----------------- plane
 12345678901234 - this 14 spots neede shado ray tests. most of them hit X, 
so we have about 80% less isosurfaces tests.


In some cases determinating inner-bounding-box shape is simple, i.e.:

isosurface {
  #local e=0.1;
  function {  x*x+y*y+z*z - 1 + f_noise3d(x,y,z)*e }
  contained_by { sphere { 0 1+e } } 
   inner_bound { sphere { 0 1-e } } 
 [...]
}

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