Author Topic: Tasharen Fog of War  (Read 151448 times)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tasharen Fog of War
« Reply #90 on: April 11, 2014, 08:21:05 AM »
What are A and B? If they are different players who each have their own fog of war system then not necessarily. It depends on the height of the objects and the height at which the revealer is located.

BuddyBoy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Tasharen Fog of War
« Reply #91 on: April 13, 2014, 01:41:55 PM »
Hi There.

Love this asset. I purchased it last year before Unity 4.3

I am now working on a 2D game and I want to use this but the x/y axis is not supported.

Please can you explain each file to modify and what to change to use the 4.3 2D x-y. I saw somebody else asked this but I was a little lost.

Thanks.

capitalj

  • Jr. Member
  • **
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 88
    • View Profile
Re: Tasharen Fog of War
« Reply #92 on: April 16, 2014, 03:36:31 PM »
2. When using the Image Effect based approach the skybox is a part of the scene so yes it will be covered by the fog. If you want selective fog of war, you need to use custom shaders on objects as shown in the second example.

Do you think it would be possible to have a 2nd camera that only renders the skybox and still use the Image Effect approach and not have the skybox affected by the FOW effect?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tasharen Fog of War
« Reply #93 on: April 17, 2014, 02:07:53 PM »
You mean render the skybox after the scene? That would be... odd, and I can think of some issues to go along with it. You could likely use the stencil buffer to mark parts of the screen to be eligible for FOW or not, but again -- it would involve a custom shader on at least one of your object (skybox). And modifying the image effect to use the stencil buffer, of course.

capitalj

  • Jr. Member
  • **
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 88
    • View Profile
Re: Tasharen Fog of War
« Reply #94 on: April 17, 2014, 07:31:18 PM »
Or an even easier solution is to just turn off the FOW image effect whenever I switch to the viewpoint that shows the skybox (where the blocked areas aren't visible anyways). :)

konsnos

  • Newbie
  • *
  • Thank You
  • -Given: 8
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: Tasharen Fog of War
« Reply #95 on: April 22, 2014, 06:25:45 AM »
A small bug report. I have in my project NGUI and just added the FOW. FOW package asked to import file BetterList.cs which I assume is a previous version of the same file NGUI has. It creates a problem with the Pop function not being available if replaced.

Edit: One more thing.

  • Add FOWEffect script to your Main Camera. Make sure it references the "Image Effects/Fog of War" shader.

In the package I bought this must be FOWImage Effect? That's what it worked for me.
« Last Edit: April 22, 2014, 06:35:48 AM by konsnos »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tasharen Fog of War
« Reply #96 on: April 23, 2014, 08:00:21 AM »
Right you are, sounds like I need to update the text.

Chairwalker

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Tasharen Fog of War
« Reply #97 on: April 24, 2014, 07:51:37 AM »
Hello, i've been trying to use this FOW on a scene with rooms in a grid-like fashion
and noticed that the walls facing south or west never fully appeared.
To ensure this wasn't caused by any misalignment on my part and to better illustrate the problem i've created a fresh project with only the FOW asset imported,
loaded the example scene that uses the shader approach and changed it into a 30/30 grid with a revealer in the center and four 2/2/3 cubes with colliders placed around it:




Ingame the scene looks like this:



I could 'fix' this by scaling down the colliders to hide the offset within the walls but this won't help with doorways etc.
Anything i'm missing in properly alligning the FOW to the grid?  or is this caused by some parameter in the script that i've overlooked?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tasharen Fog of War
« Reply #98 on: April 25, 2014, 10:45:09 AM »
You are trying to mix meshes which are based on vertices, and textures which are based on pixels.

Think about it. If you put down a 2x2 texture over a simple quad (which is also 2x2 vertices)... where do the pixels lie?

Answer: the "center" of pixels will be 25% from the edge of the quad -- or half a pixel.

This is also the reason why when you create a Terrain in Unity, you can't specify a 512x512 texture to be the heightmap. It forces it to be 513x513 -- in other words one extra pixel is needed.

Another rule of this conversion: in order to draw a single quad you need 4 vertices (2x2). You can have a 1x1 texture on it, but you can't draw it using 1 vertex, can you? Thus the +1.

Chairwalker

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Tasharen Fog of War
« Reply #99 on: April 25, 2014, 11:47:17 AM »
Thank you for that in-depth explanation, it all makes perfect sense now. :)

capitalj

  • Jr. Member
  • **
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 88
    • View Profile
Re: Tasharen Fog of War
« Reply #100 on: May 07, 2014, 10:40:28 PM »
Hi, has anyone had luck getting FOW to work on iOS using the shader based approach? The Image Effect works fine, although a bit processor intensive, so I'm trying to see if I can use the shader approach but when I switch the project over to iOS the FOW doesn't show up, even in the demo scene.

I've tried in a brand new project as well and switching to iOS platform seems to disable the fog itself, but objects still appear/disappear as if the fog was there.

capitalj

  • Jr. Member
  • **
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 88
    • View Profile
Re: Tasharen Fog of War
« Reply #101 on: May 18, 2014, 05:26:52 PM »
Bump.. anyone has any iOS experience with the FOW plugin?

z78

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Tasharen Fog of War
« Reply #102 on: June 20, 2014, 10:00:53 AM »
I recently bought this asset from the asset store and I can't get it to work at all; I was hoping you could help me with that.

I followed the three steps on the start of this thread, and I get nothing; after trying a few things, a closely following the Asset's script, I noticed the FOWImageEffect Script that is attached to my main camera disables itself on Game Start, and the first time I tried to enable it in runtime I got the following error:

unity can't use image filters (npot-RT are not supported or RT are disabled completely)

does this Asset need Unity Pro ti work with?, I there anything else I need to do apart from the 3 steps you detailed?

I would be really grateful if you can help with this issue   

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tasharen Fog of War
« Reply #103 on: June 22, 2014, 09:12:26 PM »
Please stick to one means of contacting me. Forum post, private message and email of the same thing is overkill.

As I explained in the email, image effect-based approach requires Unity Pro. Shader-based approach (second example) will work in Unity Free.

capitalj

  • Jr. Member
  • **
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 88
    • View Profile
Re: Tasharen Fog of War
« Reply #104 on: July 08, 2014, 01:33:46 AM »
Hi, I am trying to use the FOW image effect on Android builds but it doesn't seem to show up. On iOS/Standalone the image effect based approach works fine, but on Android it just doesn't appear. Anything I should be doing different on Android or any special settings? I am using a Nexus 7 (2012) tablet.