POV-Ray : Newsgroups : povray.general : Lighting problem,please help : Re: Lighting problem,please help Server Time
30 Jul 2024 00:28:16 EDT (-0400)
  Re: Lighting problem,please help  
From: Kenneth
Date: 18 Nov 2010 18:45:00
Message: <web.4ce5ba146e7a50e8196b08580@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:

> Running your code example in v3.6.1c, I wasn't able to reproduce the
> problem--the scene is dark (as would be expected with the light being inside the
> closed sphere.)
>
> However, I constructed a somewhat similar CSG test scene of my own--and I'm
> running into some decidedly odd behavior (different from your problem, though
> they might be related.) Will post more about it ASAP, as soon as I can make
> sense of it...

I finally found a workaround to your problem--although it doesn't use a CSG
sphere, unfortunately. (I'm still trying to understand the weird problems I'm
seeing there.) I found success using a sphere with clipped_by objects to make
the holes. Basically like this:

sphere{0,1
 pigment{rgb 1}
 clipped_by{box{0,1 inverse translate -.5 scale .35 translate <1,0,0>}}
 clipped_by{sphere{0,1 inverse scale .3 translate <0,0,-1>}}
 rotate 20*y
 translate 1*y
 }

The INVERSE keywords are important--otherwise, the lighted media shows up all
over the scene (as you mentioned with your example--which makes me think that
your problem with a CSG sphere may have something to do with 'inverse.' Just a
guess at this stage.)

Here's a simple but complete test scene, which runs OK in v3.6.1. I posted an
image over at p.b.i. Try running it in beta 39 to see if you get the same
results I did. NOTE that the sphere and its inner light are not 'coupled
together' in a union, but are independent. (I don't know if that makes any
difference, though.) Also: I added some background objects for the media to show
up against--yes, they *are* necessary here, I was mistaken about that.
(Although, there's a special situation where they are NOT necessary, and I'm
still trying to understand why; but that's unimportant for now.)

Ken

----- test scene -----
//global_settings{assumed_gamma 2.2}

camera {
  perspective
  location  <3, 3, -5>
  look_at   <.1, .8,  0>
  right     x*image_width/image_height
  angle 67
       }

// two test lights--outside of sphere, just to give scene some visibility.
light_source {
  0*x
  color rgb <1,1,1>*.04
  translate <-20, 40, -20>
}

light_source {
  0*x
  color rgb <1,1,1>*.04
  translate <20, 40, -20>
}

// point_light INSIDE sphere, centered in it.
light_source {
  0*x
  color rgb 1*<1,.5,.5>
  translate <0,1,0>
             }

// background objects, for media to show up against
plane{y,0 pigment{checker scale 1}}

box{0,1 translate <-.5,0,0> scale <1000,1000,.01>
texture{
 pigment{bozo scale 2}
 finish{ambient .1 diffuse .4}
 }
 translate <0,-1,50>
 }

// the sphere with the holes
sphere{0,1
 texture{
  pigment{gradient y sine_wave frequency 10}
  finish{ambient .1 diffuse .9}
  }
 clipped_by{box{0,1 inverse translate -.5 scale .35 translate <1,0,0>}}
 clipped_by{sphere{0,1 inverse scale .3 translate <0,0,-1>}}
 rotate 20*y
 translate 1*y
 }

// the atmospheric media
media{
 scattering {1,rgb 1.0*<.7,1,.7> extinction .1}
 method 3
 intervals 1
 samples 300
 jitter .05 // Optional. BTW, this can go past 1.0
 }


Post a reply to this message

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