POV-Ray : Newsgroups : povray.newusers : Crazy lighting : Re: Crazy lighting Server Time
29 Jul 2024 12:27:58 EDT (-0400)
  Re: Crazy lighting  
From: Chris B
Date: 12 Dec 2005 09:29:40
Message: <439d8954@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message 
news:439d78cd@news.povray.org...
> Chris B <c_b### [at] btconnectcomnospam> wrote:
>> If some mesh normals point up and some point down, then you can get dark
>> bands across the surface.
>
>  That's like saying that if you put a light source and the camera inside
> a sphere, all you get is black because the normal vector of the sphere
> is pointing outwards.
>
>  The direction of the normal vector doesn't matter (it gets inverted as
> needed).
>
> -- 
>                                                          - Warp

Hi Warp,

With the following SDL it seems to matter. I've inverted the N2 normal on 
the third smooth triangle and get banding of the sort I described. Whereas 
before inverting it the surface was smooth.

I think that maybe what you're saying is that the point at which the normal 
is specified will get a correct value (which I agree with), but there is 
still banding part of the way to the next vertex, presumably where the 
intermediate value, as it transitions from one point to the next, results in 
a normal parallel to the surface.

Regards,
Chris B.

light_source { < -150, 10  ,-80> color rgb 1}
camera {location <0.5,0.5,-2> look_at <0,0.5,0>}


#local P1  = < 0,0,0  >;
#local P2  = < 0,1,0.5>;
#local P3  = < 1,0,0  >;
#local P4  = < 1,1,0  >;
#local P5  = <-1,0,0.2>;
#local P6  = <-1,1,0  >;

#local N1a = vnormalize(vcross(P3 - P1, P2 - P1));
#local N2a = vnormalize(vcross(P4 - P2, P2 - P1));
#local N3  = vnormalize(vcross(P3 - P1, P4 - P3));
#local N4  = vnormalize(vcross(P4 - P2, P4 - P3));

#local N1b = vnormalize(vcross(P1 - P5, P2 - P1));
#local N2b = vnormalize(vcross(P2 - P6, P2 - P1));
#local N6  = vnormalize(vcross(P2 - P6, P6 - P5));
#local N5  = vnormalize(vcross(P1 - P5, P6 - P5));

#local N1 = (N1a+N1b)/2;
#local N2 = (N2a+N2b)/2;


#debug concat("N2a; ",vstr(3,N2a,",",3,3),"\n")
#debug concat("N2b: ",vstr(3,N2b,",",3,3),"\n")
#debug concat("N2 : ",vstr(3,N2,",",3,3),"\n")

mesh {
  smooth_triangle { P1, N1, P2, N2, P3, N3}
  smooth_triangle { P2, N2, P3, N3, P4, N4}
  smooth_triangle { P1, N1, P2, -N2, P5, N5}
  smooth_triangle { P2, N2, P5, N5, P6, N6}
  pigment {color rgb 1}
}


Post a reply to this message

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