Bug 15731

Summary: Strange (reversed?) fog calculation in "fire" mesa demo
Product: Mesa Reporter: Ove Kaaven <ovek>
Component: Drivers/DRI/r200Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Ove Kaaven 2008-04-26 19:56:13 UTC
In the "fire" mesa demo, with the r200 driver (I have Radeon Mobility 9100 IGP), if you rotate the camera with the left/right arrow (and leave the fog on), the color of the ground tile becomes different from what it looks like with software rendering. With software rendering, it's almost white regardless of viewing angle. With r200 direct rendering, the tile gets much darker (much less fog) if you rotate any corner of the ground tile to the center of the screen. This seems a little backwards, since if anything, this viewing angle ought to increase the fog of the far vertex, not decrease it. (The tile is probably flat-shaded in this demo, but it still seems wrong.) R200_NO_TCL has no effect.
Comment 1 Roland Scheidegger 2008-04-28 07:35:26 UTC
I think what you're seeing is just the difference between per-pixel and per-vertex fog. The r200 driver will ignore the fog hint (which is legal to do), but the software renderer will switch between the two modes based on the hint. If you press the "n" key you get per-vertex fog even with software mode, and it seems to behave more like the r200 driver. There's still quite some difference, but this may be due to precision issues possibly I think.
Comment 2 Ove Kaaven 2008-04-28 08:25:19 UTC
So it's a hardware limitation? In that case, sorry for wasting your time.
Comment 3 Roland Scheidegger 2008-04-28 12:08:40 UTC
(In reply to comment #2)
> So it's a hardware limitation? In that case, sorry for wasting your time.
If you're talking per-vertex vs. per-pixel fog, both are possible as per GL spec (though per-pixel is the more correct approach). The chip can't really do per-pixel fog (it could do some table-based per-pixel fog but I believe it doesn't really translate to GL, only D3D). In this case the results just happen to be very different for per-pixel vs. per-vertex fog. I think that real world apps would probably make some effort that results don't get that different.
Comment 4 Adam Jackson 2009-08-24 12:30:08 UTC
Mass version move, cvs -> git

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.