Search Unity

Tasharen Fog of War

Discussion in 'Assets and Asset Store' started by ArenMook, Aug 8, 2012.

  1. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    fowandborders.jpg Have to say, this Fog Of War By Tasharen works just fine. I hope, it works with WP8 too, when I have enough time to test my work with phone. It's a waiting state, since EasyRoads3D doesn't work with WP8 yet :-( But...

    FOW + My own border system = Settlers 4 style again :)

    Oops. Should adjust pole sizes for this picture, but...
     
  2. directedchaos

    directedchaos

    Joined:
    Dec 22, 2012
    Posts:
    14
    It's a great effect, and using the provided shaders (terrain and diffuse) I got a simple scene running seemingly without a framerate hit on an iPhone 5. Awesome! Notes for anyone trying:
    • You have to go to Terrain Settings (the gear): Screen Shot 2015-06-20 at 8.03.39 PM.png and set the Material to a material that uses the shader Fog of War/Terrain: Screen Shot 2015-06-20 at 8.03.47 PM.png
    • Only seems to support 4 textures on a terrain. Textures after that were always full brightness.
    • You have to set the shader for anything with Diffuse shaders that you want to have this effect to Fog of War/Diffuse
    • Memory might become an issue. In Profiler I saw like a 50** mb increase, with world size 256 and Texture size 128. ** that's NOT on device, I'm not to the stage of intensive performance optimization. I probably will experiment more and learn some more details.

    Using those shaders was a bit of a breakthrough for me. I had tried this a few times a while ago, but largely given up (I know mobile isn't the target). Using the effect on the camera showed cool results, but really hit the framerate hard on mobile. I know very little about shaders, but tried some of the earlier hacks in this thread, probably incorrectly because they didn't work. I finally tried again and got a bit smarter this time and was about to try Jashengmato's when I stumbled into the provided shaders under Fog of War/Examples/Materials.

    I hope that helps some others. I have two main questions:
    1. Even if it's not officially supported for mobile, can you include more shaders? Or can anyone else post ones they got working for other types of shaders? In particular I'm trying to get Transparent/Diffuse/Cutout to work sampling the Fog of War.
    2. Is the memory footprint just based on the world size and texture size (not related to what uses the shaders)?

    Thanks!
     
  3. fudingyu

    fudingyu

    Joined:
    Nov 13, 2013
    Posts:
    8
    On Qualcomm GPU is perfect!

    But while Mali/PowerVR GPU like below picture






    Caused of depth texture? some GPU not support depth texture? or not support 24 bit depth buffer only run 16 bit?