POV-Ray : Newsgroups : povray.general : Lights and photons glitches (possibly bug) Server Time
5 Aug 2024 18:25:50 EDT (-0400)
  Lights and photons glitches (possibly bug) (Message 11 to 14 of 14)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Alan Kong
Subject: Re: Lights and photons glitches (possibly bug)
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

From: Bob Sorenson
Subject: Re: Lights and photons glitches (possibly bug)
Date: 17 Sep 2002 20:25:05
Message: <web.3d87c6bd1466a06cce18890f0@news.povray.org>
Alan Kong wrote:
>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.
>
>  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).
>
Thank you. The comments are a bit ugly, but the code is correct. If
anyone wants the original file I will be glad to send it to them.
Please ask for either .zip (2751 bytes) or uncompressed (6921 bytes).


Post a reply to this message

From: Rohan Bernett
Subject: Re: Lights and photons glitches (possibly bug)
Date: 1 Oct 2002 00:15:19
Message: <web.3d9920fa1466a06cc571aa6c0@news.povray.org>
Here is the source code for the first scene (the one with the two lasers).

Rohan _e_ii


global_settings {
  max_trace_level 10
  photons {
    count 20000
    autostop 0
    //media on
    jitter 0.4
    }

  }

// looking towards lasers
/*camera{
  location <-15,16,0>
  look_at <11,2,0>
  }*/

// looking in direction lasers point
/*camera{
  location <16,16,0>
  look_at <-1,2,0>
  }*/

// looking over at wall, laser2 visible
camera{
  location <11,16,-11>
  look_at <1,2,11>
  }

// looking over at wall, laser1 visible
/*camera{
  location <11,16,11>
  look_at <1,2,-11>
  }*/

light_source{<-20,30,40> rgb<1,1,1> media_interaction off photons{reflection
off refraction off}}

#declare glassblock =
box{<2,4,2> <-2,0,-2>
  pigment{rgbt<1,1,1,0.8>}
  finish{
    reflection 0.2
    }
  interior{ior 1.5}
  photons {
     target
     refraction on
     reflection on
     //collect off
     }
  }

#declare mirrorblock =
box{<0.25,4,2> <-0.25,0,-2>
  pigment{rgb<0,0,0>}
  finish{
    reflection 1.0
    ambient 0
    diffuse 0
    }
  photons {
    target
    reflection on
    collect off
    }
  }

// laser 1
light_source{
  <12,2,-7>, colour rgb<00,100,00>
  cylinder
  radius 1
  falloff 1.1
  tightness 1
  parallel
  point_at <-10,2,-7>
  media_interaction on

  }

// laser 2
light_source{
  <12,2,7>, colour rgb<00,00,100>
  cylinder
  radius 1
  falloff 1.1
  tightness 1
  parallel
  point_at <-10,2,7>
  media_interaction on
  }

#declare lasercase =
  difference{
    box{<2,2,4> <-2,-2,-4>
      pigment{rgb<0.4,0.5,1>}
      }
    cylinder{<0,0,-2> <0,0,4.1> 1
      pigment{rgb<0.2,0.2,0.2>}
      }
    }



object{mirrorblock scale<8,1,1> rotate<0,45,0> translate<1,0,0>}
//object{glassblock rotate<0,45,0> translate<1,0,0>}
object{mirrorblock rotate<0,-45,0> translate<0,0,-7>}
// mirror opposite laser 2
//object{mirrorblock rotate<0,45,0> translate<0,0,7>}

object{lasercase  rotate<0,-90,0> translate<12,2,-7>}
object{lasercase  rotate<0,-90,0> translate<12,2,7>}

box{<2,6,10> <-2,0,-10> pigment{rgb<0.5,0.5,0.5>} rotate<0,0,0>
translate<-8,0,0>}

box{<50,50,50> <-50,-0.0001,-50>
  pigment{checker rgb<0.3,0.3,0.3>, rgb<0.1,0.1,0.1> scale 2}
  hollow
  interior{
    media{
      scattering{
        2
        colour rgb<0.01,0.01,0.01>
        }
      }
    }
  }


Post a reply to this message

From: Rohan Bernett
Subject: Re: Lights and photons glitches (possibly bug)
Date: 1 Oct 2002 00:20:12
Message: <web.3d9921d31466a06cc571aa6c0@news.povray.org>
Here is the source code for my second scene (the hologram setup)

Rohan _e_ii



global_settings {
  max_trace_level 10
  photons {
    count 20000
    autostop 0
    media 100
    jitter 0
    }

  }


camera{
  //location <0,25,30>
  //look_at <0,0,0>
  location <0,30,45>
  look_at <0,0,-20>
  //look_at <-26,6,0>
  //location <6,6,-0>
  //look_at <0,6,0>
  }

light_source{<20,30,-40> rgb<1,1,1> media_interaction off photons{reflection
off refraction off}}

// laser
light_source{
  <-26,6,0>, colour rgb<00,100,00>
  cylinder
  radius 1
  falloff 1.1
  tightness 1
  parallel
  point_at <-10,6,0>
  media_interaction on

  }

#declare lasercase =
  difference{
    box{<2,2,4> <-2,-2,-4>
      pigment{rgb<0.4,0.5,1>}
      }
    cylinder{<0,0,-2> <0,0,4.1> 1
      pigment{rgb<0.2,0.2,0.2>}
      }
    }

#declare lasercasesupport=
  box{<2,2,1> <-2,-2,-1>
    pigment{rgb<0.4,0.5,1>}
    }

#declare opticsframe =
  difference{
    box{<2,4,0.5> <-2,-4,-0.5>}
    cylinder{<0,2,0.6> <0,2,-0.6> 1.7}
    //box{<1.9,3.9,0.4> <-1.9,-0.1,-0.4>}
    }


#declare mirror =
  union{
    object{opticsframe}
    cylinder{<0,2,0.4> <0,2,-0.4> 1.6999
      pigment{rgb<0,0,0>}
      finish{
        ambient 0
        diffuse 0
        reflection 1.0
        }
      photons{
        target
        reflection on
        refraction off
        collect off
        }
      }
    }

#declare beamsplitter =
  union{
    object{opticsframe}
    cylinder{<0,2,0.4> <0,2,-0.4> 1.6999
      pigment{rgbt<0,0,0,1>}
      finish{
        ambient 0
        diffuse 0
        reflection 0.5
        }
      interior{ior 1.5}
      photons{
        target
        reflection on
        refraction on
        collect off
        }
      }
    }

#declare spreadlens1 =
  union{
    object{opticsframe}
    intersection{
      cylinder{<0,2,1> <0,2,-1> 1.71
        }// end cylinder  */
      quadric{<1,  1,  0>,
         <0,  0,  0>,
         <0,  0, -1>, 0
        inverse
        scale <3,3,1.1>
        translate<0,2,0.2>
        }
      quadric{<1,  1,  0>,
         <0,  0,  0>,
         <0,  0, -1>, 0
        inverse
        rotate<0,180,0>
        scale <3,3,1.1>
        translate<0,2,-0.2>
        }
    pigment{rgbt<1,1,1,1>}
    finish{
      ambient 0
      diffuse 0
      }
    interior{ior 1.5}
    photons{
      target
      reflection off
      refraction on
      collect off
      }

    }

  }

#declare spreadlens2 =
  union{
    object{opticsframe}
    difference{
      cylinder{<0,2,1> <0,2,-1> 1.71
        }// end cylinder
      sphere{<0,2,8.2>  8}
      sphere{<0,2,-8.2>  8}
    pigment{rgbt<1,1,1,1>}
    finish{
      ambient 0
      //diffuse 0
      }
    interior{ior 1.5}
    photons{
      target
      reflection off
      refraction on
      collect off
      }
    }

  }

#declare testblock =
  box{<8,9,1> <-8,-2,-1>
    pigment{rgb<1,1,1>}
  }

object{lasercase rotate<0,90,0> translate<-26,6,0>}
object{lasercasesupport rotate<0,90,0> translate<-28.5,2,0>}
object{lasercasesupport rotate<0,90,0> translate<-23.5,2,0>}

object{beamsplitter rotate<0,45,0> translate<0,4,0> pigment{rgb<1,0,0>}}
//object{mirror rotate<0,45,0> translate<0,4,0> pigment{rgb<1,0,0>}}
object{mirror rotate<0,-45,0> translate<0,4,-10> pigment{rgb<1,0,0>}}
object{mirror rotate<0,-45,0> translate<-30,4,-10> pigment{rgb<1,0,0>}}
object{mirror rotate<0,45,0> translate<-30,4,-40> pigment{rgb<1,0,0>}}
object{mirror rotate<0,-45,0> translate<30,4,-40> pigment{rgb<1,0,0>}}
object{mirror rotate<0,45,0> translate<30,4,0> pigment{rgb<1,0,0>}}

object{spreadlens1 rotate <0,90,0> translate <-20,4,-40>
pigment{rgb<1,0,0>}}
object{spreadlens2 rotate <0,90,0> translate <20,4,-40> pigment{rgb<1,0,0>}}

object{testblock rotate<0,-45,0> translate<-6.5,2,-41>}
object{testblock rotate<0,45,0> translate<6.5,2,-41>}

box{<50,50,50> <-50,0.0001,-50>
  hollow
  pigment{checker rgb<0.1,0.1,0.1> rgb<0.9,0.9,0.9>}
  interior{
    media{
      method 3
      scattering{2, 0.01}
      }
    }
  }


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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