POV-Ray : Newsgroups : povray.general : odd behavior of photon reflection/refraction defaults : odd behavior of photon reflection/refraction defaults Server Time
15 Dec 2025 22:04:12 EST (-0500)
  odd behavior of photon reflection/refraction defaults  
From: Kenneth
Date: 8 Dec 2025 06:50:00
Message: <web.6936b923b59fb83fe83955656e066e29@news.povray.org>
[Running Windows 10. Tested in both 'official' v3.7.0 and 3.8 beta 1; the
results are the same]

Following up on some preliminary discussions here...
https://news.povray.org/povray.general/thread/%3C69366bae%241%40news.povray.org%3E/

The documentation at "3.4.4.4.3 Photon Global Settings" (for v3.7.0) and
"3.4.3.4.3 Photon Global Settings" (for 3.8) both say this about the default
values for 'reflection' and 'refraction', in objects and light_sources:

Object :
refraction    : off
reflection    : off

Light_source:
refraction    : off
reflection    : off

(As usual, 'default' means commenting-out a keyword, or leaving it out
altogether.)

I've been running a series of photon tests, and it seems that these defaults
actually change (or are overridden) in certain circumstances. Whether or not
this is by design, I don't know; but at the very least, the behavior can cause
unexpected results in a render.

I originally thought that a particular type of light_source was the cause, but
that proved to be false.

I have included a simple test scene below-- using only 'refraction' since it's
quicker to render-- but the same behavior applies to 'reflection'.

Here are some examples of the default 'refraction' behaviors, in the photon
blocks for both the object and the light_source. (This should really be in the
form of a 'truth table' rather than my clumsy descriptions):

1) With *defaults* for both light_source and object, there are NO refraction
effects. This agrees with the documentation: one default (or both?) are OFF.

2a) With default for the light_source and 'refraction on' for the object, there
ARE refraction effects. So in this case, the default OFF for the light_source is
apparently ON instead (or has been overridden.)

2b) With 'refraction off' for light_source and 'refraction on' for object, NO
refraction effects, as expected.

3a) With 'refraction off' for light_source and *default* for object, NO
refraction effects, as expected.

3b) With 'refraction on' for light_source and *default* for object, there ARE
refraction effects. So in this case, the default OFF for the object is
apparently ON instead (or has been overridden.)

From these results, it is apparent that the default behaviors are not
reliable and could cause unexpected rendering effects-- especially when there
are multiple objects and lights in a scene, each with its own photon block. (The
workaround would be to explicitly state ON or OFF for the various
parameters...and not rely on the defaults at all, unfortunately.)

-----------
[test scene]

#version 3.7; // or 3.8
global_settings {
   assumed_gamma 1
   photons {count 100000}
}

camera {
  perspective
  location  <-2, 0, -10>
  look_at   <1.5, 0,  0>
  right     x*image_width/image_height
  angle 55
}

background{rgb .05}

//--------------
light_source {
   <-3,0,0>
   color rgb <0, 1, 0>
   /*
   spotlight
   radius 6
   falloff 8
   tightness 10
   point_at <5,0,0>
   */
   photons {
   refraction on
   reflection off
           }
   looks_like{
    sphere{0,.1
    pigment{rgb 1}
    finish{ambient 1 emission 0 diffuse 0}
          }
             }
}

box { // translucent
   0,1 translate -.5
   scale <.3,6,4>
   pigment { rgbt <1,1,1,.7> }
   normal{bumps scale .3 bump_size 1}

   interior{ior 1.2}

   photons {
      target 1.0
      refraction on
      collect off
           }
}

//---------------
// additional box surface, to show refraction effects
box {
   0,1 translate -.5
   scale <.3,6,4>
   rotate -30*y
   translate 5*x
   pigment { rgb 1 }
   finish{ambient 0 emission 0 diffuse .95}
   photons{collect on} // (ON by default)
   }


Post a reply to this message

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