Forum

Fog in WinQuake

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Postby TimeServ » Sun Mar 20, 2011 5:19 am

Quake's lack of color variance makes any palette changes or attempts to fit it into 8/16-bit generic color palettes suffer too much. Maybe the fog might look better if your fog colormaps tried fitting to a Quake palette color ramp per distance instead of a straight up blend or something like that.

I've never really felt that fog was a good thing to have on standard Quake maps but people seem to want that feature.
TimeServ
 
Posts: 38
Joined: Wed Jun 08, 2005 4:02 pm

Postby JasonX » Sun Mar 20, 2011 4:57 pm

What about black fog?
JasonX
 
Posts: 411
Joined: Tue Apr 21, 2009 2:08 pm

Postby mankrip » Mon Mar 21, 2011 12:40 am

Black fog looks nice.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Postby leileilol » Mon Mar 21, 2011 12:45 am

I remember the days when black fog was called 'light diminishing'

now get off my lawn!
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby mh » Mon Mar 21, 2011 2:10 am

You could do cheap and cheesy (but fast) fog by blending miplevels 1, 2 and 3 of textures with your chosen fog colour. It actually looks OK in hardware with trilinear interpolation, but I'd guess it would look awful in software.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby mankrip » Mon Mar 21, 2011 2:16 am

And wouldn't work for anything but BSP surfaces.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Postby mh » Mon Mar 21, 2011 2:19 am

Well I did say cheap and cheesy. :twisted: :lol:
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby TimeServ » Mon Mar 21, 2011 8:22 am

Kinda what I was talking about.. also this technically isn't fog.

Image
Image
Image
TimeServ
 
Posts: 38
Joined: Wed Jun 08, 2005 4:02 pm

Postby ceriux » Mon Mar 21, 2011 4:58 pm

actually it kinda is. just set a view distance and have it stop rendering after that distance or something. i have no idea how it's supposed to work in C. but that actually looks pretty nice.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby dreadlorde » Mon Mar 21, 2011 9:48 pm

How about some volumetric fog first?
Ken Thompson wrote:One of my most productive days was throwing away 1000 lines of code.

Get off my lawn!
User avatar
dreadlorde
 
Posts: 268
Joined: Tue Nov 24, 2009 2:20 am

Postby leileilol » Mon Mar 21, 2011 10:23 pm

dreadlorde wrote:How about some volumetric fog first?


q3bsp is thataway
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby mh » Tue Mar 22, 2011 12:08 am

For volumetric fog you really need to start putting entities into your map so that you can define which surfaces are fogged. Then I'd guess that you need to change mnode_t::contents and mleaf_t::contents so that they can take bitwise values instead of their current single values, and |= them with CONTENTS_FOG in your BSP compiler. Oh, and also update the BSP compiler so that it won't explode when you do this. And define a func_fog entity that sets the fog parameters correctly.

Whee, such fun!
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby TimeServ » Tue Mar 22, 2011 1:44 am

Image
Image

It's really too bad the software renderer is the worst code to go through...
TimeServ
 
Posts: 38
Joined: Wed Jun 08, 2005 4:02 pm

Postby Spike » Tue Mar 22, 2011 4:12 am

mh wrote:For volumetric fog you really need to start putting entities into your map so that you can define which surfaces are fogged. Then I'd guess that you need to change mnode_t::contents and mleaf_t::contents so that they can take bitwise values instead of their current single values, and |= them with CONTENTS_FOG in your BSP compiler. Oh, and also update the BSP compiler so that it won't explode when you do this. And define a func_fog entity that sets the fog parameters correctly.


you can't do volumetric fog with just contents, it makes no sense. you need to consider the fog plane, and which fog region to use, rather than a simple 'its fogged' flag.

Q3bsp has a list of fog regions, and each surface can be in at most one fog region. Meaning each surface is fogged based upon its distance from the view, and its distance from the fog plane (if its on the other side of it from the view). So for q3 its 'just' an extra pass with special texture coords, drawn after each mesh (drawnormal(); if (surf->fog) {glColor4f(surf->fog->colour);updatetexcoords();drawindicies();}, basically). Keeps it simple.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Previous

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest