Oct
16
2014

2D Fog Of War

fog_of_war_2D_sprites_unity_1

Got some nice looking Fog of War system working with sprites (2D)!

It might eventually work on mobiles too (although at lower resolution..)

*Will be posting it to asset store hopefully within this month..

** Update 2022: Now after those “few months”, project sources are here https://unitycoder.com/blog/2022/04/25/sources-fog-of-war-effect/

Current features:
– Adjustable showing & hiding fade speeds
– Adjustable view range (circular)
– Optional view cone (with adjustable view angle, so that you see forward only, behind you will be black)
– Works with animated/moving obstacles also
– Possible to have multiple players (each with viewing area)
– Resolution is adjustable (but higher resolution currently starts to slow down, can be optimized..)
– And more..
Webplayer demo:
http://unitycoder.com/upload/demos/2DFogOfWar/  (initial version, quite high resolution, not optimized)

(more images later)


11 Comments + Add Comment

  • Hello, is there any way you add the inversion in the “Normal Map Maker”? Type change where bottom is and where is near, and a preview window also would be a good thing.

    Actually I wanted it to be like a clone of “SmartNormal”, which is an excellent tool, but does not support very large textures.

    http://www.smart-page.net/smartnormal/

    Pay attention on the “Invert Source”, this is what I said, is a very good feature.

    Thank you

    • Yes, that invert should be easy to add, thanks for the tip! (i’ll add to next update)

      Realtime preview would be nice too, added in TODO list.

  • Hello, I sent an email to you, do not know if you have received, I will post here as well.

    Hello, a very useful plugin that missing to the Unity is an “import
    mesh as terrain, export terrain as mesh”, mainly in the COLLADA format
    .dae, has a few scripts to do this, but are incomplete and very
    mediocre, I wanted one that could select the objects to be exported,
    has a free plugin that does this, but does not export the terrain.

    Actually already have one in the Asset Store that does this, but it is
    expensive ($ 30) and I do not know if it’s good.

    You could not develop something similar to what I said, but for $ 10? LOL.

    Thanks.

  • Yes, as I said, I know these scripts, but I want a proper tool for this, and I’m not willing to risk spending $ 30. I think a tool like I said before, for $ 10, would sell well.

    I talked about the .dae format because that obj is outdated, by what I have seen .dae is much better than it. Would be more practical to have support to .dae and also the obj.

    I do not have 3D MAX or other expensive programs.

  • Hi.

    Is your code @ the asset store?

    • not yet..
      i guess i can put the early version here for ~couple usd soon,
      as it would still need plenty of work before asset store..

  • Unity fog of war video tutorial with webplayer demo:
    http://staraban.com/en/unity-fog-of-war-video-tutorial/

  • javascript fog of war:
    http://codepen.io/zyklus/pen/prvnb

  • […] Finally uploaded this old fog of war test project from https://unitycoder.com/blog/2014/10/16/2d-fog-of-war-unity/ […]

Leave a comment

Connect

Twitter View LinkedIn profile Youtube Youtube Join Discord Twitch

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.