# \[TUTORIAL\] Fog Of War

**URL:** <https://forums.unrealengine.com/t/tutorial-fog-of-war/18222>\
**Category:** World Creation\
**Tags:** unreal-engine\
**Created:** [January 3, 2015, 8:44pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222 "2015-01-03T20:44:57Z")\
**Posts on this page:** 19\
**Page:** 9

<div class="post-metadata">

**Author:** ![anonymous\_user\_9257d68e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9257d68e](https://forums.unrealengine.com/u/anonymous_user_9257d68e)\
**Post date:** [October 1, 2019, 12:46pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/164 "2019-10-01T12:46:59Z")

</div>

For me it worked at UE4 22.3 the shared fork from Juancahf.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4e5107b0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4e5107b0](https://forums.unrealengine.com/u/anonymous_user_4e5107b0)\
**Post date:** [April 3, 2020, 8:10am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/165 "2020-04-03T08:10:01Z")

</div>

Is it possible to do this or similar in BPs?? No matter how much I try, I don’t fully understand code. And having a piece of my game that I don’t fully understand how it works is something I cannot live with.

---

<div class="post-metadata">

**Author:** ![Freeman1852](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Freeman1852](https://forums.unrealengine.com/u/Freeman1852)\
**Post date:** [May 3, 2020, 2:42pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/166 "2020-05-03T14:42:44Z")

</div>

How to check in this case is point is covered by fog?

---

<div class="post-metadata">

**Author:** ![KelbyVP](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kelbyvp/32/261024_2.png) [@KelbyVP](https://forums.unrealengine.com/u/KelbyVP)\
**Post date:** [May 10, 2020, 12:08am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/167 "2020-05-10T00:08:24Z")

</div>

Huge thanks to for this wonderful tutorial!

Is it OK to use it in our projects as is? If not, that’s cool, I’ll write my own based on the concepts here, but I’ve already tested this in a demo project and it works very nicely as written! I don’t want to step on anyone’s toes in terms of copyright, etc.

---

<div class="post-metadata">

**Author:** ![KelbyVP](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kelbyvp/32/261024_2.png) [@KelbyVP](https://forums.unrealengine.com/u/KelbyVP)\
**Post date:** [May 10, 2020, 1:28am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/168 "2020-05-10T01:28:04Z")

</div>

Question:

In the FogOfWarManager.cpp file, in the definition of the method UpdateTextureRegions, we call the macro ENQUEUE\_UNIQUE\_RENDER\_COMMAND\_TWOPARAMETER with the first parameter being “UpdateTextureRegionsData”. That doesn’t seem to be declared/defined anywhere. What is that?

---

<div class="post-metadata">

**Author:** ![KelbyVP](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kelbyvp/32/261024_2.png) [@KelbyVP](https://forums.unrealengine.com/u/KelbyVP)\
**Post date:** [May 15, 2020, 11:01am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/169 "2020-05-15T11:01:52Z")

</div>

> [@KelbyVP](#):
>
> Question:
> 
> In the FogOfWarManager.cpp file, in the definition of the method UpdateTextureRegions, we call the macro ENQUEUE\_UNIQUE\_RENDER\_COMMAND\_TWOPARAMETER with the first parameter being “UpdateTextureRegionsData”. That doesn’t seem to be declared/defined anywhere. What is that?

For anyone looking at this part of the code, the macro ENQUEUE\_UNIQUE\_RENDER\_COMMAND\_TWOPARAMETER is deprecated in 4.23. Use the following instead:

ENQUEUE\_RENDER\_COMMAND(FUpdateTextureRegionsData)(  
[RegionData = RegionData, bFreeData = bFreeData](FRHICommandListImmediate& RHICmdList)

{  
for (uint32 RegionIndex = 0; RegionIndex \< RegionData-\>NumRegions; ++RegionIndex)  
{  
int32 CurrentFirstMip = RegionData-\>Texture2DResource-\>GetCurrentFirstMip();  
if (RegionData-\>MipIndex \>= CurrentFirstMip)  
{  
RHIUpdateTexture2D(  
RegionData-\>Texture2DResource-\>GetTexture2DRHI(),  
RegionData-\>MipIndex - CurrentFirstMip,  
RegionData-\>Regions[RegionIndex],  
RegionData-\>SrcPitch,  
RegionData-\>SrcData

- RegionData-\>Regions[RegionIndex].SrcY \* RegionData-\>SrcPitch
- RegionData-\>Regions[RegionIndex].SrcX \* RegionData-\>SrcBpp  
);  
}  
}  
if (bFreeData)  
{  
FMemory::Free(RegionData-\>Regions);  
FMemory::Free(RegionData-\>SrcData);  
}  
delete RegionData;  
});

---

<div class="post-metadata">

**Author:** ![Neongho](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Neongho](https://forums.unrealengine.com/u/Neongho)\
**Post date:** [May 20, 2020, 7:51pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/170 "2020-05-20T19:51:42Z")

</div>

Nice tutorial added to favorites very interesting,

---

<div class="post-metadata">

**Author:** ![KineticKronos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KineticKronos](https://forums.unrealengine.com/u/KineticKronos)\
**Post date:** [October 4, 2020, 7:05am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/171 "2020-10-04T07:05:19Z")

</div>

Anyone have an updated link to the project files? The one @Juancahf posted is sadly dead

---

<div class="post-metadata">

**Author:** ![Juancahf](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/juancahf/32/899144_2.png) [@Juancahf](https://forums.unrealengine.com/u/Juancahf)\
**Post date:** [October 8, 2020, 8:23pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/172 "2020-10-08T20:23:49Z")

</div>

A long time ago, the tutorial on this thread helped me to get started prototyping in unreal engine. Probably not the easiest project to learn how the engine works, but it was really fun to make the entire thing work and to learn different ways of doing the same thing. Realizing that there is still people interested in the project I am thinking that it could be nice to post my work so I can help others in the same way the author of this thread did.

I don’t want to hijack this thread so I will be making a new one with my solution. My idea is to write a tutorial covering the basics, explaining how it works and the logic behind the many moving parts of the project. I will start the tutorial this weekend and over the course of the following month I will finish the thing.

The idea would be to have something like this:

https://player.vimeo.com/video/428789259

[EDIT]  
I am also posting the old links to the projects:  
[FOW](https://drive.google.com/file/d/0B5CPaFTwK7YFMmtkQTRDNzZMZTg/view?usp=sharing) and [FOWFork](https://drive.google.com/file/d/0B5CPaFTwK7YFWHdVeV9UZ2dEVzA/view?usp=sharing)  
But getting them to run is a real pain.

---

<div class="post-metadata">

**Author:** ![NorthWeapon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NorthWeapon](https://forums.unrealengine.com/u/NorthWeapon)\
**Post date:** [December 10, 2020, 1:54am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/173 "2020-12-10T01:54:49Z")

</div>

I got it working for UE4 4.26 and I uploaded this on GitHub @\*\* \*\*if you don’t mind since people were asking for updated project links and this is breaking. Everyone, please contribute to the project if you can.

> **[GitHub - SyedAman/IsvulfesFogOfWarUE4](https://github.com/SyedAman/IsvulfesFogOfWarUE4)**
>
> Contribute to SyedAman/IsvulfesFogOfWarUE4 development by creating an account on GitHub.

You can download it here and contribute ^

---

<div class="post-metadata">

**Author:** ![HashemShepard](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hashemshepard/32/1201564_2.png) [@HashemShepard](https://forums.unrealengine.com/u/HashemShepard)\
**Post date:** [January 12, 2021, 2:47pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/174 "2021-01-12T14:47:14Z")

</div>

anyone found anything to make this work in multiplayer ?

---

<div class="post-metadata">

**Author:** ![HashemShepard](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hashemshepard/32/1201564_2.png) [@HashemShepard](https://forums.unrealengine.com/u/HashemShepard)\
**Post date:** [January 12, 2021, 4:22pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/175 "2021-01-12T16:22:59Z")

</div>

> [@NorthWeapon\_Syed](#):
>
> I got it working for UE4 4.26 and I uploaded this on GitHub @\*\* \*\*if you don’t mind since people were asking for updated project links and this is breaking. Everyone, please contribute to the project if you can.
> 
> [GitHub - SyedAman/IsvulfesFogOfWarUE5: Fog of War Plugin made by Isvulfe](https://github.com/SyedAman/IsvulfesFogOfWarUE4)
> 
> You can download it here and contribute ^

can you upload a 4.25 version ? the 4.26 wont load correctly

---

<div class="post-metadata">

**Author:** ![steelerize](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@steelerize](https://forums.unrealengine.com/u/steelerize)\
**Post date:** [January 12, 2021, 8:52pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/176 "2021-01-12T20:52:39Z")

</div>

I’m having random flickering lights with 4.26 version, anyone else experiencing it?

---

<div class="post-metadata">

**Author:** ![KelbyVP](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kelbyvp/32/261024_2.png) [@KelbyVP](https://forums.unrealengine.com/u/KelbyVP)\
**Post date:** [February 16, 2021, 12:18am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/177 "2021-02-16T00:18:15Z")

</div>

> [@steelerize](#):
>
> I’m having random flickering lights with 4.26 version, anyone else experiencing it?

Yes, I’m having the same problem. Anyone find a fix?

---

<div class="post-metadata">

**Author:** ![Avelir](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Avelir](https://forums.unrealengine.com/u/Avelir)\
**Post date:** [March 19, 2021, 4:20pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/178 "2021-03-19T16:20:33Z")

</div>

Hi there!  
First of all - many thanks for the solution!  
Can anyone explain how can I extend the map size for FOW ? I’ve tried to use it on a small map and faced only with the crash problem which I’ve fixed in C++, but when I switch to a huge map I’ve found some border with the effect on them from actor which reveals fog looks like an overflow…

---

<div class="post-metadata">

**Author:** ![zimzimdz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zimzimdz](https://forums.unrealengine.com/u/zimzimdz)\
**Post date:** [January 18, 2022, 4:16pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/179 "2022-01-18T16:16:43Z")

</div>

Did you guys find a fix ?

---

<div class="post-metadata">

**Author:** ![KelbyVP](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kelbyvp/32/261024_2.png) [@KelbyVP](https://forums.unrealengine.com/u/KelbyVP)\
**Post date:** [January 19, 2022, 2:15am UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/180 "2022-01-19T02:15:06Z")

</div>

My fix was to switch to the Journeyman’s MiniMaps plugin. 😉

---

<div class="post-metadata">

**Author:** ![dchu58](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dchu58](https://forums.unrealengine.com/u/dchu58)\
**Post date:** [February 7, 2022, 6:44pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/181 "2022-02-07T18:44:03Z")

</div>

Hey all, just wanted to say thanks, this thing works great. I’ve got the 4.26 version noted above working well in 4.27 with just a few edits to the #include statements needed.

---

<div class="post-metadata">

**Author:** ![SkyeEden](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/skyeeden/32/1116094_2.png) [@SkyeEden](https://forums.unrealengine.com/u/SkyeEden)\
**Post date:** [March 16, 2022, 12:34pm UTC](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222/182 "2022-03-16T12:34:06Z")

</div>



[Previous page](https://forums.unrealengine.com/t/tutorial-fog-of-war/18222.md?page=8)
