POV-Ray : Newsgroups : povray.newusers : Crazy lighting Server Time
29 Jul 2024 14:19:09 EDT (-0400)
  Crazy lighting (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Ian Crofoot
Subject: Crazy lighting
Date: 12 Dec 2005 05:45:00
Message: <web.439d5320bf36aed9265c44900@news.povray.org>
[url]http://img.photobucket.com/albums/v505/imcmonkey/problem.jpg[/url]

I turned down the ambience and brilliance to illustrate the problem here.

If it's not readily apparent, the light is only lighting part of a smooth,
even, surface.  You can see at the back of the desk it goes really crazy.
There's nothing obstructing the light's path, either.  It is above the
center of the desk a little over a foot high.  You can tell this by looking
at the shadows.

I'm using very basic light source and texture here, so I don't know what the
problem is.

light_source {
  <52.5, -6.2, -20>
  rgb <1,.97,.9>

}
#declare wood_WingsMat =
  texture{
      pigment{ rgbf <0.726940, 0.646726, 0.436164, 0.00000e+0>}
      finish{
        ambient 0
        diffuse 1
        brilliance 0
        specular 0.500000 roughness .05
        }
}

Can anybody help a poor, lost soul?


Post a reply to this message

From: Chris B
Subject: Re: Crazy lighting
Date: 12 Dec 2005 06:03:50
Message: <439d5916@news.povray.org>
"Ian Crofoot" <nomail@nomail> wrote in message 
news:web.439d5320bf36aed9265c44900@news.povray.org...
> [url]http://img.photobucket.com/albums/v505/imcmonkey/problem.jpg[/url]
>
> I turned down the ambience and brilliance to illustrate the problem here.
>
> If it's not readily apparent, the light is only lighting part of a smooth,
> even, surface.  You can see at the back of the desk it goes really crazy.
> There's nothing obstructing the light's path, either.  It is above the
> center of the desk a little over a foot high.  You can tell this by 
> looking
> at the shadows.
>
> I'm using very basic light source and texture here, so I don't know what 
> the
> problem is.
>
> light_source {
>  <52.5, -6.2, -20>
>  rgb <1,.97,.9>
>
> }
> #declare wood_WingsMat =
>  texture{
>      pigment{ rgbf <0.726940, 0.646726, 0.436164, 0.00000e+0>}
>      finish{
>        ambient 0
>        diffuse 1
>        brilliance 0
>        specular 0.500000 roughness .05
>        }
> }
>
> Can anybody help a poor, lost soul?
>
>
>

What is the desk made of?
If it's a mesh, then you may find that it's a problem with normals.
If some mesh normals point up and some point down, then you can get dark 
bands across the surface.

Chris B.


Post a reply to this message

From: Warp
Subject: Re: Crazy lighting
Date: 12 Dec 2005 08:19:09
Message: <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


Post a reply to this message

From: Chris B
Subject: Re: Crazy lighting
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

From: Warp
Subject: Re: Crazy lighting
Date: 12 Dec 2005 10:22:51
Message: <439d95cb@news.povray.org>
Chris B <c_b### [at] btconnectcomnospam> wrote:
> 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 was assuming you were talking about flat triangles (since you didn't
specifically mention smooth triangles and their vertex normals...)

  Naturally if you have a smooth triangle and one of the vertex normals
points to the wrong direction, the lighting in between will be wrong,
as the in-between normals are interpolated.

-- 
                                                          - Warp


Post a reply to this message

From: Chris B
Subject: Re: Crazy lighting
Date: 12 Dec 2005 11:01:28
Message: <439d9ed8@news.povray.org>
"Ian Crofoot" <nomail@nomail> wrote in message 
news:web.439d5320bf36aed9265c44900@news.povray.org...
> [url]http://img.photobucket.com/albums/v505/imcmonkey/problem.jpg[/url]
>
> I turned down the ambience and brilliance to illustrate the problem here.
>
> If it's not readily apparent, the light is only lighting part of a smooth,
> even, surface.  You can see at the back of the desk it goes really crazy.
> There's nothing obstructing the light's path, either.  It is above the
> center of the desk a little over a foot high.  You can tell this by 
> looking
> at the shadows.
>
> I'm using very basic light source and texture here, so I don't know what 
> the
> problem is.
>
> light_source {
>  <52.5, -6.2, -20>
>  rgb <1,.97,.9>
>
> }
> #declare wood_WingsMat =
>  texture{
>      pigment{ rgbf <0.726940, 0.646726, 0.436164, 0.00000e+0>}
>      finish{
>        ambient 0
>        diffuse 1
>        brilliance 0
>        specular 0.500000 roughness .05
>        }
> }
>
> Can anybody help a poor, lost soul?
>
>

Another thought is whether you have tried isolating the offending surface, 
removing everything else except the light and camera. If it looks OK in 
isolation you could gradually add the other elements back into the scene 
until the problem reappears.

Regards,
Chris B.


Post a reply to this message

From: Ian Crofoot
Subject: Re: Crazy lighting
Date: 12 Dec 2005 14:55:00
Message: <web.439dd44e9249257b265c44900@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote:
>
> Another thought is whether you have tried isolating the offending surface,
> removing everything else except the light and camera. If it looks OK in
> isolation you could gradually add the other elements back into the scene
> until the problem reappears.
>
> Regards,
> Chris B.

http://img.photobucket.com/albums/v505/imcmonkey/desksurface.jpg

No luck.

And yes, it is a mesh, but a very simple one.  It's just a box, with each
face being, well, a single solid face.  So the surface of the desk would
have one normal, correct?  Banding isn't possible in this case, is it?

I'm exporting from wings 3D, and am not well versed with the mechanics of
this stuff.  Here's the entire code for the desk surface.  Perhaps one of
you can spot something funky:

// Exported from Wings 3D 0.98.29b

camera {
  perspective
  location <-14.0917608784, 8.4138755804, -7.1058150950>
  right < -1.33333, 0, 0>
  look_at <-2.1919112017, 2.4624901781, -10.8578232859>
}
light_source {
  <52.5, -6.2, -20>
  rgb <1,.97,.9>

}
#declare wood_WingsMat =
  texture{
      pigment{ rgbf <0.726940, 0.646726, 0.436164, 0.00000e+0>}
      finish{
        ambient 0
        diffuse 1
        brilliance 0
        specular 0.500000 roughness .05
        }
}
#declare cube1_sep207 = mesh2 {
vertex_vectors
{8,<46.7685,-18.5011,-40.1951>,<46.7685,-17.5011,-40.1951>,
<46.7685,-17.5011,7.80493>,<46.7685,-18.5011,7.80493>,
<70.7685,-18.5011,-40.1951>,<70.7685,-17.5011,-40.1951>,
<70.7685,-17.5011,7.80493>,<70.7685,-18.5011,7.80493>}

normal_vectors
{8,<-0.408248,-0.816497,-0.408248>,<-0.666667,0.333333,-0.666667>,
<-0.408248,0.816497,0.408248>,<-0.666667,-0.333333,0.666667>,
<0.666667,-0.333333,-0.666667>,<0.408248,0.816497,-0.408248>,
<0.666667,0.333333,0.666667>,<0.408248,-0.816497,0.408248>}

texture_list { 1,
 texture { wood_WingsMat }
}
face_indices
{12,<0,4,7>,0,<0,7,3>,0,<1,0,3>,0,<1,4,0>,0,<1,5,4>,0,<2,6,5>,0,
<3,2,1>,0,<3,7,6>,0,<4,5,6>,0,<5,1,2>,0,<6,2,3>,0,<6,7,4>,0}
normal_indices
{12,<0,4,7>,<0,7,3>,<1,0,3>,<1,4,0>,<1,5,4>,<2,6,5>,
<3,2,1>,<3,7,6>,<4,5,6>,<5,1,2>,<6,2,3>,<6,7,4>}
}
cube1_sep207

Again, your guys' assistance is very much appreciated. :)


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Crazy lighting
Date: 12 Dec 2005 17:00:01
Message: <web.439df2609249257b6c4803960@news.povray.org>
There is a major problem with you normals here.  The normals appear to be
somewhat inside out, but more importantly, they are not orthagonal to the
faces (considering they're supposed to be flat.  Pov interprets the surface
as curved according to the normals, and shades it as such, even though the
actual surfaces are flat.

Seeing as this is a flat object, the vertices at the corner of each triangle
would have to be identical and orthagonal to that triangle to be shaded
correctly.  But because it is a flat object, you don't need to specify
normals at all.  Try deleting or commentig out both the normal_vectors and
normal_indices sections.


Post a reply to this message

From: Ian Crofoot
Subject: Re: Crazy lighting
Date: 12 Dec 2005 19:10:01
Message: <web.439e10749249257b265c44900@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> There is a major problem with you normals here.  The normals appear to be
> somewhat inside out, but more importantly, they are not orthagonal to the
> faces (considering they're supposed to be flat.  Pov interprets the surface
> as curved according to the normals, and shades it as such, even though the
> actual surfaces are flat.
>
> Seeing as this is a flat object, the vertices at the corner of each triangle
> would have to be identical and orthagonal to that triangle to be shaded
> correctly.  But because it is a flat object, you don't need to specify
> normals at all.  Try deleting or commentig out both the normal_vectors and
> normal_indices sections.

That did it.  Thank you very much!


Post a reply to this message

From: Roman Reiner
Subject: Re: Crazy lighting
Date: 13 Dec 2005 06:10:01
Message: <web.439eab1f9249257b162cdb8b0@news.povray.org>
Hi Ian

Are you new to wings? I seems to me as if you are not aware of the
possibility to use hard edges. I modeled with wings quite a while until I
recognized that feature too and also solved that problem by commenting out
the normals in the meshoutput as Trevor suggested. Instead do just select

switch to the soft shading mode (by clicking the most upper left pyramid
icon or simply hitting tab) you should see the difference.

Hope that helps
Regards Roman

PS: I use PoseRay to convert *.wings files to PovRay readable format.
PoseRay has the advantage that you can check the models for errors much
easier and faster than in wings or even by rendering it in PovRay. In
addition you can export not just the object but also a complete scene with
camera and lighting directly into a *.pov file which spares a lot of time
adjusting the camera and lighting.


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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