Fog of War
Fog of War
Is there a simple way to do selective fog of war? Say that I have user controlled ships, planets, and stars. Is it possible for me to make only the ships vanish when outside of the given sensor range?
You can make like this:
Each unit you have has an light scene node attached to it (you can also make only one light, depending on the camera position). If enemy units are inside the range of that light, the they're visible, if not, fog of war wont let you see your enemy nodes....
You may have some bugs regarding this technique if you use something like setVisible, try to update the position of your enemy nodes independently of the node(mesh) itself (sorry, realy dont know how to put this in a better phrase).
Anyways....try it!
Each unit you have has an light scene node attached to it (you can also make only one light, depending on the camera position). If enemy units are inside the range of that light, the they're visible, if not, fog of war wont let you see your enemy nodes....
You may have some bugs regarding this technique if you use something like setVisible, try to update the position of your enemy nodes independently of the node(mesh) itself (sorry, realy dont know how to put this in a better phrase).
Anyways....try it!