Skip to content

Latest commit

 

History

History
51 lines (28 loc) · 2.14 KB

README.md

File metadata and controls

51 lines (28 loc) · 2.14 KB

Fog Of War - Unity

Status License


📝 Table of Contents

About

I recently came up with a game idea in which fog of war will play a huge role, but was unable to find proper implementation, i tried to gather as much information as possible, that i found and made a cheap example of it, which you will be able to play along with, learning what lays under the hood.

🎥 Video

Unity_gKzm4IzFxf.mp4

What is Fog Of War?

Fog of war is a term that refers to describe the uncertainty in situation awareness experienced for militars in military operations. However, in video games, the fog of war reffers to giving the player partial information of a certain area, which makes the player re-think the strategy of the gameplay taking in account the leaking information.

How does this work?

FogOfWar.cs includes all mechanism to use fog in this particular project. It raycasts the obstacles and renders vertexes by the radiant angle which means each line that touches the obstacles does not go through therefore it creates triangular meshes. StencilShader.shader creates a layermask for actual scene and makes scene objects invisible. Once we play the scene objects with stencil are rendered properly.

Notes

  • URP not compatible now
  • Download additional standart fps controller package

✍️ Contact

See also the list of contributors who participated in this project.