Nudibranch problems (Mac)

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Mon May 21 17:13:22 UTC 2001


On Sun, 20 May 2001, Raab, Andreas wrote:

> > Andreas, do you do something unusual to the projection matrix? This is
> > known to mess up fog because eye coordinates get wrong.
>
> I don't *think* so since linear fog seems to work fine on my machine (which
> obviously is my preferred test platform) but I could never do anything
> reasonable with either exp or exp2 fog. Is there a chance that GL likes a
> different projection matrix better?! (eventually one that has a -1 instead
> of a 1 in m34) The D3D documentation says that a "w-friendly" projection
> matrix (which is required for accurate fog) should have 1 in m34 and
> currently, that's what we're using. Might be worthwhile trying to find it
> out.

gluPerspective puts a -1 there ...

I actually found the problem: you restricted the near/far fog range to
0..1 which is wrong because in OpenGL linear fog works in eye
coordinates. So everything from distance 1 to infinity was bluish in
nudi. I changed it to allow all distances
	fogRangeEnd: aNumber
		myCamera setFogRangeEnd: (aNumber "min: 1.0" max: 0.0)
and indeed, linear fog works when I give 10000 as range end. Odd enough,
the fogging of the ground plane depends on the viewing direction?! It
works fine for all other objects, as well as for exponential fog.

-- Bert






More information about the Squeak-dev mailing list