From: Brian P. <br...@tu...> - 2002-11-15 14:58:23
|
Felix K=FChling wrote: > Hi, >=20 > I made a small programme to illustrate the TCL/SW lighting differences. > It displays a square consisting of 10x10 quads which is lit by one > lightsource. The distance between the lightsource and the square is > changed periodically. With TCL this has the desired effect, with > software lighting it doesn't have any effect at all. This looks like an > optimization that assumes lightsources to be at infinite distance. I > attached the programme. With a macro you can switch between diffuse and > specular lighting. >=20 > So the lighting problem described with FlightGear could actually be a > bug in FlightGear that just isn't visible with software lighting. >=20 There's a bug in your program. The GL light position is a homogeneous coordinate (4 components) but you're only providing 3 components: GLfloat lightpos[3] =3D {0.0, 10.0, 0.0}; The 4th coordinate is effectively random. Changing this to: GLfloat lightpos[4] =3D {0.0, 10.0, 0.0, 1.0}; Fixes the problem. -Brian |