Debugging
Pixel-Perfect Fog Of War includes built-in debug visualization and a few common fixes.
Revealer Debug Visualization
Enable Debug Mode on a Revealer 3D / 2D to draw its line-of-sight calculation in the scene view. Additional toggles let you isolate each stage:
| Toggle | Draws |
|---|---|
| Draw Initial Rays | The first pass of raycasts. |
| Draw Expected Next Points | The predicted next point for each ray. |
| Draw Iterative Rays | The extra refinement rays around edges. |
| Draw Edge Resolve Rays | The binary-search rays used to pin down obstacle edges. |
| Draw Extra Cast Lines | All additional cast lines. |
| Draw Hider Samples | The visibility samples taken against hiders. |
| Debug Log Hider Blocker Name | Logs the name of whatever blocked a hider sample. |
The sight segments drawn in debug mode also help you size Max Possible Segments Per Revealer on the Fog Of War World.
Common Issues
My revealer misses some edges
Increase the number of refinement iterations: set Occlusion Quality to Custom and raise Num Extra Iterations. See Occlusion Quality.
"Sight Segment buffer is full" error
A revealer produced more segments than allowed. Increase Max Possible Segments Per Revealer on the Fog Of War World.
Errors mentioning Max Possible Revealers / Hiders
You exceeded the pre-sized buffers. Raise Max Possible Revealers or Max Possible Hiders on the Fog Of War World.
Fog isn't rendering (older Unity versions)
On some older Unity versions, shader keyword variants may not be picked up automatically. If fog fails to render, copy the #pragma multi_compile_local lines from FogOfWarLogic.hlsl into your Fog Of War fog shader, below the #include "FogOfWarLogic.hlsl" line.
Note
This workaround predates the current merged-shader setup. If you hit a rendering issue on an older Unity version, reach out on the Discord and we'll help confirm the right fix for your version.
Nothing reveals at all
- Confirm there is exactly one Fog Of War World in the scene.
- Confirm the fog effect is hooked into your render pipeline. See Render Pipeline Setup.
- Confirm your Obstacle Mask and revealer View Radius are set sensibly.
Still Stuck?
Join the Discord for help.