Jump to content

Fog rendering


Recommended Posts

  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

I just playtested with the new fog, and I think it actually looks BETTER than AOE3's FOW.
Hmm, I don't think that should be possible :P. It should be doing pretty much exactly what AoE3 does.
And you thought it would be hard to do. (y)
It was (though not hugely) :P. I still don't really like doing graphics work, but I suppose I understand it a little better now.
I noticed a problem, however, at the bottom of Miletus (I am on 8885):
Yeah, our handling of map edges still isn't ideal. I could just add a big black vertical rectangle covering each side of the map from the water plane down to the bottom of the terrain, to quickly fix this bug, so I'll probably do that. (We've discussed better ways to handle edges but I don't want to bother with that yet.)
Link to comment
Share on other sites

I could just add a big black vertical rectangle covering each side of the map from the water plane down to the bottom of the terrain, to quickly fix this bug, so I'll probably do that.
Done that. (Actually made it a bit more complex - the solid black sides hang down from the terrain (or the water if it's higher), so you should never be able to see anything through the edge. With this it'd be easy to do AoM-style terrain where there's a visible rocky texture all around the outside of the map, but that doesn't make sense for circular maps and I think I prefer the fade-to-black-at-edge look.)
Link to comment
Share on other sites

Very nice! (y)

This is done by creating a bitmap with one pixel per map tile, then doing a single 5x5 box blur on it

May I suggest a better smoothing kernel, though? A box filter is really bad. Since you're already separating the kernel, we can get a cheap but decent integral approximation of a Gaussian via binomial filter. Given your 5 taps, the coefficients are 1,4,6,4,1, which sum up to 16 and therefore don't require conversion to floating-point nor division.

I agree about not going through gyrations to support 2 TMUs, and disabling shadows sounds like a good compromise.

Link to comment
Share on other sites

Seems that if you try to place a foundation in FoW, it will be highlighted in red. It stays red even when some units arrive in the area. Any movement of the foundation placeholder once the FoW is cleared by arriving units will remove the red. However, you can still build it even while it is red colored as long as it is not covered by the FoW. I think it should turn back to the normal color as soon as the FoW is cleared though.

Link to comment
Share on other sites

How should buildings on the edge of fog be rendered? (Especially when we have giant ones like the pyramids.)

If I remember correctly, the AoM/AoE3 approach is that the building pops into visibility once its central point is out of the fog, and maybe(?) it changes all the terrain directly under the building to be visible. An alternative is to do something like this (the building on the left) - apply the fog texture to the buildings, exactly like how it's applied to the terrain. Probably the building would always get rendered, initially in pure black (so you could only see it where its silhouette covers a visible area) and then gradually becoming fully lit as you approach it. (You won't be able to select the building, or see dynamic changes to it, if it's still in the fog - it'll only be interactive once it's at least partially in a visible region.)

I think that looks nicer, but I don't know if there's subtle gameplay/artistic problems with it. Are there other games that do something like this? If not, why not? (The implementation in our engine is tedious (since there's like a dozen different model-rendering modes - I've just hacked it into one for now) but not particularly complex, and it shouldn't affect performance significantly.)

Link to comment
Share on other sites

I too like the blending. It should be much less jarring than suddenly popping the whole building into

full visibility.

AoK was a software renderer, and they need to keep runtime decisions to an absolute minimum, so it may just have carried over to AoM/AoE3 out of habit. They also didn't have as much variation in building sizes.

I don't see any gameplay problems (maybe even less, because a combination of huge buildings and small visibility might mean the center of buildings are never exposed).

Link to comment
Share on other sites

Looks good, and as long as it doesn't hurt performance I really think showing the building gradually would be a lot nicer.

Would the "color buildings black in FOW/SOD" make them look something like the units/buildings in this screeshot: http://www.wildfiregames.com/forum/index.p...pe=post&id=2573 (minus the distance fog)? In that case I'm not too fond of it =)

Link to comment
Share on other sites

The second way is definitely nicer. It probably wouldn't be too hard to switch back to the old "AOM" way if it turns out to be a problem, would it?

It'd be kind of irritating to do the work for the new rendering approach and then switch back to the old way, but it'd be trivial to actually do the switch.

Would the "color buildings black in FOW/SOD" make them look something like the units/buildings in this screeshot: http://www.wildfiregames.com/forum/index.p...pe=post&id=2573 (minus the distance fog)? In that case I'm not too fond of it =)

Without the distance fog they'll just be black on black, so you wouldn't see them at all. If we added distance fog then we'd probably multiply the distance fog colour by the visibility fog texture so it'd still be black on black.

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...