I need a way to visually represent the places in a map that can be seen from an arbitrary place with a given distance.
I currently have a system that generates these arcs in a straight line, drawing a wedge that covers the view from a position (in this case, a guard tower), at its current height. The code for doing so can be found here: https://paste.mod.gg/wrqtanydrxlt/0
What I need now is the ability to also include angles up and down from horizontal and to indicate anywhere that can be seen in that field of view. The math is actually fairly simple to detect the lines of sight, I'll just take this loop that raycasts in a fan and repeat it at several angle inclinations in either direction, but I don't know how to show the results. Drawing a fan worked here, but this would be a 3D object with potentially awkward geometry. I'm not sure how I would generate a 3D shape that does something similar to this, like how I would gather up all the vertices and wind them into a hull.
The ideal solution would be something like "tint this object a color if it's visible by this spot" but I don't even know how to begin working on that, especially since these objects all have radically different shaders (including MicroSplat whose shader code is so complicated that I'd probably just detonate if I looked at the shader file) and I don't know how I could manage that with any sort of VFX.
The project is in URP, and changing to HDRP for Volumetric Lighting is not an option, which is unfortunate because I think just a bright volumetric from this point would be done and dusted. Is there anything else I could do to potentially leverage the lighting system to do this for me? My options are open, I don't need to work with the system I currently have for drawing the fans, I could can the whole thing if a better solution is available.
A tool for sharing your source code with the world!
