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