POV-Ray : Newsgroups : povray.general : Lighting problem,please help Server Time
29 Jul 2024 22:21:00 EDT (-0400)
  Lighting problem,please help (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Christian Froeschlin
Subject: Re: Lighting problem,please help
Date: 17 Nov 2010 18:22:55
Message: <4ce463cf@news.povray.org>
Anthony D. Baye wrote:

> that's the gist of it.  The universal media whites out, even though the light is
> inside the sphere.

it's black for me with 3.7 beta 39, on Windows 7 x64.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Lighting problem,please help
Date: 18 Nov 2010 02:59:53
Message: <4ce4dcf9$1@news.povray.org>
I would add to the comments that instead of atmospheric media, it is also 
better/faster to enclose the media into a hollow sphere.

Thomas


Post a reply to this message

From: Kenneth
Subject: Re: Lighting problem,please help
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

From: Alain
Subject: Re: Lighting problem,please help
Date: 18 Nov 2010 21:41:51
Message: <4ce5e3ef@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
>

Puting the pshere and the light in an union should not change anything 
exept make it easier to move both at the same time.

The background object(s) use is to prevent infinite rays. Whenever you 
have an infinite ray, the media computation becomes undefined and seems 
to return white.
In the original case, with a metal texture that have some reflection, 
any reflection, the reflection is overwhelmingly white, even without 
light in the direction of the ray. At least, that's what I get using 3.7.
Removing the reflection let the colour of the sphere show.
Also, you need something to limit your media upward. A large hollow 
sphere can do the trick.

Using a difference instead of clipped_by allows you to have an actual 
thickness to the sphere. It don't affect the end result of the 
light-media interaction.
I replaced you clipped sphere with this CSG:
difference{
	sphere{0,1}
	sphere{0,0.92}
	box{0,1 translate -0.5 scale 0.35 translate 1*x}
	sphere{0,1 scale 0.3 translate -1*z}
	texture{pigment{gradient y sine_wave frequency 10}finish{ambient .1 
diffuse .9 }}
	rotate 20*y
	translate 1*y
	}

When using clipped_by, you remove everything that is outside the 
clipping object. In this case, that means the whole sphere as the first 
operation leaves only the surface of the sphere inside the box, then you 
remove that with the small sphere...


Alain


Post a reply to this message

From: Kenneth
Subject: Re: Lighting problem,please help
Date: 18 Nov 2010 23:05:01
Message: <web.4ce5f6916e7a50e8196b08580@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:

> When using clipped_by, you remove everything that is outside the
> clipping object. In this case, that means the whole sphere as the first
> operation leaves only the surface of the sphere inside the box, then you
> remove that with the small sphere...
>

Ah yes, you're right. (That's why my clipped_by scene--*without* using
inverse--showed all-white media; all of the sphere had been removed!)

BTW, the 'special exception' I mentioned--of atmospheric media showing up even
with NO background or scene objects--was simply this:

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

light_source {
  0*x
  color rgb 1
  translate <0,1,0>
}

// atmospheric media
media{
 scattering {1,rgb .0000001*<.7,1,.7> extinction .1}
 method 3
 intervals 1
 samples 300
 jitter .05
 }

Surprisingly, this successfully produces green media. Of course, rendering such
an idiotic scene serves no useful purpose. ;-) But it does show that there
actually *is* light-interacting media present, even with no objects in the scene
at all (other than the light); nothing *but* 'infinite rays.'

Ken


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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