POV-Ray : Newsgroups : povray.advanced-users : max trace level for lighting Server Time
27 Dec 2024 22:24:26 EST (-0500)
  max trace level for lighting (Message 1 to 4 of 4)  
From: Nieminen Mika
Subject: max trace level for lighting
Date: 26 Jul 1999 04:06:06
Message: <379c16ee@news.povray.org>
Check this scene:

//-------------------------------------------------------------------------
global_settings { max_trace_level 3 }

camera { location <0,10,-10> look_at <2,1.5,0> angle 35 }
light_source { <100,100,0> 1 }

plane { y,-1 pigment { checker rgb 1, rgb .5 } rotate y*30 }

sphere { 0,1 pigment { rgbf <1,1,1,.9> } interior { ior 1.5 } }
sphere { <2,2,0>*.8,1 pigment { rgbf <1,1,0,.9> } interior { ior 1.5 } }
sphere { <4,4,0>*.8,1 pigment { rgbf <0,1,1,.9> } interior { ior 1.5 } }
sphere { <6,6,0>*.8,1 pigment { rgbf <1,1,1,.9> } interior { ior 1.5 } }
//-------------------------------------------------------------------------

  The shadow is green, as it should.
  Set the max_trace_level to 2. The shadow is still green (and the objects
are black, as they should).
  Set it to 1. The shadow is still green.

  How can this be possible? Povray has to pass through 8 surfaces (ie.
calculate 9 rays) from the floor to the light source to see what's the
color of the shadow. The max_trace_level doesn't seem to affect this.
  What's the max_trace_level for the lighting calculation? How can povray
calculate the shadow so fast (I can't notice any slowdown in the shadow area).
Or is the shadow ray calculated in another way I'm not aware of?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Nathan Kopp
Subject: Re: max trace level for lighting
Date: 26 Jul 1999 22:59:53
Message: <379D208E.2C46F4C6@Kopp.com>
max_trace_level does not affect the shadowing and filtering equations.
The reason is that whenever you trace a ray you (usually) get all of the
intersections, not just the closest one.  Of course, for the eye rays you
only use the closest intersection and ignore the others (unless you're
doing a CSG merge) and then shoot another ray if there is any refraction.

So the shadow ray only needs to get shot once and all intersections are
recorded and can be processed.

Also, increasing the max_trace_level for glass surfaces can cause
great speed decreases because the change is exponential.  Instead of
adding one more ray, you double the number of rays for each level of
depth (since you get both reflection and refraction rays).

Now, this makes me think that triangle meshes and isosurfaces might
not work properly when producing filtered shadows, since not all
intersections are returned (for speed reasons).

-Nathan

Nieminen Mika wrote:
> 
>   The shadow is green, as it should.
>   Set the max_trace_level to 2. The shadow is still green (and the objects
> are black, as they should).
>   Set it to 1. The shadow is still green.
> 
>   How can this be possible? Povray has to pass through 8 surfaces (ie.
> calculate 9 rays) from the floor to the light source to see what's the
> color of the shadow. The max_trace_level doesn't seem to affect this.
>   What's the max_trace_level for the lighting calculation? How can povray
> calculate the shadow so fast (I can't notice any slowdown in the shadow area).
> Or is the shadow ray calculated in another way I'm not aware of?
> 
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Nieminen Mika
Subject: Re: max trace level for lighting
Date: 27 Jul 1999 03:06:38
Message: <379d5a7e@news.povray.org>
Nathan Kopp <Nat### [at] koppcom> wrote:
: max_trace_level does not affect the shadowing and filtering equations.
: The reason is that whenever you trace a ray you (usually) get all of the
: intersections, not just the closest one.  Of course, for the eye rays you
: only use the closest intersection and ignore the others (unless you're
: doing a CSG merge) and then shoot another ray if there is any refraction.

: So the shadow ray only needs to get shot once and all intersections are
: recorded and can be processed.

  Now I undestand. Thanx. It's a pretty clever "trick" to calculate filtered
shadows fast.

  Btw, your comment about the CSG merge was extremely interesting.
  I have understood that for a union you need to shoot as many rays as inner
surfaces the ray intersects inside the union (supposing that it has a
semitransparent pigment). However with merge you only need to shoot one ray.
  Doesn't this mean that merge should be a lot faster than union? (And my
experiments about this confirm that merge is about 3 to 5 times faster in
these cases...)

  (Hmm... I wonder why I'm so fanatic about this merge speed thing... :) )

: Now, this makes me think that triangle meshes and isosurfaces might
: not work properly when producing filtered shadows, since not all
: intersections are returned (for speed reasons).

  That would be worth trying.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: max trace level for lighting
Date: 27 Jul 1999 11:01:23
Message: <379dc9c3@news.povray.org>
On Mon, 26 Jul 1999 22:59:26 -0400, Nathan Kopp wrote:
>Of course, for the eye rays you
>only use the closest intersection and ignore the others (unless you're
>doing a CSG merge) and then shoot another ray if there is any refraction.

Or intersection (including difference).


Post a reply to this message

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