POV-Ray : Newsgroups : povray.newusers : Lighting different when using equivalent isosurface : Re: Lighting different when using equivalent isosurface Server Time
28 Jul 2024 12:24:24 EDT (-0400)
  Re: Lighting different when using equivalent isosurface  
From: Mike Williams
Date: 20 Mar 2009 23:45:34
Message: <IP2ElBBbLGxJFwW3@econym.demon.co.uk>
Wasn't it Timwi who wrote:
>
>Hi,
>
>I think I may have found a significant bug in POV-Ray, but if it's not 
>a bug then please explain to me why, and how I can work around the 
>problem.
>
>Consider the following source:
>
>------------------------------------------------------------------------
>#include "colors.inc"
>
>camera { location <2, 2, -5> look_at <0, 0.5, 0> }
>light_source { <0, 3, 0> color rgb <0.7, 0.7, 0.7> }
>
>#declare use_iso = 0;
>
>difference {
>    box { <-2.5, -1.1, -2.5>,
>          < 2.5, 0,     2.5>
>    }
>
>    #if(use_iso)
>        // this isosurface _should_ be equivalent to the cylinder below
>        isosurface {
>            function { pow (x, 2) + pow (z, 2) - 4 }
>            max_gradient 5.310
>            accuracy .0001
>            contained_by {
>                box { <-2.01, -1,  -2.01>,
>                      < 2.01, .01,  2.01> }
>            }
>        }
>    #else
>        cylinder { <0, -1, 0>, <0, .01, 0>, 2 }
>    #end
>
>    pigment { Green }
>}
>------------------------------------------------------------------------
>
>Try rendering this with use_iso set to 0 and then with it set to 1. I 
>would have thought the two should produce pretty much the same result, 
>since the isosurface is equivalent to the cylinder.
>
>But the result I get is this: with the cylinder everything works as 
>expected, but with the isosurface, the inside of the object is 
>completely black, even though there is a light source right next to it.
>
>Is this a bug, or am I doing something wrong? If so, what?
>
>Thanks
>Timwi

There's two things going on. One of them is you doing something wrong 
and one could possibly be a bug.

When you perform CSG with an isosurface you must either set max_trace 
appropriately or use all_intersections.

That still leaves the bottom of the hole darker when you use the 
isosurface.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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