See Facebook for a description of what I mean.
In 2D graphics I would accomplish this using a mask like the first image shown in the link above, but being new to 3D game development, I’m not sure what the correct approach is. The literal 3D equivalent, generating a black mesh for the non-visible area and rendering it to a camera at a lower (higher?) level than the main camera, seems like it would work, but also like it could be very inefficient.
Is there a better way? Perhaps with shaders? I don’t need it all spelled out for me, just a rough description of the approach and the tools involved.
Edit: I should add, that as a hobbyist Unity Pro is currently not in my price range, so I’m looking for solutions that do not involve RenderTextures or other Pro-only features.
Actually, if you look at the following post you’ll see the Monaco line-of-sight algorithm explained better : Facebook (the one you linked is more about lighting)
It’s not a straightforward implementation, but I don’t see why you couldn’t use this approach in Unity Free without technical issues - it doesn’t require rendertextures, full screen effects or any other Pro features - it’s all just done in code based on the scene geometry.
I’m a bit unclear whether you want to calculate genuine 3D LoS (i.e. a 3D viewshed from a given position), or if you want to just create the top-down view of a 3D scene with areas lit based on whether they have unobstructed view to the point in the given 2d plane?
If you just want to create a graphical effect (and if you had Unity Pro), you could just place a strong light at the observer’s location and let Unity calculate shadows for those obstructed areas. You could use a custom shader to modify the appearance of those areas in shade. However, this would require Unity Pro, and also this won’t you help you if you want to apply game logic, like enemies reacting when the player enters their range of vision - it could only be used for graphical effect.