POV-Ray : Newsgroups : povray.general : Negative diffuse settings? Server Time
8 Aug 2024 16:15:27 EDT (-0400)
  Negative diffuse settings? (Message 1 to 4 of 4)  
From: Chris Jeppesen
Subject: Negative diffuse settings?
Date: 30 Nov 2000 16:40:30
Message: <3a26c94e$1@news.povray.org>
I am working on a planet earth model, and I found this cool map of the
cities at night (Thanks Jon Berndt! for the reference). I am using it as a
mostly transparent shell 0.000001 bigger than my earth image map sphere.

Now, the question. I of course want to only see the city lights on the unlit
side of earth. The easy unelegant way is to cut the sphere in half and make
sure that the city lights are applied only opposite the sun, but that
requires a knowledge of where the sun is, and more calculations than I care
to do.

Then I came up with a briliant (I thought) Idea: Set the ambient of the
shell to 0.5, then the diffuse to -0.5. My thinking is that a negative
diffuse setting means that the more light you hit it with, the darker it
gets. So a full light hitting normal to this shell should result in a total
effect of 0.5 Ambient+(-0.5 Diffuse)=0 light.

This kinda works, but not as well as I had hoped. It seems as though diffuse
is constrained to be >0. Does anyone know if this is true? Does anyone have
any better ideas?

Chris Jeppesen


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Negative diffuse settings?
Date: 30 Nov 2000 23:53:57
Message: <3a272ee5@news.povray.org>
> I am working on a planet earth model, and I found this cool map of the
> cities at night (Thanks Jon Berndt! for the reference). I am using it as a
> mostly transparent shell 0.000001 bigger than my earth image map sphere.
Why?  Can't you use layered textures?

> Now, the question. I of course want to only see the city lights on the
unlit
> side of earth. The easy unelegant way is to cut the sphere in half and
make
> sure that the city lights are applied only opposite the sun, but that
> requires a knowledge of where the sun is, and more calculations than I
care
> to do.
I did it using a slope-dependant texture, but of course you need the
position of the sun for this...

> Then I came up with a briliant (I thought) Idea: Set the ambient of the
> shell to 0.5, then the diffuse to -0.5. My thinking is that a negative
> diffuse setting means that the more light you hit it with, the darker it
> gets. So a full light hitting normal to this shell should result in a
total
> effect of 0.5 Ambient+(-0.5 Diffuse)=0 light.
I once did something similar...  A negative diffuse didn't work, I think,
but a very large negative highlight did!
I can't check it right now, but I think the following code gives more or
less the result you're after...
camera {
 location -z*5
 look_at 0
}
light_source {
 <500,500,-500>
 rgb 1//<0,0,1>
}
sphere {
 0,1
 texture {
  pigment {rgb <1,1,0>}
  finish {diffuse 0 ambient 1}// specular 1 roughness .01}
 }
 texture {
  pigment {rgbt <-2,-2,0,1>}
  finish {diffuse 1 specular 1 roughness 1 metallic}
 }
}




--
ZK
http://www.povplace.be.tf


Post a reply to this message

From: Mark Wagner
Subject: Re: Negative diffuse settings? (ATTN: POV-Team)
Date: 1 Dec 2000 01:02:54
Message: <3a273f0e@news.povray.org>
Chris Jeppesen wrote in message <3a26c94e$1@news.povray.org>...
>This kinda works, but not as well as I had hoped. It seems as though
diffuse
>is constrained to be >0. Does anyone know if this is true? Does anyone have
>any better ideas?


A quick perusal through the POV-Ray source code reveals that yes, diffuse is
currently constrained to being greater than 0.  For anyone who cares to, the
fix is to replace the line in function Diffuse() in lighting.c that reads :

      if (Finish->Diffuse > 0.0)

with

      if(Finish->Diffuse != 0.0)

This will get rid of the limitation.  Additionally, to get rid of the
related limits on phong, specular, and irid, replace the lines that read:
        if (Finish->Phong > 0.0)
        if (Finish->Specular > 0.0)
      if (Finish->Irid > 0.0)
with
        if (Finish->Phong != 0.0)
        if (Finish->Specular != 0.0)
      if (Finish->Irid != 0.0)
respectively.

There are probably other places where settings are unnecessarily constrained
to be greater than zero.

--
Mark

"The derivative of sin(2x) is cos(2x)"  - Matt Giwer


Post a reply to this message

From: Josh English
Subject: Re: Negative diffuse settings?
Date: 1 Dec 2000 17:19:37
Message: <3A2823FA.EF6D4372@spiritone.com>
I prefer more complicated, slower methods of doing this sort of thing. In fact I
wanted to try out that very thing you suggest. I would use a radial pigmentment
map that blends between the two. I'm sure it's inelegant and very slow, though.

Josh

Chris Jeppesen wrote:

> I am working on a planet earth model, and I found this cool map of the
> cities at night (Thanks Jon Berndt! for the reference). I am using it as a
> mostly transparent shell 0.000001 bigger than my earth image map sphere.
>
> Now, the question. I of course want to only see the city lights on the unlit
> side of earth. The easy unelegant way is to cut the sphere in half and make
> sure that the city lights are applied only opposite the sun, but that
> requires a knowledge of where the sun is, and more calculations than I care
> to do.
>
> Then I came up with a briliant (I thought) Idea: Set the ambient of the
> shell to 0.5, then the diffuse to -0.5. My thinking is that a negative
> diffuse setting means that the more light you hit it with, the darker it
> gets. So a full light hitting normal to this shell should result in a total
> effect of 0.5 Ambient+(-0.5 Diffuse)=0 light.
>
> This kinda works, but not as well as I had hoped. It seems as though diffuse
> is constrained to be >0. Does anyone know if this is true? Does anyone have
> any better ideas?
>
> Chris Jeppesen

--
Josh English -- Lexiphanic Lethomaniac
eng### [at] spiritonecom
The POV-Ray Cyclopedia http://www.spiritone.com/~english/cyclopedia/


Post a reply to this message

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