In prep for a challenge (small game jam) coming up, I’m shaking off the rust and came up with a puzzle.
How to make fog of war selectively part for enemy units.
It means getting the world coordinates of each of those units into a material, which … for the life of me seems like it should be simpler, but all I can come up with is using a series of material scalar parameters. (collection)
But seeing it, makes me cringe. This can’t be the best way to do this.
The spheres are all added to create a map in worldspace where light can exist.
They are collectively the lerp between PostProcessInput0 and 0
The area near the center (camp) is exposed by a large sphere of its own, and a few fixed-location items are given some light-able space.
I need a way to get the world location of enemies in the fog and feed it to the material to allow them to be seen as well.
But this is the only way I’ve found to move that data into the material.
Yeah, I need to learn Niagara, but I’ve been putting it off.
Parameter Collection is what I’m doing. Scalar, since the vectors are positive values only.
.
Now that I think of it… I could be sneaking negatives in by bumping the x and y by 10k each then reducing it by that much inside the material… that would reduce the number of nodes significantly.