POV-Ray : Newsgroups : povray.general : Lighting problem,please help : Re: Lighting problem,please help Server Time
30 Jul 2024 00:24:55 EDT (-0400)
  Re: Lighting problem,please help  
From: Alain
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

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