POV-Ray : Newsgroups : povray.binaries.images : Another shadow line problem Server Time
20 Nov 2024 10:39:02 EST (-0500)
  Another shadow line problem (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: Warp
Subject: Another shadow line problem
Date: 17 Sep 2001 11:51:15
Message: <3ba61bf2@news.povray.org>
When testing my glow macro I found another shadow line problem caused by
the lighting model used in POV-Ray. This image illustrates the artifact:


Post a reply to this message


Attachments:
Download 'shadowline1.jpg' (10 KB) Download 'shadowline2.jpg' (10 KB)

Preview of image 'shadowline1.jpg'
shadowline1.jpg

Preview of image 'shadowline2.jpg'
shadowline2.jpg


 

From: JRG
Subject: Re: Another shadow line problem
Date: 17 Sep 2001 16:08:35
Message: <3ba65843@news.povray.org>
I got such odd results with specular highlights, but I always managed to fix
them using phong instead of specular. Dunno if it works here...

--
Jonathan

"Warp" <war### [at] tagpovrayorg> ha scritto nel messaggio
news:3ba61bf2@news.povray.org...
>   When testing my glow macro I found another shadow line problem caused by
> the lighting model used in POV-Ray. This image illustrates the artifact:
>
>


----------------------------------------------------------------------------
----


>
>   I know why this happens, but I'm not sure how well it simulates reality.
> It is *NOT* a bug in povray; the lighting model just works this way.
>
>   The normal vector of the surface points away from the light source at
the
> shadowed area and thus the light source has no effect in that part.
>   This works well for diffuse lighting. However, as can be seen from the
> image, it gives an odd result with specular lighting.
>   I don't know how a real-life sphere would be illuminated in this case.
> Would there be a sharp shadow line or not?
>
>   Note that making the light sources area light doesn't smooth the shadow
> line, and this is a true deficiency in povray. Povray performs area light
> calculations for shadow testing, but not for normal-is-away-from-light
tests.
>
>   Adding "no_shadow double_illuminate" to the sphere gives a result which
> at first glance looks good, but is not physically correct (and if we move
> the camera away we would see that the "dark side" of the sphere is
illumiated
> by the light sources, which is obviously wrong):
>
>


----------------------------------------------------------------------------
----


>
>   This is the source code:
>
> ----------8<----------8<----------8<----------8<----------8<----------
> #macro Glow(GlowColor, Scale)
>   sphere
>   { 0, 1 hollow no_shadow
>     pigment { rgbt 1 }
>     interior
>     { media
>       { emission 1/Scale
>         density
>         { spherical density_map
>           { [0 rgb 0][.5 rgb GlowColor*.5][1 rgb 1]
>           }
>         }
>         samples 1,1 intervals 1 confidence .1 // quite fast settings
>         method 3
>       }
>     }
>     scale Scale
>   }
> #end
>
> camera { location -z*10 look_at 0 angle 35 }
> sphere { -y*10,10 pigment { rgb 1 } finish { specular 1 } }
>
> light_source
> { <-1.5,1,0>, <1,.5,0>
>   looks_like { Glow(<1,.5,0>, .5) }
> }
> light_source
> { <2,.5,0>, <0,.5,1>
>   looks_like { Glow(<0,.5,1>, 1) }
> }
> ----------8<----------8<----------8<----------8<----------8<----------
>
> --
> #macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
> rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
> ],13),8)-3,10>#end blob{N(array[6]{11117333955,
> 7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Tek
Subject: Re: Another shadow line problem
Date: 17 Sep 2001 16:18:18
Message: <3ba65a8a@news.povray.org>
I believe this is caused by the fact that specular highlights are an
approximation to the real life effect. They don't exist in reality, so there's
no "right" way to do it. Phong gives a better approximation, but I'm pretty sure
I've had a similar (but less severe) effect with phong.

BTW, the real world effect is caused by imperfect reflections.

--
Tek
http://www.evilsuperbrain.com

Warp <war### [at] tagpovrayorg> wrote in message news:3ba61bf2@news.povray.org...
>   When testing my glow macro I found another shadow line problem caused by
> the lighting model used in POV-Ray. This image illustrates the artifact:
>
>


--------------------------------------------------------------------------------


>
>   I know why this happens, but I'm not sure how well it simulates reality.
> It is *NOT* a bug in povray; the lighting model just works this way.
>
>   The normal vector of the surface points away from the light source at the
> shadowed area and thus the light source has no effect in that part.
>   This works well for diffuse lighting. However, as can be seen from the
> image, it gives an odd result with specular lighting.
>   I don't know how a real-life sphere would be illuminated in this case.
> Would there be a sharp shadow line or not?
>
>   Note that making the light sources area light doesn't smooth the shadow
> line, and this is a true deficiency in povray. Povray performs area light
> calculations for shadow testing, but not for normal-is-away-from-light tests.
>
>   Adding "no_shadow double_illuminate" to the sphere gives a result which
> at first glance looks good, but is not physically correct (and if we move
> the camera away we would see that the "dark side" of the sphere is illumiated
> by the light sources, which is obviously wrong):
>
>


--------------------------------------------------------------------------------


>
>   This is the source code:
>
> ----------8<----------8<----------8<----------8<----------8<----------
> #macro Glow(GlowColor, Scale)
>   sphere
>   { 0, 1 hollow no_shadow
>     pigment { rgbt 1 }
>     interior
>     { media
>       { emission 1/Scale
>         density
>         { spherical density_map
>           { [0 rgb 0][.5 rgb GlowColor*.5][1 rgb 1]
>           }
>         }
>         samples 1,1 intervals 1 confidence .1 // quite fast settings
>         method 3
>       }
>     }
>     scale Scale
>   }
> #end
>
> camera { location -z*10 look_at 0 angle 35 }
> sphere { -y*10,10 pigment { rgb 1 } finish { specular 1 } }
>
> light_source
> { <-1.5,1,0>, <1,.5,0>
>   looks_like { Glow(<1,.5,0>, .5) }
> }
> light_source
> { <2,.5,0>, <0,.5,1>
>   looks_like { Glow(<0,.5,1>, 1) }
> }
> ----------8<----------8<----------8<----------8<----------8<----------
>
> --
> #macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
> rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
> ],13),8)-3,10>#end blob{N(array[6]{11117333955,
> 7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Steve
Subject: Re: Another shadow line problem
Date: 17 Sep 2001 16:59:42
Message: <slrn9qcp08.rlp.steve@zero-pps.localdomain>
On 17 Sep 2001 11:51:15 -0400, Warp wrote:
>  When testing my glow macro I found another shadow line problem caused by
>the lighting model used in POV-Ray. This image illustrates the artifact:

The binary seems to be messed up.  There are big blank spaces in it
that I can see in the UU encoding. 

--
Cheers
Steve              email mailto:ste### [at] zeroppsuklinuxnet

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.zeropps.uklinux.net/

or  http://start.at/zero-pps

  9:57pm  up 7 days, 11 min,  2 users,  load average: 1.00, 1.01, 1.00


Post a reply to this message

From: Rune
Subject: Re: Another shadow line problem
Date: 17 Sep 2001 17:23:07
Message: <3ba669bb@news.povray.org>
"Warp" wrote:
>   When testing my glow macro I found another shadow
> line problem caused by the lighting model used in POV-Ray.

Could you try to replace the light_sources with some spheres with high
ambient and make the surface with the highlights be reflective, and then
compare the results? Highlights should always be visible in the same places
as reflections. If they are not then it is indeed a bug.

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Tek
Subject: Re: Another shadow line problem
Date: 17 Sep 2001 17:48:44
Message: <3ba66fbc$1@news.povray.org>
You'd need blurred reflections to acheive the equivalent effect. But Rune's
right, you should try that.

--
Tek
http://www.evilsuperbrain.com

Rune <run### [at] mobilixnetdk> wrote in message
news:3ba669bb@news.povray.org...
> "Warp" wrote:
> >   When testing my glow macro I found another shadow
> > line problem caused by the lighting model used in POV-Ray.
>
> Could you try to replace the light_sources with some spheres with high
> ambient and make the surface with the highlights be reflective, and then
> compare the results? Highlights should always be visible in the same places
> as reflections. If they are not then it is indeed a bug.
>
> Rune
> --
> 3D images and anims, include files, tutorials and more:
> Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
> POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
> POV-Ray Webring: http://webring.povray.co.uk
>
>


Post a reply to this message

From: Nathan Kopp
Subject: Re: Another shadow line problem
Date: 17 Sep 2001 19:07:57
Message: <3ba6824d$1@news.povray.org>
"Tek" <tek### [at] evilsuperbraincom> wrote...
> I believe this is caused by the fact that specular highlights are an
> approximation to the real life effect. They don't exist in reality, so
there's
> no "right" way to do it.

This is correct.

-Nathan


Post a reply to this message

From: Nathan Kopp
Subject: Re: Another shadow line problem
Date: 17 Sep 2001 19:14:55
Message: <3ba683ef$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote...
>   When testing my glow macro I found another shadow line problem caused by
>   Note that making the light sources area light doesn't smooth the shadow
> line, and this is a true deficiency in povray. Povray performs area light
> calculations for shadow testing, but not for normal-is-away-from-light
tests.

From section 6.5.7.5 of the POV 3.5 docs:
"Rather than performing the complex calculations that would be required to
model a true area light, it is approximated as an array of point light
sources spread out over the area occupied by the light. The array-effect
applies to shadows only. The object's illumination is still that of a point
source."

Maybe somebody will code area-light highlights for POV 4 sometime in the
future.

-Nathan


Post a reply to this message

From: Warp
Subject: Re: Another shadow line problem
Date: 17 Sep 2001 20:23:41
Message: <3ba6940d@news.povray.org>
This is what I get if I apply finish { phong 1 } to the sphere:


Post a reply to this message


Attachments:
Download 'shadowline_phong.jpg' (9 KB) Download 'shadowline_reflection.jpg' (9 KB)

Preview of image 'shadowline_phong.jpg'
shadowline_phong.jpg

Preview of image 'shadowline_reflection.jpg'
shadowline_reflection.jpg


 

From: Ben Birdsey
Subject: Re: Another shadow line problem
Date: 18 Sep 2001 03:44:01
Message: <3BA6FB87.8DBB4532@mail.com>
The problem here is that POV-Ray can't easily search "over the horizon"
for a light source that "should be" illuminating the surface. (i.e. if
the highlight gets cut by the horizon line.)  This is well covered in
the docs.

But I'd like to bring up a completely different and similarly unphysical
issue with the phong highlight.  Since the amount of phong reflection is
proportional to 

	(R.L)^n
	where R is the Reflected ray
	and L is the ray to the Light

it is fairly easy to construct a scene where the Phong lighting model
*will not* illuminate an entire hemisphere because the term (R.L) is
negative for parts of the surface that are actually being illuminated by
the light source.

For example look at the following source.  By playing with the specular,
diffuse, and phong values you can see that the phong highlight is
unnaturally cut off before its actual horizon!

Just my $0.02

//=============================================================
//=============================================================

#version 3.5;

global_settings {
  assumed_gamma 1.0
  ambient_light 1
}

// ----------------------------------------

camera {
  location  <0.0, 0, -4.0>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  looks_like{ sphere{ <0,0,0>, 1 pigment{color<1,1,1>} finish{ ambient 1
} }  }
  translate <0, 30, 0>
  rotate<-40,0,0>
}

sphere {
  0.0, 1
  texture {
    pigment { color <1,0,0>    }
    finish{
      ambient 0
      
      specular .25
      roughness 1000

      diffuse 0.0
      brilliance 1000

      phong 0.25
      phong_size .001000

      reflection 1
    }
  }
}


Post a reply to this message

Goto Latest 10 Messages Next 4 Messages >>>

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