Implementing Fog of War in Away3D

Software: Away3D 4.x

SirGordon, Newbie
Posted: 20 June 2014 10:52 AM   Total Posts: 29

Hello, Community!
I’m making a strategy game using Away3D and the last feature left to implement is fog of war.

I have a logical map of visibility - what areas player can see, and what areas are covered by fog.
I can ofcourse set visible=false on units under fog.

The question is - how can i visualize the fog of war?
Id like it to appear, for example, as in Warcraft 3

For me this looks like something on the shader level.
I guess i need to somehow pass some parameter to the shader and render with lowered brightness..
How do I do this?

P.S.: If there would be a good answer, this article may be very useful for people who use Away3D in their projects!

   

SirGordon, Newbie
Posted: 23 June 2014 08:55 AM   Total Posts: 29   [ # 1 ]

I have thought on two ways of solving this (excluding programming on shader level):
1. Huge projected texture on the whole map. This would be probably very slow, because the texture will be created every time using CPU and there is upload texture bottleneck.
2. For every tile, covered by fog, create a transparent black Plane and make it have z-index closest to the camera.

Any ideas which way will be better? Or should I try to make it using shader programming?

   
   
‹‹ scale U V not working

X

Away3D Forum

Member Login

Username

Password

Remember_me



X