Robert F Merrill wrote:
Robert F Merrill wrote:

Bug in mesa's glLightfv() (src/mesa/main/light.c):

When you send a 4-float array to glLightfv with GL_POSITION, the fourth float indicates whether the light is
directional or positional. 1 is positional, 0 is directional.


However, mesa checks for this after it does a matrix transform on the float array, thus making pretty much any
light directional when it shouldn't be.


change the check for l->EyePosition[3] != 0.0f (line 108 light.c) to param[3] != 0.0f

Also, we should be using TRANSFORM_POINT3, because the fourth float has no other significance, so it
should not influence the final direction... or at least that's how I think it is...

I double-checked with the GL spec and the OpenGL sample implementation and I belive Mesa is correct as-is.


In the OpenGL spec, Ppli (pli in subscript) is the light position after being transformed to eye coordinates. The OpenGL SI uses a full 4x4 transformation. Later, the transformed Ppli.w is tested against zero to determine the attenuation factor (equation 2.4).

-Brian



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
--
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to