POV-Ray : Newsgroups : povray.binaries.images : Iso floor grow (46Kbu) Server Time
19 Aug 2024 18:27:04 EDT (-0400)
  Iso floor grow (46Kbu) (Message 1 to 8 of 8)  
From: Andy Cocker
Subject: Iso floor grow (46Kbu)
Date: 10 Nov 2000 11:50:28
Message: <3a0c2754@news.povray.org>
Hi,

Just another experiment, posted because I have a couple of questions.

a) The code for each isosurface is:
#declare F = function { pigment { crackle form <1,0,0> color_map { [0.0 rgb
0.0 ] [1.0 rgb 1 ] } scale 1/2 }}

#declare Gloop=
    isosurface{
      function { x^2+y^3+z^2+F-1 }
      contained_by{ box { -2.1, 2.1 } }
      max_gradient 14
      accuracy 0.001
}

I notice that one of the isos has a strange line on its base. How would I
get rid of this? I already changed accuracy and max_gradient, and got rid of
many more errors, but the rendering takes too long on my p200.

b) Any idea how I could make the floor using one isosurface, rather than a
grid of many isosurfaces, as I have done here?

Thanks all,

Andy Cocker

---------------------------------------------------------------
www.mariner9.net

..... for my music and graphics.
---------------------------------------------------------------
'I spilled spot remover on my dog. He's gone now. '
'I went to a restaurant that serves "breakfast at any time."
So I ordered french toast during the Renaissance. '

 - Steven Wright.


Post a reply to this message


Attachments:
Download 'hhhh.jpg' (47 KB)

Preview of image 'hhhh.jpg'
hhhh.jpg


 

From: Mike Williams
Subject: Re: Iso floor grow (46Kbu)
Date: 10 Nov 2000 17:19:44
Message: <+cWYoAAcCHD6Ew+f@econym.demon.co.uk>
Wasn't it Andy Cocker who wrote:
>Hi,
>
>Just another experiment, posted because I have a couple of questions.
>
>a) The code for each isosurface is:
>#declare F = function { pigment { crackle form <1,0,0> color_map { [0.0 rgb
>0.0 ] [1.0 rgb 1 ] } scale 1/2 }}
>
>#declare Gloop=
>    isosurface{
>      function { x^2+y^3+z^2+F-1 }
>      contained_by{ box { -2.1, 2.1 } }
>      max_gradient 14
>      accuracy 0.001
>}
>
>I notice that one of the isos has a strange line on its base. How would I
>get rid of this? I already changed accuracy and max_gradient, and got rid of
>many more errors, but the rendering takes too long on my p200.

I don't know how to fix the line (I can't reproduce it) but I can speed
it up by a factor of more than 2. 

The trick is to notice that isosurfaces can render faster when the
contained_by surface is a reasonably close fit, and can render slowly if
the fit is loose. I guess that's partly because the code starts from the
point where the ray intersects the contained_by shape and then starts
hunting up and down the ray looking for the actual surface.

In this case, your Gloop shape doesn't fit at all neatly into a single
box or a single sphere, but we can cut it up into two pieces, each of
which fit reasonably neatly into smaller boxes.

There are a couple of side effects. Firstly we have to bump up the
accuracy, otherwise the join becomes visible (the slight speed penalty
caused by increasing the accuracy is insignificant compared to the time
saved). Secondly, the max_gradients of the pieces are lower than that of
the original isosurface, presumably the high gradient areas were in the
upper corners of the original contained_by box.

It may even happen that the significant increase in accuracy that you
can now use, in half the rendering time, might possibly get rid of the
strange line.

#declare F = function { pigment { crackle form <1,0,0> color_map { [0.0
rgb 0.0 ] [1.0 rgb 1 ] } scale 1/2 }}

#declare Gloop2=
  union {
    isosurface{
      function { x^2+y^3+z^2+F-1 }
      contained_by{ box { -1, 1 } }
      max_gradient 6
      accuracy 0.000001
    }
    isosurface{
      function { x^2+y^3+z^2+F-1 }
      contained_by{ box { -2.1, <2.1,-0.8,2.1> } }
      max_gradient 12
      accuracy 0.000001
    }
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Andy Cocker
Subject: Re: Iso floor grow (46Kbu)
Date: 10 Nov 2000 17:33:08
Message: <3a0c77a4@news.povray.org>
Wow Mike, what can I say? Thankyou so much.

All the best,

Andy Cocker


"Mike Williams" <mik### [at] nospamplease> wrote in message
news:+cWYoAAcCHD6Ew+f### [at] econymdemoncouk...
>
> I don't know how to fix the line (I can't reproduce it) but I can speed
> it up by a factor of more than 2.
>
> The trick is to notice that isosurfaces can render faster when the
> contained_by surface is a reasonably close fit, and can render slowly if
> the fit is loose. I guess that's partly because the code starts from the
> point where the ray intersects the contained_by shape and then starts
> hunting up and down the ray looking for the actual surface.
>
> In this case, your Gloop shape doesn't fit at all neatly into a single
> box or a single sphere, but we can cut it up into two pieces, each of
> which fit reasonably neatly into smaller boxes.
>
> There are a couple of side effects. Firstly we have to bump up the
> accuracy, otherwise the join becomes visible (the slight speed penalty
> caused by increasing the accuracy is insignificant compared to the time
> saved). Secondly, the max_gradients of the pieces are lower than that of
> the original isosurface, presumably the high gradient areas were in the
> upper corners of the original contained_by box.
>
> It may even happen that the significant increase in accuracy that you
> can now use, in half the rendering time, might possibly get rid of the
> strange line.
>
> #declare F = function { pigment { crackle form <1,0,0> color_map { [0.0
> rgb 0.0 ] [1.0 rgb 1 ] } scale 1/2 }}
>
> #declare Gloop2=
>   union {
>     isosurface{
>       function { x^2+y^3+z^2+F-1 }
>       contained_by{ box { -1, 1 } }
>       max_gradient 6
>       accuracy 0.000001
>     }
>     isosurface{
>       function { x^2+y^3+z^2+F-1 }
>       contained_by{ box { -2.1, <2.1,-0.8,2.1> } }
>       max_gradient 12
>       accuracy 0.000001
>     }
> }
>
> --
> Mike Williams
> Gentleman of Leisure

--
---------------------------------------------------------------
www.mariner9.net

..... for my music and graphics.
---------------------------------------------------------------
'I spilled spot remover on my dog. He's gone now. '
'I went to a restaurant that serves "breakfast at any time."
So I ordered french toast during the Renaissance. '

 - Steven Wright.


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Iso floor grow (46Kbu)
Date: 10 Nov 2000 22:54:39
Message: <3A0CC28E.18B9160A@online.no>
Andy Cocker wrote:
>...

Snip --- 8< ---

> b) Any idea how I could make the floor using one isosurface, rather than a
> grid of many isosurfaces, as I have done here?
>...

I hope the code below solves this problem.

Experiment with the Xnr and Znr values (integers) to see how these 
works. (Also see attached image.)

I think that it's possible to construct a "ReplikateFunction" that 
also can generate grids of isosurfaces with an even number of "parts" 
along each side.


Btw.: 
You have a nice scene with interesting functions and patterns !


Regards,

Tor Olav
-- 
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version unofficial MegaPov 0.5;

#include "colors.inc"

global_settings { ambient_light color White }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

$ CM = color_map { [ 0 rgb 0 ] [ 1 rgb 1 ] } 

$ CrackleFunction = 
function { pigment { crackle form <1, 0, 0> color_map { CM } } }

$ OtherFunction = function { x^2 + y^3 + z^2 }

$ Xspacing = 5;
$ Zspacing = 4;

$ ReplicateFunction =
function {
  OtherFunction(
    (x + if(x, 1, -1)*Xspacing/2) % Xspacing - if(x, 1, -1)*Xspacing/2,
     y,
    (z + if(z, 1, -1)*Zspacing/2) % Zspacing - if(z, 1, -1)*Zspacing/2
  )
}

$ Xnr = 3;
$ Znr = 2;

$ Gloop =
isosurface {
  function {
     ReplicateFunction(x, y, z)
    +CrackleFunction(x*2, y*2, z*2)
    -1
  }
  contained_by {
    box {
      -(<Xnr, 3.5, Znr> - <1, 0, 1>/2)*<Xspacing, 1, Zspacing>,
       (<Xnr, 1.0, Znr> - <1, 0, 1>/2)*<Xspacing, 1, Zspacing>
    }
  }
  max_gradient 6
  accuracy 1E-6
}

object {
  Gloop
  pigment { 
    gradient 6*y
    turbulence 0.5
    color_map {
      [ 0.0 color Blue + White ]
      [ 0.5 color Blue ]       
      [ 1.0 color Blue + White ]
    }
  }
  no_shadow
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

background { color White }

light_source { 100*<3, 2, -1> color White }

camera {
  location 5*< 1,  3, -5>
  look_at < 0, -2,  0>
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7


Post a reply to this message


Attachments:
Download 'cracklequest01.jpg' (26 KB)

Preview of image 'cracklequest01.jpg'
cracklequest01.jpg


 

From: Andy Cocker
Subject: Re: Iso floor grow (46Kbu)
Date: 10 Nov 2000 23:45:42
Message: <3a0ccef6@news.povray.org>
"Tor Olav Kristensen" <tor### [at] onlineno> wrote in message
news:3A0CC28E.18B9160A@online.no...
> Btw.:
> You have a nice scene with interesting functions and patterns !

Many thanks Tor.. Your information was very helpful.

I have also enjoyed seeing your various isosurface experiments.

All the best,

Andy Cocker
---------------------------------------------------------------
www.mariner9.net

..... for my music and graphics.
---------------------------------------------------------------
'I spilled spot remover on my dog. He's gone now. '
'I went to a restaurant that serves "breakfast at any time."
So I ordered french toast during the Renaissance. '

 - Steven Wright.


Post a reply to this message

From: David Fontaine
Subject: Re: Iso floor grow (46Kbu)
Date: 10 Nov 2000 23:51:32
Message: <3A0CCFFB.E1C5EEE6@faricy.net>
Wierd! Cool! Kinda grotesque.

Isosurfaces kick ass.

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Iso floor grow (46Kbu)
Date: 11 Nov 2000 22:57:09
Message: <3A0E149A.D34202CF@online.no>
Tor Olav Kristensen wrote:
>... 
> I think that it's possible to construct a "ReplikateFunction" that
> also can generate grids of isosurfaces with an even number of "parts"
> along each side.
>...

I think this is such a function:

$ ReplicateFunction =
function {
  OtherFunction(
    x % Xspacing - if(x, 1, -1)*Xspacing/2,
    y,
    z % Zspacing - if(z, 1, -1)*Zspacing/2
  )
}


And I think this cointaned_by statement can be 
used with your iso-surface when the above 
function is used:

  contained_by {
    box {
      -<Xnr, 3.5, Znr>*<Xspacing, 1, Zspacing>,
       <Xnr, 1.0, Znr>*<Xspacing, 1, Zspacing>
    }
  }


Best regards,

Tor Olav
-- 
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

From: Andy Cocker
Subject: Re: Iso floor grow (46Kbu)
Date: 11 Nov 2000 23:15:21
Message: <3a0e1959@news.povray.org>
Thanks again,

Andy Cocker
---------------------------------------------------------------
www.mariner9.net

..... for my music and graphics.
---------------------------------------------------------------
'I spilled spot remover on my dog. He's gone now. '
'I went to a restaurant that serves "breakfast at any time."
So I ordered french toast during the Renaissance. '

 - Steven Wright.


Post a reply to this message

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