fog of war

Everything related to the code /
Tout ce qui touche au code
Post Reply
kap
Posts: 2
Joined: Wed Nov 01, 2006 11:27 pm

fog of war

Post by kap » Wed Nov 01, 2006 11:31 pm

just a technical question, i see that you use fog of war in your game, i've been looking every where for an answer to how is fog of war done in 3d?

would really appreciate if you could help me, thx.

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Thu Nov 02, 2006 12:25 am

TA3D's fog of war is simple:
there are 3 sort of zones:
_not discovered, map is rendered in black, no units, no features
_discovered but not seen by any unit, map in gray, no units, features in gray
_seen by at least one unit, map with normal colors, units and features are drawn

Here the principle is basic:
an array stores which zone has been discovered, and how long it has not been seen by a unit. every 0.2 sec this array is updated.
=>;-D Penguin Powered

kap
Posts: 2
Joined: Wed Nov 01, 2006 11:27 pm

Post by kap » Thu Nov 02, 2006 1:07 am

thx for your reply, how are you actually drawing the fog?
are you using a shader or some other method?

thanks

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Thu Nov 02, 2006 10:03 am

There are two type of fog:
_the fog of war which is drawn using a color array (black, gray, white)
_the fog that fade the map in distance (classical fog)
=>;-D Penguin Powered

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests