[Piglit] GL_LIGHTING test

Brian Paul brianp at vmware.com
Thu Aug 12 06:54:46 PDT 2010


On 08/12/2010 07:38 AM, Michal Suchanek wrote:
> On 12 August 2010 15:12, Brian Paul<brianp at vmware.com>  wrote:
>> 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.
>>
>
> With any driver the object is dark when the light is placed in the
> positive z subspace.

Hmmm, I changed the light position to be +Z:

GLfloat light_position[4] = { 0, 0, +(1.0 * radius * 2.3), 1 };

and the sphere is now brightly lit (NVIDIA, gallium softpipe & llvmpipe).


>
> The difference in rendering between swrast and llvmpipe is quite
> subtle.
> The object is lit with either driver but the bright area is
> slightly larger with llvmpipe and the gradient steeper around it than
> with swrast.

They look distictly different here when I compare here.  See attached 
pics (with negative Z light position).


> There are two lighting results and which is correct is disputable. The
> one produced by r300/swrast/Intel looks more natural to me than the
> one produced by r600/r600g/llvmpipe but the scene is obviously
> artifical so I can't judge unless I looked up some specs on the
> lighting.

I'm inclined to think that the gallium and NVIDIA drivers are correct 
in this case.

-Brian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: swrast-lighting.png
Type: image/png
Size: 9884 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20100812/2b5ab816/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nv-gallium-lighting.png
Type: image/png
Size: 2507 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20100812/2b5ab816/attachment-0003.png>


More information about the Piglit mailing list