Fog and texture probs? Anyone feel like testing this?


I did a little screen saver afew people seem to be having problems that I can’t work out. I wondered if anyone would know why, or has similar probs?

I’ve used black fog to fade objects off into the distance but I’ve got a guy with a geForce card saying that it isn’t happening at all. I haven’t got anything special, just turning on the fog before drawing the objects and turning it off afterwards.

And I’ve got another dude saying that the 2nd texture on the rings (the writing) isn’t visible when he runs it with his Voodoo3. All I’ve done to draw the textures it blended them on with the GL_EUQAL depth test.

If anyone wants to try it out and let me know its available from:

Any ideas would be greatly appreciated.


I just ran it on my ****-box work PC, and the fog is not working. The writing on the rings can be seen though…


I just ran it on my ****-box work PC, and the fog is not working. The writing on the rings can be seen though…



What kind of vid card has it got?

Anyone know why fog wouldn’t work on some cards?

Worked fine on my TNT using latest official driver release and Win98, AMD K6-III.

Ran it on my Win98/GeForce2 GTS 64MB and it worked fine - although the fog had a hard boundary i.e. rings would pop into and out of view as though they passed the zFar boundary. Is that how it was supposed to look?

Nope not at all. They dont disappear til they’re beyond the darkest part of the fog… Yet they seem to on geforce cards??

How does it work on some cards and not others??

No fog here too…,
GeForce 2 mx, 32 mb

Maybe driver problems ?

Wierd as.

Ok, how would you guys with Geforce cards do fog?

Hey… I’ve been using that screensaver for the last couple of weeks or so. I grabbed it off your site when they had the link to it on the main page here.

I’ve got a GeForce 256, and I haven’t seen any fog effects. I’ve also run it on my computer at work (A wonderful Trident 3D card using the default MS implementation of OpenGL, woo hoo!), and on my laptop (Some crap chip by a company nobody has ever heard of.) I didn’t notice fog on any of them. The writing seems to work on them all, though.

Post some code for how you setup your fogging parameters. It might help us figure out what’s going on.

I’ve had abit of feedback and it seems to work for TNT/TNT2 cards but not much else. (which is what I’ve got).

This worries me alittle tho, why would something standard like this work on one card and not another? Obviously somethings wrong, but to fix it may mean to break it on TNT2 cards??

Anyone with a geforce will to do a test of another version for me?

Thanks for the help so far.

yeah, sure, post a link and i will test it.
Don’t you wanna post the source where you setup your fog ?


Sorry here it is:

GLfloat fogcolor[4] = {0.0, 0.0, 0.0, 1.0};
float FogDensity = 0.5f;

glFogfv(GL_FOG_COLOR, fogcolor);
glFogf(GL_FOG_DENSITY, FogDensity);
glFogf(GL_FOG_START, -85.0f);
glFogf(GL_FOG_END, -95.0f);

Then I just enable it. Any probs with that?

I changed the start and end to negative numbers because positive numbers didnt seem to do anything, altho I’ve always used positive numbers before (as far as I remember). But I suddenly thought that could be the problem? But if its gotta be positive, why doesnt that work on my TNT2 card?

I seem to be going in circles!

I’d be guessing that negative FOG_START & FOG_END might be giving you the problems. I’ve never seen negative numbers for these before (maybe someone else has?). The red & blue books don’t say you can’t have negatives but sort of imply you can’t - default values are 0 & 1 respectively anyway. Try a glGet for FOG_START and FOG_END after you set up the fog. I’d be interested to see the results. At a guess, they may be clamped to non-negative values in which case you’d get 0 for both and your linear fog equation would be (end - z)/(end - start) = -z/0 = not good!

BTW, your setting up of the fog isn’t between glBegin()/glEnd() is it? Just eliminating the obvious

Anyway, great screensaver (besides the fog )

[This message has been edited by ffish (edited 05-11-2001).]


As I said, I don’t remember using negative numbers before, but positive numbers just dont seem to work for me, so I didn’t notice anything wrong!

I’ve put a version up with positive numbers, and it doesn’t work for me (and I hate it without the fog, it looks awful).

If anyone would like to try it out and let me know if it works for them its available here:


And thanks!

Ok, now I’m really confused:

Just playing round with this and it seems that the rings are not effected by + fog values, yet the writing that floatin around is only effected by + values. The opposite?!

And I changed the func that draw each ring to draw a triangle in the middle of the ring. Simple enuff. And the triangle IS effected by the + values, yet the rest of the ring isnt?

HELP! How/why does this happen?

If you can answer this I’ll have your baby.


Please note: Thankfully, thats medically impossible.

That one from 2 posts above works fine for me regarding the rings and fog. The writing, well, the writing is affected, but I don’t know if it’s by your fog. Sometimes when the rings are coming in from -z to +z, the rings fade in from the fog and it takes a while for the writing to appear, like it sounds it happens on your card.

But sometimes the same effect happens when rings go from +z to -z and +y into the viewing frustum - it takes a while for the writing to appear. So I’m guessing that the fog is working fine but there is something slow about your texture binding? Maybe someone else will comment on how it looks on their machine.

Hope that helps.

I’m at work at the moment so I can’t test it on my GeForce 256, but the fog works on the default MS implementation of OpenGL now. Can’t tell if the text is affected because it runs so slow that the text seems to get messed up (the movement is very jumpy and not nearly as smooth as when run on my GeForce at home), but it did that before too.

One other note, I think fog density is only use with the exponential fog formulas so using that in your code probably isn’t having any effect.

One more thought, what drivers are you using with your TNT2 card? It seems really strange that it would work with negative start/end values, but not positive.

i wrote a demo recently ( not yet posted on my site, no time ) using the nv_fog_… extension (i forget the name) anyway negative numbers are ok for the standard fog i believe they use a fabs(fog) to get the density.
about the problems , are u by chance doing any sort of blending.
i believe fog becomes before blending in the pixel pipeline, which can lead to unwanted effects