POV-Ray : Newsgroups : povray.general : lighting problem? Server Time
31 Oct 2024 06:03:30 EDT (-0400)
  lighting problem? (Message 1 to 5 of 5)  
From: dragonmage
Subject: lighting problem?
Date: 22 Jan 2006 00:30:01
Message: <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?


Post a reply to this message

From: Trevor G Quayle
Subject: Re: lighting problem?
Date: 22 Jan 2006 01:20:34
Message: <43d32432$1@news.povray.org>
"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.

-tgq


Post a reply to this message

From: dragonmage
Subject: Re: lighting problem?
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

From: Trevor G Quayle
Subject: Re: lighting problem?
Date: 23 Jan 2006 21:29:32
Message: <43d5910c$1@news.povray.org>
the problem is in one of your spheres:

//start
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
}

//end

You are misusing translate and scale here, or at least its not operating as 
you expect it to.  When you scale something, it gets scaled based at the 
origin, so translating *then* scaling does not equal scaling *then* 
translating.  In the original, the sphere was placed at <0,0,0> with a 
radius of 1, then scaled 1000x.  Since it was centered at the origin, the 
result is that the sphere remains centered around the origin but now has a 
radius of 1000.   In your example here, you made a 1 radius sphere at the 
origin and translated it <10,10,10> giving you a sphere with its center at 
<10,10,10>. Then you scaled it 1000, which scaled the sphere larger, but 
because scale centers on the origin, the <10,10,10> translation gets scaled 
to a <10,10,10>*1000 translation giving you a 1000 radius sphere at 
<10000,10000,10000> and therefore reflects in your other objects 
differently.  To get the correct results, move the translation after the 
scale:

//start
sphere {
  0, 1
  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
  translate <10, 10, 10>
  hollow on
}

//end

Hope this helps you figure out what's going on.

-tgq


Post a reply to this message

From: dragonmage
Subject: Re: lighting problem?
Date: 24 Jan 2006 22:35:00
Message: <web.43d6f0dc8752e2db5820684d0@news.povray.org>
Thanks Trevor,
yes that sphere definition was the problem, it works fine now!
I had a moment's thought about the ordering of the scale/translate but then
passed it up and forgot about it.

cheers,

chris


Post a reply to this message

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