POV-Ray : Newsgroups : povray.general : lighting problem? : Re: lighting problem? Server Time
1 Aug 2024 08:18:35 EDT (-0400)
  Re: lighting problem?  
From: dragonmage
Date: 23 Jan 2006 18:30:01
Message: <web.43d565b88752e2dbe618711f0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> "dragonmage" <dra### [at] gmailcom> wrote in message
> news:web.43d3183c456346d5e618711f0@news.povray.org...
> > Hellow, I am new to povray and have a question on an apparent lighnting
> > problem.
> > I too the phot_met_glass example and added a translate <10, 10, 10> to all
> > objects inclusing light and camera.  This had an unexpected effect of
> > dramatically altering the bluish highlights in the rendered scene.  I then
> > created another file with the translations still in there but set to:
> > translate <0, 0, 0> and the bluish hightlights came back.  This leads me
> > to
> > believe there may be a default light source which I am not moving when I
> > add the translations.  Anyone know wha is going on?
> >
>
> Not sure exactly what you are saying here without further clarification or
> posting your scene, but it coul dpossibly be an 'ambient' problem.  Try
> explicitly declaring "ambient 0" in all your object textures to remove any
> ambient effect on them and see if that helps.
>
I don't know how/where to declare ambient 0 yet - need to read up on POVRay
more .  The scene is not large so I include the two examples below FYI.
THey only differ by where
the scene is positioned in the environment.

The first scene is as follows:
#version 3.5;

#include "colors.inc"
#include "glass.inc"

global_settings {
  assumed_gamma 1
  max_trace_level 25

  photons {
    spacing 0.03
    autostop 0
    jitter 0
  }
}

camera {
  location    <20, 5, 10>
  right       2*x
  look_at     <0,-1,0>
  angle       34
  translate <0, 0, 0>
}

light_source {
  <-3, 10, 18>
  color rgb <1.3, 1.2, 1.1>
  translate <0, 0, 0>

  photons {
    reflection on
    refraction on
  }
}

plane {
  y, -1
  translate <0, 0, 0>
  texture {
    pigment {
      color rgb 1.0
    }
  }
}

sphere {
  0, 1
  translate <0, 0, 0>

  texture {
    pigment {
      gradient y
      color_map {
        [0.0 color rgb 1.0 ]
        [0.3 color rgb <0.6, 0.65, 1.0> ]
      }
    }
    finish { ambient 1 diffuse 0 }
  }

  scale 1000
  hollow on
}

#declare Metal_Texture =
texture {
  pigment { color rgb <0.5, 0.5, 0.6> }
  finish {
    ambient 0.0
    diffuse 0.15
    specular 0.3
    roughness 0.01
    reflection {
      0.8
      metallic
    }
  }
}

#declare Box = box { -1, 1 }

#declare Metal_Obj_1 =
difference {
  object {
    Box
 }
  object {
    Box
    scale <0.8, 0.8, 1.5>
  }
  object {
    Box
    scale <0.8, 1.5, 0.8>
  }
  object {
    Box
    scale <1.5, 0.8, 0.8>
  }

  texture { Metal_Texture }

    rotate 12*y
  translate <0, 0, 0>
}

#declare Metal_Obj_2 =
difference {
  cylinder { -1.0*y, 0.0*y, 6.0
  translate <0, 0, 0>
    }
  cylinder { -2.0*y, 1.0*y, 5.8
  translate <0, 0, 0>
    }

  texture { Metal_Texture }
}

union {
  object { Metal_Obj_1 }
  object { Metal_Obj_2 }

  sphere {
    <0,0,0>, 1
  translate <0, 0, 0>

    material {
      texture {
        pigment { color Col_Glass_Clear }
        finish { F_Glass6 }
      }
      interior {
        I_Glass_Exp(2)
        fade_color Col_Red_03
      }
    }
  }

  photons {
    target
    reflection on
    refraction on
    collect off
  }
}

the same scene translated by (10,10,10) is:
#version 3.5;

#include "colors.inc"
#include "glass.inc"

global_settings {
  assumed_gamma 1
  max_trace_level 25

  photons {
    spacing 0.03
    autostop 0
    jitter 0
  }
}

camera {
  location    <20, 5, 10>
  right       2*x
  look_at     <0,-1,0>
  angle       34
  translate <10, 10, 10>
}

light_source {
  <-3, 10, 18>
  color rgb <1.3, 1.2, 1.1>
  translate <10, 10, 10>

  photons {
    reflection on
    refraction on
  }
}

plane {
  y, -1
  translate <10, 10, 10>
  texture {
    pigment {
      color rgb 1.0
    }
  }
}

sphere {
  0, 1
  translate <10, 10, 10>

  texture {
    pigment {
      gradient y
      color_map {
        [0.0 color rgb 1.0 ]
        [0.3 color rgb <0.6, 0.65, 1.0> ]
      }
    }
    finish { ambient 1 diffuse 0 }
  }

  scale 1000
  hollow on
}

#declare Metal_Texture =
texture {
  pigment { color rgb <0.5, 0.5, 0.6> }
  finish {
    ambient 0.0
    diffuse 0.15
    specular 0.3
    roughness 0.01
    reflection {
      0.8
      metallic
    }
  }
}

#declare Box = box { -1, 1 }

#declare Metal_Obj_1 =
difference {
  object {
    Box
 }
  object {
    Box
    scale <0.8, 0.8, 1.5>
  }
  object {
    Box
    scale <0.8, 1.5, 0.8>
  }
  object {
    Box
    scale <1.5, 0.8, 0.8>
  }

  texture { Metal_Texture }

    rotate 12*y
  translate <10, 10, 10>
}

#declare Metal_Obj_2 =
difference {
  cylinder { -1.0*y, 0.0*y, 6.0
  translate <10, 10, 10>
    }
  cylinder { -2.0*y, 1.0*y, 5.8
  translate <10, 10, 10>
    }

  texture { Metal_Texture }
}

union {
  object { Metal_Obj_1 }
  object { Metal_Obj_2 }

  sphere {
    <0,0,0>, 1
   translate <10, 10, 10>

    material {
      texture {
        pigment { color Col_Glass_Clear }
        finish { F_Glass6 }
      }
      interior {
        I_Glass_Exp(2)
        fade_color Col_Red_03
      }
    }
  }

  photons {
    target
    reflection on
    refraction on
    collect off
  }
}


> -tgq


Post a reply to this message

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