POV-Ray : Newsgroups : povray.binaries.images : isoteapot Server Time
14 Aug 2024 03:16:52 EDT (-0400)
  isoteapot (Message 9 to 18 of 18)  
<<< Previous 8 Messages Goto Initial 10 Messages
From: Rafal 'Raf256' Maj
Subject: Re: isoteapot
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

From: Rafal 'Raf256' Maj
Subject: Re: isoteapot
Date: 13 Jan 2003 19:43:49
Message: <Xns93031177E7E74raf256com@204.213.191.226>
"Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote in 
news:Xns### [at] 204213191226

>   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 } } 


function {  x*x+y*y+z*z - 1 + f_noise3d(x,y,z)*e }
contained_by { sphere { 0 1 } } 
 inner_bound { sphere { 0 1-e } } 

-or-

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 } } 

oh and I forgot, Imho for shapes where calculations are *very* expensive 
(like isosurfaces) we whould use comples shapes to bound them, or even 
hierarchies, like :

isosurface is bounded with:
  ..a very complex mesh (10,000 faces[1])
    ..and this compelx mesh is bounded with simple mesh (100 faces)
     ..and simple mesh is finaly bounded by box

[1] - this complex mesh can be builded automaticly i.e. by trace funcion, 
and results may be saved to some file and re-calculated only when 
isosurface will change.

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

From: ABX
Subject: Re: isoteapot
Date: 14 Jan 2003 05:13:47
Message: <u7m72v4vhlanttmfb0ik62ium5qaa73im4@4ax.com>
On 13 Jan 2003 19:39:06 -0500, "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote:
> > 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. 

Full intersection test is required to get normal, so it means your proposition
is useles for reflections and camera rays (and probably for photons). It might
be worth to test your proposition of curiosity for shadow tests (of all
objects, not only isosurfaces) but then I do not know how it should behave for
inverted objects and/or csg. Also the problem is that images are usually
focused on object itself and not on its shadow, micro-shadows made by
displaced isosurface on itself are hard to catch by such 'inner bounding'.

ABX


Post a reply to this message

From: ABX
Subject: Re: isoteapot
Date: 14 Jan 2003 05:31:51
Message: <amo72vsdloua9hc895825p54ljgthcmfva@4ax.com>
On 13 Jan 2003 19:43:49 -0500, "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote:
> oh and I forgot, Imho for shapes where calculations are *very* expensive 
> (like isosurfaces) we whould use comples shapes to bound them, or even 
> hierarchies

you can't ?

> isosurface is bounded with:
>  ..a very complex mesh (10,000 faces[1])
>    ..and this compelx mesh is bounded with simple mesh (100 faces)
>     ..and simple mesh is finaly bounded by box

mesh over mesh? have you actually measured difference between rendering of
square builded from two trinagles and from thousend of triangles?

> [1] - this complex mesh can be builded automaticly

'builded automaticly' means probably tesselation process, are you aware how
good tesselation is complicated? some methods are even patended! tesselation
needs a lot of calculations, too.

> by trace funcion

using 'trace' function you can get points _on_ isosurface but bounding
requires surface _around_ isosurface. moreover 'trace' sends ray to get
intersection, so you probably will need more intersection tests with your
'optimization' than without.

ABX


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: isoteapot
Date: 14 Jan 2003 07:27:48
Message: <Xns930388D47EBF7raf256com@204.213.191.226>
ABX <abx### [at] abxartpl> wrote in
news:amo72vsdloua9hc895825p54ljgthcmfva@4ax.com 

> 'builded automaticly' means probably tesselation process, are you
> aware how good tesselation is complicated? some methods are even
> patended! tesselation needs a lot of calculations, too.

But we don't need ideal tesselation. We will get object that +/- is a 
tesselation of isosurface, and then we will "inflate" this mesh, it would 
be hmm "bolder" or "more thick". Inflate will by by some size, that would 
be error_bound. Ofcourse this algoritm can produce error, because it is 
based on heuristics, like. i.e. radiosity.
 
> using 'trace' function you can get points _on_ isosurface but bounding
> requires surface _around_ isosurface. 

inflate

> moreover 'trace' sends ray to
> get intersection, so you probably will need more intersection tests
> with your 'optimization' than without.

save / load


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

From: ABX
Subject: Re: isoteapot
Date: 14 Jan 2003 08:20:30
Message: <cj382vk1n1410nijhvn0p8stgg9vi5o64a@4ax.com>
On 14 Jan 2003 07:27:48 -0500, "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote:
>ABX <abx### [at] abxartpl> wrote in
>news:amo72vsdloua9hc895825p54ljgthcmfva@4ax.com 
> > 'builded automaticly' means probably tesselation process, are you
> > aware how good tesselation is complicated? some methods are even
> > patended! tesselation needs a lot of calculations, too.
>
> But we don't need ideal tesselation. We will get object that +/- is a 
> tesselation of isosurface, and then we will "inflate" this mesh

"inflate" in what direction? returned by normal in trace()? how do you want to
verify that the new place for vertex is not again inside isosurface? of course
with another evaluation. in case it is inside where will you move your vertex?
and how do you want to guarantee that new  triangle does not cross isosurface
surface? of course with set of evaluations. IMO there is no efective way to
get it automated for general cases.

It seems you really think it is easy, I can hardly see small advantage from
this. In case you still don't want to touch POV-Ray source code feel free to
provide algorithms using POV-Ray SDL. There are isosurfaces, trace() and
meshes. You can define input parameters and output mesh. Then your help will
be appreciated.

> > using 'trace' function you can get points _on_ isosurface but bounding
> > requires surface _around_ isosurface. 
>
> inflate

outside.

> > moreover 'trace' sends ray to
> > get intersection, so you probably will need more intersection tests
> > with your 'optimization' than without.
>
> save / load

Yes. I'm waiting for your SDL version of this stuff.

ABX


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: isoteapot - 1 attachment
Date: 14 Jan 2003 10:35:33
Message: <Xns9303A8A655DC9raf256com@204.213.191.226>
ABX <abx### [at] abxartpl> wrote in 
news:cj382vk1n1410nijhvn0p8stgg9vi5o64a@4ax.com

>> > using 'trace' function you can get points _on_ isosurface but bounding
>> > requires surface _around_ isosurface. 
>> inflate
> outside.

inflanting *mesh* is possible - basing on normlas of mesh, not isosurface.

(some examples in attachment, images 3-5 is case 'hardeer' - when some 
parts of inflanted object interect, but it is possible to merge mesh)


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


Attachments:
Download 'inflate.gif' (7 KB)

Preview of image 'inflate.gif'
inflate.gif


 

From: ABX
Subject: Re: isoteapot - 1 attachment
Date: 14 Jan 2003 11:35:04
Message: <ble82v0gl5ps049hbfjuk3v3a4o2mka8uo@4ax.com>
On 14 Jan 2003 10:35:33 -0500, "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote:
> inflanting *mesh* is possible

Obviously, but ...

> basing on normlas of mesh, not isosurface.

...this does not change that whatever direction of normals is used then you
can't guarantee placement of vertices and triangles without intersecting
isosurface surface. those images you provided are easy to draw becouse you see
shape you are bounding. it is hard to read universal algorithm from those
pictures. please provide algorithm in readable form (POV-SDL could be best)

ABX


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: isoteapot - 1 attachment
Date: 14 Jan 2003 11:48:20
Message: <Xns9303B500FA5E4raf256com@204.213.191.226>
ABX <abx### [at] abxartpl> wrote in
news:ble82v0gl5ps049hbfjuk3v3a4o2mka8uo@4ax.com 

>> basing on normlas of mesh, not isosurface.
> ...this does not change that whatever direction of normals is used
> then you can't guarantee placement of vertices and triangles without
> intersecting isosurface surface. those images you provided are easy to
> draw becouse you see shape you are bounding. 

As I said before, I know that this algorithm may results in errors. But 
same might i.e. using adaptive in area_lights etc.

> it is hard to read
> universal algorithm from those pictures. please provide algorithm in
> readable form (POV-SDL could be best) 

ok...


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

From: ABX
Subject: Re: isoteapot - 1 attachment
Date: 14 Jan 2003 12:36:15
Message: <6ei82vcgkju23sh72efd7rmq7i14bc2gct@4ax.com>
On 14 Jan 2003 11:48:20 -0500, "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote:
> > it is hard to read
> > universal algorithm from those pictures. please provide algorithm in
> > readable form (POV-SDL could be best) 
>
> ok...

What I would like to see is a macro Inflate_Object_To_Mesh() as follow:

Input:
  Object   - the mesh should be builded outside of this object (isosurface)
  Accuracy - some intuitive handled float or vector accuracy
  ...      - other settings you need
  FileName - name for outputing mesh definition

Output:
  file with mesh definition as weel as returned mesh which can be assigned on
  located within scene.

ABX


Post a reply to this message

<<< Previous 8 Messages Goto Initial 10 Messages

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