POV-Ray : Newsgroups : povray.general : Problem with isosurface Server Time
4 Nov 2024 23:17:52 EST (-0500)
  Problem with isosurface (Message 1 to 9 of 9)  
From: SharkD
Subject: Problem with isosurface
Date: 8 Feb 2008 17:40:00
Message: <web.47acd95f26eb41a7ce83de880@news.povray.org>
In the following scene, the transparent sphere causes holes to appear in the
isosurface so that you can see all the way through it to the background behind
it. Why is this happening?

//BEGIN
#include "colors.inc"
#include "functions.inc"

global_settings {
  assumed_gamma 1.0
}

// ----------------------------------------

camera {
  location  <2.0, 2.0, 2.0>
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <30, 30, 30>
}

// ----------------------------------------

#declare My_iso_function = function
{
 pigment
 {
  granite
 }
}

#declare Height_Ratio = 0.005;
#declare Water_Ratio = 0.75;

isosurface
{
 function { f_sphere(x, y, z, 1) + My_iso_function(x, y, z).gray * Height_Ratio}
 contained_by
 {
  sphere {0, 1}
 }
 pigment
 {
  onion
  color_map
  {
           [0 rgb 0]
           [1 rgb 1]
  }
  scale Height_Ratio
 }
}

sphere
{
 0, 1 - Height_Ratio * (1 - Water_Ratio)
 pigment
 {
  color rgbt 1
 }
}
//END


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Problem with isosurface
Date: 8 Feb 2008 18:15:39
Message: <47ace29b@news.povray.org>

> In the following scene, the transparent sphere causes holes to appear in the
> isosurface so that you can see all the way through it to the background behind
> it. Why is this happening?

Look at the debug messages when the render is done. If it says something 
about "max_gradient reached", increase it.


Post a reply to this message

From: SharkD
Subject: Re: Problem with isosurface
Date: 8 Feb 2008 18:35:00
Message: <web.47ace68143fac46bce83de880@news.povray.org>
Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:

> > In the following scene, the transparent sphere causes holes to appear in the
> > isosurface so that you can see all the way through it to the background behind
> > it. Why is this happening?
>
> Look at the debug messages when the render is done. If it says something
> about "max_gradient reached", increase it.

There's no mention of "max_gradient" in the messages pane. Note also that the
isosurface renders fine when the transparent sphere is eliminated from the
scene.


Post a reply to this message

From: Alain
Subject: Re: Problem with isosurface
Date: 8 Feb 2008 20:00:42
Message: <47acfb3a$1@news.povray.org>
SharkD nous apporta ses lumieres en ce 2008/02/08 17:36:
> In the following scene, the transparent sphere causes holes to appear in the
> isosurface so that you can see all the way through it to the background behind
> it. Why is this happening?
> 
Same thing using the latest beta.
Adding "all_intersections" don't help.
All parts of the isosurface that are under the sphere surface are missing. You 
can see the parts of the far side trough the holes.
Replacing the sphere by a box, and I see circles near the intersection of the 
box and the isosurface.
Increasing the amplitude of the surface by a factor of 10, and the deep parts 
are there. There are cuts near the surface of the sphere.
Scaling everything by a factor of 10, beter, but slow. Still have cuts.

It looks like a floating point precision problem.
When you first hit the isosurface, it's ok, you stop looking any further.
When you first hit the transparent sphere, the isosurface is to close and the 
test just miss it.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when quotes about raytracing are making 
sence to you.


Post a reply to this message

From: SharkD
Subject: Re: Problem with isosurface
Date: 8 Feb 2008 21:40:01
Message: <web.47ad11f843fac46b4cdeac580@news.povray.org>
Some more problems related to isosurfaces--this time with pigments. In the
following scene, there is noticable banding of the pigment in the form of
concentric circles around the centerpoint of the image. This problem occurs
regardless of the camera location. If you move the camera, there are still
concentric circles centered around the middle of the image.

//BEGIN
// Persistence of Vision Ray Tracer Scene Description File
// File: ?.pov
// Vers: 3.6
// Desc: Basic Scene Example
// Date: mm/dd/yy
// Auth: ?
//


#version 3.6;

#include "colors.inc"
#include "functions.inc"

global_settings {
  assumed_gamma 1.0
}

// ----------------------------------------

camera {
  location  <2.0, 2.0, 2.0>
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
  rotate y * 45
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <30, 30, 30>
}

// ----------------------------------------

#declare Height_Ratio = 0.005;
#declare Water_Ratio = 0.75;

#local Pigment_Granite = pigment
{
 granite
 color_map
 {
  [0 rgbt 0]
  [1 rgbt 1]
 }
}

#declare My_iso_function = function
{
 pigment
 {
  pigment_pattern
  {
   crackle
  }
  pigment_map
  {
   [0 rgbt 0]
   [1 Pigment_Granite]
  }
  scale 1/2
 }
}

isosurface
{
 function { f_sphere(x, y, z, 1) + My_iso_function(x, y, z).transmit *
Height_Ratio}
 contained_by
 {
  sphere {0, 1}
 }
 pigment
 {
  onion
  color_map
  {
   [Water_Ratio * 000/100 rgb <000,000,050,>/255] //blue
   [Water_Ratio * 090/100 rgb <000,000,050,>/255] //blue
   [Water_Ratio * 099/100 rgb <034,180,180,>/255] //teal
   [Water_Ratio * 100/100 rgb <034,180,180,>/255] //teal
   [Water_Ratio + (1 - Water_Ratio) * 00/12 rgb <067,084,029,>/255] //green
   [Water_Ratio + (1 - Water_Ratio) * 08/12 rgb <067,084,029,>/255] //green
   [Water_Ratio + (1 - Water_Ratio) * 10/12 rgb <132,114,076,>/255] //tan
   [Water_Ratio + (1 - Water_Ratio) * 11/12 rgb <255,255,255,>/255] //white
   [Water_Ratio + (1 - Water_Ratio) * 12/12 rgb <255,255,255,>/255] //white
  }
  scale Height_Ratio
 }
}
//END


Post a reply to this message

From: Alain
Subject: Re: Problem with isosurface
Date: 9 Feb 2008 12:29:58
Message: <47ade316$1@news.povray.org>
SharkD nous apporta ses lumieres en ce 2008/02/08 21:37:
> Some more problems related to isosurfaces--this time with pigments. In the
> following scene, there is noticable banding of the pigment in the form of
> concentric circles around the centerpoint of the image. This problem occurs
> regardless of the camera location. If you move the camera, there are still
> concentric circles centered around the middle of the image.
> 
The banding was obvious in your original sample. Same problem: FP inacurancy.

The problem is that your radial variation is extremely small, at 0.005 unit.

You get much beter result after scaling everything up by 10.
f_sphere(x, y, z, 1) become f_sphere(x/10, y/10, z/10 ,1)
contained_by{sphere{0,1}} become contained_by{sphere{0,10}}
the scale Height_Ratio become scale Height_Ratio*10

This way, you get much less rounding errors and it preserve the intended apearance.

-- 
Alain
-------------------------------------------------
Important letters that contain no errors will develop errors in the mail.


Post a reply to this message

From: SharkD
Subject: Re: Problem with isosurface
Date: 9 Feb 2008 16:50:01
Message: <web.47ae1efe43fac46b8a2ce73f0@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> The banding was obvious in your original sample. Same problem: FP inacurancy.
>
> The problem is that your radial variation is extremely small, at 0.005 unit.
>
> You get much beter result after scaling everything up by 10.
> f_sphere(x, y, z, 1) become f_sphere(x/10, y/10, z/10 ,1)
> contained_by{sphere{0,1}} become contained_by{sphere{0,10}}
> the scale Height_Ratio become scale Height_Ratio*10
>
> This way, you get much less rounding errors and it preserve the intended apearance.
>
> --
> Alain
> -------------------------------------------------
> Important letters that contain no errors will develop errors in the mail.

I've scaled everything by 10 and get virtually identical results.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Problem with isosurface
Date: 10 Feb 2008 04:48:47
Message: <47aec87f$1@news.povray.org>
SharkD wrote:
 > I've scaled everything by 10 and get virtually identical results.

Hardly a surprise if you contain the isosurface in a sphere of radius R but 
define the surface to be R *plus* something, don't you? ;-)

	Thorsten


Post a reply to this message

From: SharkD
Subject: Re: Problem with isosurface
Date: 28 Feb 2008 19:05:01
Message: <web.47c74b0243fac46bd57dbd0@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
> SharkD wrote:
>  > I've scaled everything by 10 and get virtually identical results.
>
> Hardly a surprise if you contain the isosurface in a sphere of radius R but
> define the surface to be R *plus* something, don't you? ;-)
>
>  Thorsten

Adding the "something" actually causes the radius to be less than 1. Also, I
don't see how what you've suggested has any affect on banding.


Post a reply to this message

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