Perhaps not on PC parts, but we did this on the PS2 and XBOX for Bond: EON. On PS2 it's necessary because it halves your draw rate, and doesn't play well with multi-pass.
 
Yes it has glitches with things that don't set the alpha buffer, but we only ever used it as a subtle distance queue so the errors aren't very noticeable.


From: David Whatley [mailto:david@play.net]
Sent: Saturday, April 24, 2004 10:03 AM
To: gdalgorithms-list@lists.sourceforge.net
Subject: Re: [Algorithms] view dependant fog error

Do you mean using the actual Z buffer or something different?  I didn't think you could use that data (with funky representations it has).

-- David


[Rok Erjavec on 4/24/2004 11:33 AM]
Not sure if you have the option to do so, but have you considered fog as a postprocess using depth buffer?
Still leaves you with one special case for stuff that doesn't write to Z, but that sounds like less trouble to solve then what you described :P
 
----- Original Message -----
From: David Whatley
To: gdalgorithms-list@lists.sourceforge.net
Sent: Sunday, April 25, 2004 1:08 AM
Subject: Re: [Algorithms] view dependant fog error

True about the future of fog...but...

(sigh)  I'm so out of pixel shader instructions for many of my 1.1 and 1.4 version of my effects.  So that gets me in the quandary... having some things fog and others not fog is visually awful.  So either I have to shoehorn fog in everywhere or nowhere.  Or limit it to 2.0, but fog is something that carefully balances with the art to yield the desired effect (or hide something).  So, having for 2.0 only would mean alternate content designs for areas to look/work remotely right... and that's not going to cut it.

Alternative, dumb down some effects so they can do fog instead of whatever else they did.  So I lose normal mapping in lue of fog or something like that.  Some things, like per-pixel attenuated spot effects... there's nothing to drop out, either I can bearly squeeze it in or not at all.

Anyone have any ideas what the right strategy is on these half-baked shader revs?

-- David


[Tom Forsyth on 4/23/2004 10:14 PM]
Indeed - see the docs on D3DRS_RANGEFOGENABLE for example.

However, fog is a special-cased hack (and not a very good one at that) that
will go away shortly and be entirely replaced by just doing whatever shader
instructions you feel like to get a similar effect.

TomF.

  
-----Original Message-----
From: gdalgorithms-list-admin@lists.sourceforge.net 
[mailto:gdalgorithms-list-admin@lists.sourceforge.net] On 
Behalf Of Ignacio Castaņo
Sent: 23 April 2004 17:38
To: gdalgorithms-list@lists.sourceforge.net
Subject: Re: [Algorithms] view dependant fog error


Hi Ian,

Depth fog is sometimes preferred over distance fog, because depth 
changes linearly along triangles, while distance does not. For this 
reason depth fog is independant of tesellation. Distance fog 
can cause 
artifacts on meshes with low tesselation or during lod changes. There 
are OpenGL extensions to switch between the two, and I wouldn't be 
surprised if Direct3D provided the same feature.

-- 
Ignacio Castaņo
castanyo@yahoo.es



Ian McMeans wrote:
    
This is kind of a minor issue, but I thought maybe some 
      
people will be 
    
interested in it and will fix it in their games. I've noticed it in 
plenty of games, I'm sure other people have noticed it too. 
      
I searched 
    
the archives in case this had been discussed before, and 
      
found nothing.
    
 
The error is how the fog is view-direction-dependant. Look at the 
central tower in this screenshot of ONS-Torlan:
http://img9.imageshack.us/my.php?loc=img9&image=Shot00000.jpg 
<http://img9.imageshack.us/my.php?loc=img9&image=Shot00000.jpg>
 
and then this screenshot, taken facing a slightly different 
      
direction:
    
http://img9.imageshack.us/my.php?loc=img9&image=Shot00001.jpg 
<http://img9.imageshack.us/my.php?loc=img9&image=Shot00001.jpg>
 
Now, my guess is that it's caused by how the fog is computed using 
depth, and depth in turn is computed based on the view 
      
frustrum. And 
    
when you're looking at something in the corner of your view 
      
frustrum, 
    
then the fog is less intense there because the object 
      
you're looking at 
    
is then further from the far plane. (Sorry if this 
      
explanation isn't too 
    
clear).
 
Is it just not worth fixing because it's a minor issue? I 
      
imagine you 
    
could fix it by weighting the fog based on the view vector 
      
compared to 
    
the lookat vector, but perhaps the cost in shader 
      
instructions isn't 
    
worth the benefit in this case.
      
-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
GDAlgorithms-list mailing list
GDAlgorithms-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=6188

    



-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg297
_______________________________________________
GDAlgorithms-list mailing list
GDAlgorithms-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_ida88