[Piglit] GL_LIGHTING test
Brian Paul
brianp at vmware.com
Thu Aug 12 06:12:03 PDT 2010
On 08/12/2010 05:18 AM, Michal Suchanek wrote:
> On 12 August 2010 00:11, Brian Paul<brianp at vmware.com> wrote:
>> On 08/11/2010 10:01 AM, Michal Suchanek wrote:
>>>
>>> Hello
>>>
>>> I experience issues with some 3D applications rendering odd (too
>>> bright) on a r600.
>>>
>>> Going through mesa demos I noticed that GL_LIGHTING produces different
>>> result on r600 than other cards making the bright area larger.
>>>
>>> I wrote a test that checks for this difference.
>>>
>>> For me it fails on r600, r600g and llvmpipe and succeeds on swrast. It
>>> should also succeed on r300 or i915 which render the demo much like
>>> swrast but I did not actually run the test on them.
>>>
>>> The test can be found at
>>> http://repo.or.cz/w/piglit/hramrach.git/shortlog/refs/heads/wip
>>>
>>> I would like to get a test for this issue into piglit so that it's
>>> easy to check.
>>>
>>> If the test is inadequate please specify how it should be improved.
>>
>> I took a quick look and it appears that gallium/softpipe/llvmpipe are
>> correct but swrast is wrong. NVIDIA's driver agrees with gallium too.
>>
>> I think the issue is the light source is positioned behind the object so
>> there should be no diffuse contribution to the final color. I don't know
>> why swrast (tnl, actually) is producing non-zero diffuse lighting in this
>> case.
>>
>
> AFAICT the light source is in front of the object. If it were behind
> the whole object would be dark.
The light position is:
GLfloat light_position[4] = { 0, 0, -(1.0 * radius * 2.3), 1 };
Z is negative there and the modelview matrix is the identity when the
glLight() call is made.
With gallium drivers and the NVIDIA driver the object is dark (no
diffuse contribution), as I would expect.
-Brian
More information about the Piglit
mailing list