POV-Ray : Newsgroups : povray.general : Lighting problem,please help Server Time
29 Jul 2024 22:32:18 EDT (-0400)
  Lighting problem,please help (Message 6 to 15 of 15)  
<<< Previous 5 Messages Goto Initial 10 Messages
From: Alain
Subject: Re: Lighting problem,please help
Date: 16 Nov 2010 14:01:32
Message: <4ce2d50c@news.povray.org>

> "Kenneth"<kdw### [at] earthlinknet>  wrote:
>> Sorry to ask naive, simpleton questions from the get-go, but I'm just trying to
>> get a handle on the problem.
>>
>> Which version of POV-Ray are you using?
>>
>> Are you using scattering media? Not emission media, hopefully. ;-)
>>
>> Are you sure the light is inside the sphere? (Believe me, I've had *that*
>> problem before, thinking the light is at one place when it's at another; I have
>> to resort to a looks_like sphere to locate it!)
>>
>> If you remove any/all CSG *and* give the sphere just a simple pigment, does the
>> problem still occur?
>
> I'm currently running beta 39 in Ubuntu.  I am using a simple scattering media,
> 40 intervals, scattering { 3, White*10^-obsceneNumber } samples 30, 50
>
> I did notice that pov crashes with an out of memory error if I use 400 intervals
>
> I am certain the light source is inside the sphere, though I have not tried
> removing the csg.
>
> This is not a new problem.  I've experienced similar difficulties in the past
> with light sources inside csg objects.
>
> A.D.B.
>
>
Only use a single interval: don't change intervals from it's default 
value of 1.
Change the samples value, and only that value.
That way, it's MUCH faster!

Is your sphere set as no_shadow?
Do you use a looks_like for your sphere? In that case, the sphere is 
automaticaly no_shadow.

Be sure that you use an union of your light and the containing object.



Alain


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Lighting problem,please help
Date: 16 Nov 2010 18:30:58
Message: <4ce31432$1@news.povray.org>
Anthony D. Baye wrote:

> Is this a bug, or am I missing something?

It would be helpful if you could post a small sample scene.


Post a reply to this message

From: Anthony D  Baye
Subject: Re: Lighting problem,please help
Date: 17 Nov 2010 05:35:00
Message: <web.4ce3afb36e7a50e8507e8a090@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> Anthony D. Baye wrote:
>
> > Is this a bug, or am I missing something?
>
> It would be helpful if you could post a small sample scene.

basically:

#include "metals.inc"

light_source { 0.0 rgb 1 }

media {
    intervals 40
    scattering { 3, White*0.00001 }
    samples 30, 50
    }

difference {
    sphere { 0.0, 12.0 }
    sphere { 0.0, 11.625 texture { T_Chrome_5E } }
        texture { T_Chrome_3B }
    }

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

A.D.B.


Post a reply to this message

From: Kenneth
Subject: Re: Lighting problem,please help
Date: 17 Nov 2010 10:55:01
Message: <web.4ce3f6ba6e7a50e8196b08580@news.povray.org>
"Anthony D. Baye" <Sha### [at] spamnomorehotmailcom> wrote:
> Christian Froeschlin <chr### [at] chrfrde> wrote:
> > Anthony D. Baye wrote:
> >
> > > Is this a bug, or am I missing something?
> >
> > It would be helpful if you could post a small sample scene.
>
> basically:
> [......]
> that's the gist of it.  The universal media whites out, even though the light is
> inside the sphere.

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...

BTW, as has been noted, it's *much* faster to run the media with intervals 1,
samples 50 (for example)--actually 27-times faster than your intervals 40
samples 30,50! Another note: It seems that atmospheric media needs a rather high
samples count to look decent (plus, perhaps, some small amount of jitter as
well, to break up the visual banding.)

Also: Part of the documentation in section 3.3.2.1 "Atmospheric Media" seems to
be out of date (the part that says, "Pov-Ray cannot sample media along an
infinitely-long ray"); such media *does* show up even when there's no background
object whatsoever.

Ken


Post a reply to this message

From: Alain
Subject: Re: Lighting problem,please help
Date: 17 Nov 2010 12:48:58
Message: <4ce4158a$1@news.povray.org>

> Christian Froeschlin<chr### [at] chrfrde>  wrote:
>> Anthony D. Baye wrote:
>>
>>> Is this a bug, or am I missing something?
>>
>> It would be helpful if you could post a small sample scene.
>
> basically:
>
> #include "metals.inc"
>
> light_source { 0.0 rgb 1 }
>
> media {
>      intervals 40
>      scattering { 3, White*0.00001 }
>      samples 30, 50
>      }
>
> difference {
>      sphere { 0.0, 12.0 }
>      sphere { 0.0, 11.625 texture { T_Chrome_5E } }
>          texture { T_Chrome_3B }
>      }
>
> that's the gist of it.  The universal media whites out, even though the light is
> inside the sphere.
>
> A.D.B.
>
>

You need to change your media as follow:
media {
     intervals 1 // Default value, this line can be removed.
     scattering { 3, White*0.00001 }
     samples 120 // Only the first value is ever used.
// any second samples value is always ignored.
     }

This gives you the same number of samples but renders MUCH faster.



Alain


Post a reply to this message

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 5 Messages Goto Initial 10 Messages

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