POV-Ray : Newsgroups : povray.general : Lights and photons glitches (possibly bug) : Re: Lights and photons glitches (possibly bug) Server Time
5 Aug 2024 20:19:31 EDT (-0400)
  Re: Lights and photons glitches (possibly bug)  
From: Alan Kong
Date: 16 Sep 2002 21:38:57
Message: <t01doug1s5vbt35uhoqrhr60caqsdvitf0@4ax.com>
On Mon, 16 Sep 2002 19:42:24 EDT Bob Sorenson wrote:

>At the request of someone who appeared to be a moderator of the
>povray.windows newsgroup, I canceled the posting.

  Bob, Thorsten is a member of the POV-Team. He is correct in that we
ask that non-platform-specific bug reports and discussion be posted in
p.general, and that example scene files be included in the body of the
message as plain text, rather than as an attachment.

  In this case, I think povray.general is an appropriate group for this
scene as we hope that folks who use other platforms can verify whether
your observations can be duplicated on other Windows machines, as well
as Mac, Linux, etc.

  I've taken the liberty of re-posting your scene below. I hope it shows
up okay in everyone's newsreaders, as it had longer lines than I
normally use (I shortened Bob's lines).

-- 
Alan
ako### [at] povrayorg
a k o n g <at> p o v r a y <dot> o r g


/*
** LightBug.pov - Demonstrates a possible bug with POV-Ray 3.5 and
cylinder lights.
**
** Dear Developers:
**
** I was eager to try the latest version of POV-Ray when I discovered
all the new features that were added. I have been using it off and on
ever since version 2.2 and love it. I use it often to render scenes for
projects at work and at home.
** It is an excellent package! I laud its quality to many! Keep up the
good work!
**
** While experimenting with the new "photons" feature, I discovered and
explored an anomaly with using cylinder light sources. I wrote a very
simple scene to understand how a spotlight could be reflected off a
perfect mirror and tried to port that directly to a cylinder light
merely by changing the light type.
** The spotlight code worked exactly as expected, but when the type was
changed to a cylinder light, the direct beam landed where expected, but
the reflected light did not. It landed in the correct x- and z-location
but the y-location was incorrect. (Actually, there could be a problem
with all three axes.)
**
** Scene description:
** This scene consists of one pure white "screen," one perfect "mirror"
adjacent and perpendicular to that screen, two light sources and one
camera. The visible parts of the objects, the two light sources and the
camera are all coincident with the surfaces of a 20-unit cube centered
at the origin. The camera looks at the center of the screen and the
mirror is on the right. The direct beams' paraxial rays are contained in
the y-z plane and the reflected rays form a right triangle such that
their paraxial rays intersect the exact same point on the "screen" that
the direct paraxial ray would.
**
** Problem description:
** If both cylinder lights are pointed directly at the screen, they
intersect it exactly where they should. If the mirror is changed to a
pure white screen and both cylinder lights are pointed at their normal
reflection point, they appear exactly where they should. If this screen
is now changed back to a mirror, both beams will appear at the center of
the other screen as if the y-dimensions were not there. This does not
happen with spotlights. If I double the values of the "y" parameter in
the "point_at" definition, the images on the screen and their
reflections appear where they should be, and if I change the mirror to a
white screen, the spots appear at the top where they are actually
pointed. Note: you will have to change the camera angle to see this--I
used 120 degrees. It is also worthy to note that if the "y" parameter is
forced to be zero, then the two images reverse position AND are in the
expected locations. See the comments below for more details.
**
** System Information:
** This problem was discovered on a Compaq Presario computer running
Windows 2000 Professional with service pack 2 installed. It is an "x86
Family 6 Model 8  Stepping 3 GenuineIntel ~667 Mhz" processor and has
128 MB of RAM installed.
** The POV-Ray version I am using is: 3.5.id.win32 .
**
** I would be very interested to know if this is a real bug in POV-Ray
or if I am just doing something stupid. I think it's a bug. Please let
me know.
**
** Thank you,
** Bob Sorenson <zep### [at] nerccom>
**
** Note: As distributed, this source code will render a scene with both
spotlight sources reflecting off the mirror on the right and casting
rays on the screen directly in front of the camera. This yields the
expected results. Commenting out the declaration of SPOTLIGHT will cause
the two cylinder lights to intersect the screen at the center and mix to
become one yellow spot instead of the two distinct spots that should
appear where the two spotlight centers appeared.
*/

#include "colors.inc"

background { color Blue }

global_settings {
    ambient_light 0
    assumed_gamma 1.0
    max_trace_level 10
    photons {
        count 1000000
        autostop 0
        jitter .4
    }
}

camera {
    perspective
    location  <0, 0, -10>
    up <0, 3, 0>
    right <4, 0, 0>
    angle 90
    look_at <0, 0, 10>
}

/*
** If the following symbol is declared then the spotlight type is used.
If it is commented out then the cylinder light type is used.
*/
#local SPOTLIGHT = 1;

/*
** The following symbol is a multiplier for the "y" value in all of the
"point_at" declarations that follow. For a normal scene, its value
should be unity (one).
** Here is a list of what happens as it is changed using the cylinder
light source:
**   Factor  Result
**     2.0   The light spots appear in their correct locations.
**     1.0   Both lights appear at the center of the screen and mix to
create a yellow spot. The lights should be separated by ten units and
centered vertically and horizontally on the screen in their correct
locations.
**     0.0   The lights appear in the correct location but are reversed.
This is exactly what should happen.
**    -1.0   The top light appears at the bottom edge and bottom light
appears at the top edge. In this case, the reflection points on the
mirror are reversed and neither light should appear on the screen. They
should actually intersect that plane five units above or below it.
*/
#local POINT_AT_Y_FACTOR = 1.0;

light_source { // The top light source
    <0, 5, -10>
    #ifdef (SPOTLIGHT)
        color Red
        spotlight
    #else
        color 4 * Red
        cylinder
    #end
    radius 1
    falloff 10
    tightness 100
    #if (1)
        point_at <10, 5 * POINT_AT_Y_FACTOR, 0> // Point at the mirror
    #else
        point_at <0, 5 * POINT_AT_Y_FACTOR, 10> // Point at the screen
    #end
    photons {
        refraction off
        reflection on
    }
}

light_source { // The bottom light source
    <0, -5, -10>
    #ifdef (SPOTLIGHT)
        color Green
        spotlight
    #else
        color 4 * Green
        cylinder
    #end
    radius 1
    falloff 10
    tightness 100
    #if (1)
        point_at <10, -5 * POINT_AT_Y_FACTOR, 0> // Point at the mirror
    #else
        point_at <0, -5 * POINT_AT_Y_FACTOR, 10> // Point at the screen
    #end
    photons {
        refraction off
        reflection on
    }
}

box { // The screen the light is cast upon
    <-10, -10, 0>, <10, 10, 0.1>
    pigment { color White }
    translate <0, 0, 10>
}

box { // The perfect mirror that reflects all light
    <0, -10, -10>, <0.1, 10, 10>
    pigment { color White }
    // Comment the next line out to turn the mirror into a white screen.
    finish { reflection { 1.0 } ambient 0 diffuse 0 }
    translate <10, 0, 0>
    photons {
        target
        refraction off
        reflection on
        collect off
    }
}

/* EOF: LightBug.pov */


Post a reply to this message

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