So imagine a stereotypical stealth game where the enemies have vision cones projected on the floor, like so:
Top down view of a vision cone being rendered on the floor, taking obstacles into account
I currently have a system that uses A LOT of raycasts to detect what shape the cone should be and then transforms a mesh to take on that shape. However, I was wondering if it’s possible to do this with a shader. It would most likely be better for performance, as I currently see a slight dip in FPS if I have too many of these cones in my scene at the same time.
Regardless of whether you know how to do this (that would be great!), could someone tell me whether they think it’s even possible in the first place? (Preferably with Shader Graph,but I’d settle for a coded shader. ) The main thing I’m unsure about is whether it’s possible to make obstacles cut into the cone. Couldn’t find anything on Google
Thanks!