Fog of War

So I've been having trouble building to android.
First, FogOfWarShader.shader had two subsequent "undeclared identifier" errors while attempting to compile. I fixed them by:

1. since

_CameraWS

was the first identifier in question, I commented out lines 161-166 (I'm not using TEXTUREFOG so my assumption was that this would be ok).

2. then, the same complaint arose about

fogcolor

on line 168. So I commented that out and pasted it to line 178 (just above the

sceneColor

declaration).

After this, the project worked normally in the editor and I was able to build to an android phone BUT, on the phone it appears the be rendering the z-axis flipped. I wasn't able to ascertain if this is related to the "

What's the road map for this asset? Can we expect optimization technique I have suggested before? What about custom fog shader creation? If this is already possible, which shader do I need to take a look at?

Hey man. Been using this asset for a while. I had to create my own fix for the _CameraWS issue ("fix" , I just commented out a bunch of things).

The SetFog(Bounds, byte) function never does 100% hiding in the fog. I'm doing byte with value of 1 or 255 or 100, never works. Do you happen to know how to make it work? Thank you.

I inspect with Debug.Log on that area for Visibility and indeed the fog says something like "0.0295" instead of "1" which is fully fogged, but if I inspect via Debug.Log the "GetFogValue" at the same point, it says 255 or 1 or whatever value I input.

Hey man. Been using this asset for a while. I had to create my own fix for the _CameraWS issue ("fix" , I just commented out a bunch of things).

The SetFog(Bounds, byte) function never does 100% hiding in the fog. I'm doing byte with value of 1 or 255 or 100, never works. Do you happen to know how to make it work? Thank you.

I inspect with Debug.Log on that area for Visibility and indeed the fog says something like "0.0295" instead of "1" which is fully fogged, but if I inspect via Debug.Log the "GetFogValue" at the same point, it says 255 or 1 or whatever value I input.

The FogOfWar component has a bunch of functions in it such as IsInFog() and GetFogValue() that you can use to achieve this. There is also VisibilityOfArea() which does a rectangle. These functions are super fast, so feel free to do many checks per frame!

Click to expand...

When I downloaded the FogOfWar Asset, for some reason the IsInFog() method is not in the FogOfWar.cs and I'm getting errors.

When I downloaded the FogOfWar Asset, for some reason the IsInFog() method is not in the FogOfWar.cs and I'm getting errors.

Do any of you have the code for IsInFog()?

Thanks

Click to expand...

IsInFog() was a bit ambiguous because devs often have different interpretations on how much something should be fogged for something to be "in fog". There instead you can just use the GetFogValue method:byte GetFogValue(Vector3 position)
This returns a byte where 0 is completely unfogged and 255 is fully fogged. So you can do something like this:

Do you have a release planned for this fix? If not, I'd also like to receive the patch! I'll send you an email.

Click to expand...

Sorry for the wait. I am intending to upload the fix for this in the next few days (it could take a few additional days for the asset store to approve it). But feel free to email me if you would like it sooner.

Hey man. Been using this asset for a while. I had to create my own fix for the _CameraWS issue ("fix" , I just commented out a bunch of things).

The SetFog(Bounds, byte) function never does 100% hiding in the fog. I'm doing byte with value of 1 or 255 or 100, never works. Do you happen to know how to make it work? Thank you.

I inspect with Debug.Log on that area for Visibility and indeed the fog says something like "0.0295" instead of "1" which is fully fogged, but if I inspect via Debug.Log the "GetFogValue" at the same point, it says 255 or 1 or whatever value I input.

Hey man. Been using this asset for a while. I had to create my own fix for the _CameraWS issue ("fix" , I just commented out a bunch of things).

Click to expand...

Sorry, I'm not sure how I missed your message, but I'm glad you managed to fix the issue on your own.

The SetFog(Bounds, byte) function never does 100% hiding in the fog. I'm doing byte with value of 1 or 255 or 100, never works. Do you happen to know how to make it work? Thank you.

Click to expand...

SetFog() will set the fog to whatever you want it to, where 0 is not fogged and 255 is fully fogged (you are correct that there is an error in the comments, I will fix this up). What I think what you are seeing is that the fog clears that space, but is then immediately returned to a "partially fogged" state. You can adjust what the partial fog amount is with the Partial Fog Amount slider on the FogOfWar component.
If you want to have it continuously at fully unfogged, you will need to spawn a unit at that spot with the FogOfWarUnit set up the way you want it.

I inspect with Debug.Log on that area for Visibility and indeed the fog says something like "0.0295" instead of "1" which is fully fogged, but if I inspect via Debug.Log the "GetFogValue" at the same point, it says 255 or 1 or whatever value I input.

Click to expand...

This is probably happening because you are checking on the same frame that you set it. I think if you check the next frame (or after the next fog frame, which may be longer than a single unity frame), then you will see what the final display value is.

I have just uploaded FogOfWar 1.17 to the asset store! (it may take a few days for unity to approve)

This is a pretty big update and will break backwards compatibility in order to support HDRP and LWRP as well as the legacy render pipeline. This also does not support HDRP for Unity 2019.1, as unity hasn't made a way to make custom post processing effects with the new volume system. So if you are on HDRP, I'd recommended waiting for 2019.2 which I will be adding support for.

Some migrating will be required for this if you are coming from an older version. If so, check out the migration section in the user guide.

Release notes aren't long for this one, but it's been a lot of work behind the scenes!

Added support for Postprocessing Stack v2!

Split FogOfWarTeam from visual side to make new post processing tech easier to migrate to

It doesn't work after the build, but it works in the editor.
Everything works fine in the editor, but after building, I can't see the fog. I can get the correct value with GetFogValue, the display and hiding of the object also works, but I can't see the fog after the build.
It's same in Samples Scene. I have tried both Unity 2018.3.1f1 and Unity2018.3.6f1.
What should I do?

It doesn't work after the build, but it works in the editor.
Everything works fine in the editor, but after building, I can't see the fog. I can get the correct value with GetFogValue, the display and hiding of the object also works, but I can't see the fog after the build.
It's same in Samples Scene. I have tried both Unity 2018.3.1f1 and Unity2018.3.6f1.
What should I do?

It doesn't work after the build, but it works in the editor.
Everything works fine in the editor, but after building, I can't see the fog. I can get the correct value with GetFogValue, the display and hiding of the object also works, but I can't see the fog after the build.
It's same in Samples Scene. I have tried both Unity 2018.3.1f1 and Unity2018.3.6f1.
What should I do?

Click to expand...

I have a fix for this. If you really need it asap, email me and I'll give you the fix. I am in the process of uploading a hotfix to the asset store.

I'm getting a "flickering" effect where the tile that has the collider on it briefly shades while the character is moving from one tile to another.

This even happens in the demo 2D legacy scene so it's not my project as far as I know.

Go to the far left top corner of the demo map. Move left and right. The left wall briefly shadows in and out while the character is moving even though it never loses line of site. It happens in scene view play mode or a build.

I'm getting a "flickering" effect where the tile that has the collider on it briefly shades while the character is moving from one tile to another.

This even happens in the demo 2D legacy scene so it's not my project as far as I know.

Go to the far left top corner of the demo map. Move left and right. The left wall briefly shadows in and out while the character is moving even though it never loses line of site. It happens in scene view play mode or a build.

Hi, this looks like a great asset. I was wondering if support for HDRP in 2019.1 is planned?

Click to expand...

The HDRP's new post processing system doesn't support custom shaders in 2019.1, which is what FoW is built on. Unity has said that 2019.2 will add custom shader support for HDRP, so I will work to implement it as soon as I can.
Unfortunately, there isn't much else I can do on my end.

Can i get FogOfWarTestGUI.cs ? I cannot find in the package that i downloaded. I nedd it for mini map. Thanks

Click to expand...

The test GUI was removed due to some of the features being incompatible with unity 2019.1, but I am currently working on a new version that demonstrates how to make a minimap. I have attached the old version if you still want to reference it (most of the FogOfWar side of things are still the same). If you need help with anything, don't hesitate to send me an email!

#1: Is this asset a post-process effect, or something I have to add to every single one of my shaders/materials? I'm working on a game with lots of units/characters, so if I have to add this to all of my character's shaders that will be a big task.

#2: Is there a guesstimation on when it might be ready for Unity 2019.2? I read you were planning on working on it, just wanted to make sure.

Hi, I have two questions.
#1: Is this asset a post-process effect, or something I have to add to every single one of my shaders/materials? I'm working on a game with lots of units/characters, so if I have to add this to all of my character's shaders that will be a big task.

Click to expand...

Yes, it uses post processing. There are no other requirements for other shaders that you have in the scene.

#2: Is there a guesstimation on when it might be ready for Unity 2019.2? I read you were planning on working on it, just wanted to make sure.

Click to expand...

FoW should work fine in 2019.2, except for HDRP. HDRP will be coming in the next FoW release (I suspect it'll be in the next few weeks or so).

Unfortunately, it seems like unity still hasn't provided an official API for HDRP post processing in 2019.2, so this will have to wait until 2019.3 (which I suspect will be around November). Sorry to all the HDRP users holding out for this. I will definitely jump onto this as soon as unity releases the API.

Unfortunately, it seems like unity still hasn't provided an official API for HDRP post processing in 2019.2, so this will have to wait until 2019.3 (which I suspect will be around November). Sorry to all the HDRP users holding out for this. I will definitely jump onto this as soon as unity releases the API.

Click to expand...

Oh sad to hear that Yes, I was kind of hoping for it soon. But I am glad you plan on trying to do it when it's possible. HDRP is still hard to work with in a lot of areas, so I know the feeling. Thank you for the information and for keeping us updated.

Oops...

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.