• Advertisement

Archived

This topic is now archived and is closed to further replies.

Diffrent layers of fog? (Done)

This topic is 5124 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In Gl games like quake 3 I have seen fog done in layers, not uniform all over the entire "level." How exactlly would I go about doing that without shaders? Thanks for any input. [edited by - skow on February 8, 2004 2:53:22 PM] [edited by - skow on February 9, 2004 2:50:02 PM]

Share this post


Link to post
Share on other sites
Advertisement
The way i did it is drawing several fog quads and moving the textures on them in different directions, this actually made pretty realistic and considerably fast fog (the framerate of 6.x is caused by the high detail heightmap!). A still:




[edited by - Tree Penguin on February 8, 2004 2:09:37 PM]

Share this post


Link to post
Share on other sites
You''re probably looking for so called height based fog. This is made possible with the GL_EXT_fog_coord extension. Luckily NeHe has a tutorial on this very thing : Just check out Lesson 41

Good luck

Share this post


Link to post
Share on other sites
That fog does look nice and I've seen it used in several games. The only problem is when you go into the fog; I'm working on a FP game where you can go down into fog. Using 2d textures won't look good once you enter the fog, unless there is somthing I'm not thinging about.

EDIT: GL_EXT_fog_coord...hah that makes it too easy, thanks for the info. I think I'll be using that comboed with sprite fog to give it some "noise."


Thanks guys.


[edited by - skow on February 8, 2004 2:17:11 PM]

Share this post


Link to post
Share on other sites
That might be the case, i am not really sure about it. Of course extentions are always better to use (faster, and probably looking better in most cases) but this is easier and it did suit my project.

Share this post


Link to post
Share on other sites
I certonly think that that style of fog does look better TP while viewing it from outside the fog, but like I said it has limitations as you enter.

Share this post


Link to post
Share on other sites
Certainly, but i know for sure there are ways to get that quality anyway when entering it without drastic framerate lowerings. I will look into that some time.

Share this post


Link to post
Share on other sites
Hmm well I just read up on the glFogCoordEXT, there is a problem with that method. It colors the polygons dependent what you set the vertex fog level at.

This makes a good effect to look into fog, but once you neter the area it''s not very convincing. For example say a lower part of an area is in fog. You go down there and look up. The upper area is still perfectly clear.

I''m hoping to find a method like GL_FOG where things become harder to see depending how far you are away from them, not their location.

Share this post


Link to post
Share on other sites
Yeah, I need to do this with out shaders.

Here is a picture of the problem with fog_coords, looking out from in the fog.



[edited by - skow on February 8, 2004 3:00:54 PM]

Share this post


Link to post
Share on other sites
There is a demo on height fog on nVidia''s dev pages. It uses texture lookup to create volume fog effect and sloves the problem of "looking out of fog".

You should never let your fears become the boundaries of your dreams.

Share this post


Link to post
Share on other sites
YOU WANT THIS EFFECT RIGHT(FROM QUAKE III)?



51 FPS because im on a crappy PC atm.




[edited by - DerAngeD on February 8, 2004 3:11:43 PM]

Share this post


Link to post
Share on other sites
2 Pics from quake3 showing in and out of the layered fog:






Darkwing could you look up the link for me? Anything I find on the nvidia site involving layered fog is using shaders.


[edited by - skow on February 8, 2004 3:25:47 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by _DarkWIng_
There is a demo on height fog on nVidia''s dev pages. It uses texture lookup to create volume fog effect and sloves the problem of "looking out of fog".

You should never let your fears become the boundaries of your dreams.


that demo uses D3D


Share this post


Link to post
Share on other sites
quote:
Original post by DerAnged
that demo uses D3D


So what? If you can do it D3D you can do it in OpenGL.

quote:
Original post by skow
Darkwing could you look up the link for me? Anything I find on the nvidia site involving layered fog is using shaders.


here it is : link

You should never let your fears become the boundaries of your dreams.

[edited by - _DarkWIng_ on February 8, 2004 4:10:15 PM]

Share this post


Link to post
Share on other sites
Or what about volumetric fog (see www.gametutorials.com) and then drawing a blended polygon at every opening (won''t be that many) to simulate fog when looking out the volume. This seems reasonable and should look good.

Share this post


Link to post
Share on other sites
quote:
Original post by skow
Yeah, I need to do this with out shaders.

Here is a picture of the problem with fog_coords, looking out from in the fog.



well, it''s pretty simple.

the way quake3 does it is that every vertex that is inside or behind the fog volume get colored by the fog acording to the distance the eye to vertex ray passes trough the fog volume.
this solves the looking out from the fog problem.

I tried to implement this in the quake engine once, it worked somewhat, but due to my extreamly low understanding of openGL at that time it still looked like crap.

I hope you will do better.



---------------------------------
For an overdose of l33tness, flashbang.nu

Share this post


Link to post
Share on other sites
quote:
Original post by Tree Penguin
Or what about volumetric fog (see www.gametutorials.com) and then drawing a blended polygon at every opening (won''t be that many) to simulate fog when looking out the volume. This seems reasonable and should look good.


I already thought of this, but it wont have a smooth fade into fog.

Overlord that''s what I''ve decided to do, using the fog_coord extention to color it. I just need to work out a fast method of doing it (there are a TON of verticies in my demo).

Share this post


Link to post
Share on other sites

  • Advertisement