Odd fogging problem

Started by
9 comments, last by NotTaxes 21 years, 8 months ago
I''m using standard fog to fade my view out over distance, and I''m using a large quad rendered with a semi-transparent texture for water. My problem is that when viewed at certain angles the entire water quad is colored by the fog. In my case, this is making my water turn black because my fog is black. The interesting part is that the water quad is many times larger than the fog depth for reasons that I won''t go into right now (the quad is 60 units, the fog is starting at about 20 units), but the entire quad only gets completely ''fogged'' at certain angles. I could understand it if the water was always fogged, because this would be similar to the "light-source near center/near edge of large polygon" problem, but that''s not the case. Any ideas?
'Doing the impossible is kind of fun' - Walt Disney
Advertisement
Don''t know if this helps but, first you should not be making huge tris, the cards also have problems when it comes to big tris, in some cases it could even kill your performance, use a collection of smaller tris, trust me on this (and adapt the rest of your code). Second, fog is calculated per vertex (and then interpolated for every pixel) so the far vertex will be full black, now at some place in the world your all your verts will be over the 20 threshold so you will naturall get full black everywhere...
Don''t know if this helps but, first you should not be making huge tris, the cards also have problems when it comes to big tris, in some cases it could even kill your performance, use a collection of smaller tris, trust me on this (and adapt the rest of your code). Second, fog is calculated per vertex (and then interpolated for every pixel) so the far vertex will be full black, now at some place in the world your all your verts will be over the 20 threshold so you will naturall get full black everywhere...

DAMN FORUMS WHY WON''T YOU WORK
Don''t know if this helps but, first you should not be making huge tris, the cards also have problems when it comes to big tris, in some cases it could even kill your performance, use a collection of smaller tris, trust me on this (and adapt the rest of your code). Second, fog is calculated per vertex (and then interpolated for every pixel) so the far vertex will be full black, now at some place in the world your all your verts will be over the 20 threshold so you will naturall get full black everywhere...

DAMN FORUMS WHY WON''T YOU WORK
Wow thats some anger...
OK, thanks. That makes sense. I thought that the fogging behaved differently from lighting because it''s so much smoother, but what you''re saying is that it''s not. I am happy to use smaller tris anyhow, just that a nice big one is so much easier to code :-)
'Doing the impossible is kind of fun' - Walt Disney
You could always use PIXEL fog if your card supports it.

VERTEX FOG = calculate fog at vertices and interpolate colour between.

PIXEL FOG = fog calculated by reading the depth buffer ( i presume ) and there fore more accurate for LARGE triangles.

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
Your problem is you're using vertex fog and you've got such huge polys. As the previous poster said, pixel fog is good if you want to keep your big polygons, but I'd just recommend a higher level of tesselation.

EDIT: Oh, and your problem isn't as "odd" as you say it is

[edited by - Johnny_W on August 15, 2002 5:26:02 AM]
All that you say makes sense except, as it turns out, I *am* using pixel fog. And I thought it was weird because it only happens at certain angle-ranges (from about 260-290 and again between 350 to 10).

Have switched to a more tessellated polygon and it sort of fixes the problem, except that the performance is down by quite a lot.

No matter, I shall play with the variables until it works right
'Doing the impossible is kind of fun' - Walt Disney
Hmmm, that is fogging odd.

Sorry, I couldn''t resist..

T

This topic is closed to new replies.

Advertisement