Felix K�hling wrote:
Hi,

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.

So the lighting problem described with FlightGear could actually be a
bug in FlightGear that just isn't visible with software lighting.

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] = {0.0, 10.0, 0.0};

The 4th coordinate is effectively random.  Changing this to:

    GLfloat lightpos[4] = {0.0, 10.0, 0.0, 1.0};

Fixes the problem.

-Brian



-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing
your web site with SSL, click here to get a FREE TRIAL of a Thawte
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to