![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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](/povray.binaries.images/attachment/%3C3ba61bf2%40news.povray.org%3E/shadowline1.jpg?ttop=443840&toff=10450&preview=1)
Preview of image 'shadowline2.jpg'
![shadowline2.jpg](/povray.binaries.images/attachment/%3C3ba61bf2%40news.povray.org%3E/shadowline2.jpg?ttop=443840&toff=10450&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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] tag povray org> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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] tag povray org> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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] zeropps uklinux net
%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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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] mobilixnet dk> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Tek" <tek### [at] evilsuperbrain com> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Warp" <war### [at] tag povray org> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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](/povray.binaries.images/attachment/%3C3ba6940d%40news.povray.org%3E/shadowline_phong.jpg?ttop=443840&toff=10450&preview=1)
Preview of image 'shadowline_reflection.jpg'
![shadowline_reflection.jpg](/povray.binaries.images/attachment/%3C3ba6940d%40news.povray.org%3E/shadowline_reflection.jpg?ttop=443840&toff=10450&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |