Jump to content

Fog rendering


Recommended Posts

I experimented a bit with using the terrain blending system for rendering fog-of-war, which looks like this (though it's a hacky prototype so I won't commit the code). It's very reminiscent of AoK's fog, and more stylised/cartoonish than the AoM/AoE3 wide blur. (We could use more or less blurry blend textures easily, but it'll still be strongly tile-based.)

Is this a good artistic approach, or a terrible one?

Link to comment
Share on other sites

  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

I do prefer the look of your new experimental fog, much better in my opinion. I don't like to FOW in the current build, in some directions the huge spiky pixels look ugly, but it does serve it's purpose so can't really complain.

Is it possible to have 2 different FOW options? Users with low-end systems could switch from the default FOW (possibly wide blur), to a less system intensive option like the one you just posted.

Link to comment
Share on other sites

(as long as it's not too much work)

The code I used for that screenshot is awfully inefficient and slightly broken so it'd need to be entirely redesigned, and that would probably be about as much work as doing the AoE3-style blur, so in that case it sounds like it'd be better to just implement the blur instead. (I'm assuming the blur basically consists of a map-sized dynamically-generated greyscale texture that's stuck on top of the terrain, since that sounds like it'd work and I don't know how else it could be done.)

Link to comment
Share on other sites

I tried a blur. Does that look like what people want? (Should it be more/less blurry? Darker/lighter shade for the previously-explored areas?)

(This is done by creating a bitmap with one pixel per map tile, then doing a single 5x5 box blur on it, then uploading as a GL texture, then multiplying the terrain by that texture. My current implementation is inefficient and buggy and needs to be rewritten but the basic idea seems to work.)

Link to comment
Share on other sites

First when I looked at the picture I thought I was still in the Normal/Spec mapping thread and thought you'd implemented a version of Bloom. I was not impressed. Then I realized it was the Fog-of-war thread and was amazed :) Great work Philip, if you can get it quick enough this definitely seems like it's the way to go. (It even almost feels like this and the texture bug fix are enough to create a new release, but they're probably not big enough features for most people to care about. On the other hand, if we wait until we have AI before making the release they will probably not get noticed =) They're perfect for small news updates though, so I think that's the way to go. Alpha 4 waits for AI imho.)

Link to comment
Share on other sites

The most annoying thing about implementing this fog is that one part of it wants the graphics hardware/drivers to support 3 texture units, and OpenGL only guarantees 2. Currently our rendering code only requires 2 (it can make use of 3 or 4 but has fallbacks). In practice, I've only seen really ancient devices with 2 (except some modern mobile ones but they only support OpenGL ES so they won't work anyway) - it looks like GeForce4 MX has 2; GeForce 3 / 4 Ti has 4; Radeon 7500 has 3; Intel GMA 900 has 8; etc. This page indicates similar numbers.

It wouldn't be particularly complex to continue supporting 2-TU hardware in this case - it just needs an extra render pass, but that'll make it even slower (and these are presumably extremely old devices), and it's another codepath to test and maintain. And actually this case is only when shadows are enabled, which are going to be terribly slow on old hardware anyway. So I think we should say that if you only have 2 texture units then you have to disable shadows - that'll simplify the code a bit and it shouldn't affect any real users.

Link to comment
Share on other sites

When you look closely it still is a bit edgy below the blur. But a massive improvement nonetheless.
I think it can never be perfectly smooth, since the input data is limited to one value per tile (since that's what the visibility computations provide). That's converted a texture with one pixel per tile, then blurred - I suppose it'd be technically possible to use a higher-resolution texture so the blurring can partially mask the tile edges but that sounds like a significant extra cost for little benefit (since the texture can already be 512x512). And I think AoE3 has exactly the same edgy behaviour, and nobody seems to mind their fog :P
Well about the old computers hardware issues, I guess that's why the Minimium Requeriments for the game play are there for...sometimes a game will just not play into an specific hardware (It already has happened to me...)
Yeah, I just don't really like telling people they can't play our game (y). Our stated minimum requirements are GeForce 3, and have been since about 2003, which is already very low (and prevents us from e.g. relying on shaders) - but someone over here had a Radeon 7500 which is lower than that, so it seems there's still some practical value in continuing support. But disabling shadows in those cases seems fine, and means there's no longer a problem.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share


×
×
  • Create New...