Bug 4900 - Radeon LINEAR and EXP fogging don't work in non-fogcoord
Summary: Radeon LINEAR and EXP fogging don't work in non-fogcoord
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/R100 (show other bugs)
Version: git
Hardware: Other FreeBSD
: high normal
Assignee: Eric Anholt
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-27 00:56 UTC by Eric Anholt
Modified: 2009-08-24 12:23 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
fix fog equations for LINEAR, EXP. (730 bytes, patch)
2005-10-27 00:57 UTC, Eric Anholt
Details | Splinter Review

Description Eric Anholt 2005-10-27 00:56:20 UTC
As the summary says, Mesa/progs/tests/fog.c gives bad results for non-fogcoord
fog on r100 with LINEAR and EXP.  Attached patch fixes it, though I'd like to
get confirmation that others think it's a good idea.  It contradicts the
documentation, which says that the previous equations were right.  What do
people think?
Comment 1 Eric Anholt 2005-10-27 00:57:02 UTC
Created attachment 3642 [details] [review]
fix fog equations for LINEAR, EXP.
Comment 2 Keith Whitwell 2005-10-27 02:28:19 UTC
I think this has bounced back and forth over the years.  If possible test on
some broader applications, it seems to me there may be cases where the existing
code gives the right behaviour, ie. there may be a need to adjust the sign based
on other state (though I've no idea what that might be).  At worst, make the
switch but add a comment so that next time at least we'll remember what happened
before.
Comment 3 Ian Romanick 2005-10-27 07:40:28 UTC
This makes me think of an old Michael Abrash quote about graphics programming: 
If it looks good, it is good.  The most likely scenario is that it's a misprint
in the DDK.  It may also be a chip bug.  Which r100-class chip did you test?  We
may want to get test coverage on other chips in the family before this gets
committed.  In the worst case, some versions may require the negation and others
may not.
Comment 4 Eric Anholt 2005-10-27 12:59:56 UTC
And given that the r200 has the same equations as after my patch, I'm more
convinced that this is right.  Committed.
Comment 5 Roland Scheidegger 2006-01-23 11:48:56 UTC
Actually, this does not work correctly on my radeon 7200 (r100). I don't get any
fog for GL_LINEAR and GL_EXP (with GL_FRAGMENT_DEPTH as source) with
demos/fogcoord, when tcl is active. Old equations work (for this demo). However,
for tests/fog, indeed the new equations must be used. Doesn't make any sense,
the two tests should cause pretty much the same state to be set on the chip
(regarding fog and lighting) too :-(. Assuming of course that the non-tcl mesa
fog calculation is correct for both these tests.
(Related to #5682)
Comment 6 Eric Anholt 2006-02-21 07:26:40 UTC
Could you provide a demo for the brokenness?
Comment 7 Arthur Taylor 2006-09-24 17:14:52 UTC
Strangly enough where as GL_EXP and GL_LINEAR fogging were broken, GL_EXP now
works in both the fog demo/test and applications for me. GL_LINEAR is still
broken, with either the test case working or apps working. I'm using Mesa
version: 6.5.
Comment 8 Christopher Lane Hinson 2007-02-28 08:42:26 UTC
This patch broke LINEAR and EXP fog on my system.

lspci says:

Radeon Mobility M7 LW [Radeon Mobility 7500]

Kudos to the person who thought to leave the comments, that really helped me.

Debian bts where I first filed the report, for reference:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=390405
Comment 9 Jerome Glisse 2009-05-20 05:36:37 UTC
Closing it seems to work here with mesa 7.5, reopen if you still have this issue with recent mesa.
Comment 10 Adam Jackson 2009-08-24 12:23:32 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.