Hi friends,
I’m building a grid-based ui system, and I want to block of certain areas of it with a vfx graph.
The area is separated into 9 rectangles, each being unlocked over the course of the game.
I now built a Graph that contains 9 identical subgraphs, one for each of these areas. I can disable them via bool parameters whenever a new area is unlocked.
The subgraph contains a spawner slightly randomized (because all subgraphs seem to share the same rng seed), and 2 particle systems, one for big and one for small dots.
It works, but I have a few concerns with this approach:
-
Using 18 separate particle systems for this feels really heavy, especially since they all do the same thing, just in different positions. A better approach would probably be defining 1 “Polygon Shape” instead of having so many AABoxes. That way I could get away with only 2 particle systems. I don’t know how to do that though haha
-
sometimes small gaps appear within fog. I want to have a black background square that is always present behind each foggy area. Is this possible to design within the VFX Graph or would you rather use a SpriteRenderer for that?
I’m fairly new to VFX Graph, and I feel like I’m not using it optimally, so I’d appreciate any opinion and alternative approaches 
Hello. I hope that I’ve been able to properly understand what you’re trying to achieve.
But if so, you can do everything with only one VFX Graph. Here’s my results and the steps needed

- Spawn X number of particles.
- Create an index that Cycle between 0-8 for your 9 grid cells.
You can easily do this by:
Taking the ParticleId and do a modulo 9:
GridIndex = ParticleId % 9;
- Use this GridIndex value to distribute your particle into a 2D Grid:
- Add to this Position a Random Offset:
- Create a Custom Boolean Attribute and initialize its value to false.
It allows us to hold the value whether particles have been discovered or not:
-
Create a Sphere Property, and bind it to a Scene object by using the VFX property binder.
You might want to reveal the minimap differently. This is just an example, but you can also do conditional logic with the grid index. This depends on your needs.
-
Check is the Fog Particles are inside the Player Sphere Radius and set the Custom Boolean attribute value:
- With the Implicit Aging deactivated, Manually Age your particles based on your Discovered custom attribute.
And voilà. I hope that this will help you to achieve what you’re looking for.
I’m joining a small package with a basic scene and the VFX showed at the top.
Note that this package is compatible with Unity 6 preview and above.
Have a lovely day.
VFXG_FogOfWar.unitypackage (961.8 KB)