Comments and answers for "Calculating surface area of a plane covered by cameras' frustums"
http://answers.unity.com/questions/1679765/calculating-surface-area-of-a-plane-covered-by-cam.html
The latest comments and answers for the question "Calculating surface area of a plane covered by cameras' frustums"Comment by elenzil on elenzil's answer
http://answers.unity.com/comments/1679894/view.html
from a performance POV, i'd expect you'd be fine with a 5x5 grid and probably fine with 10x10 or possibly more. computers are fast.Sat, 23 Nov 2019 23:25:55 GMTelenzilAnswer by elenzil
http://answers.unity.com/answers/1679893/view.html
hmm. offhand, cast a ray through each corner of the viewport, see where it hits the ground plane, then view those four points on the plane as defining two triangles, and calculate the areas of those.
you may also want to consider edge cases where 1 to all 4 of the rays do not intersect the plane.
i'm not sure how to handle occluding objects cheaply. you could approximate each one by a screen-space rectangle and do a similar projection and subtract that from you "visible ground" area, but it'll be more complex if the bounding rect is partially outside the viewport.
i guess another approach might be to chop the viewport up into a grid, then for each cell test if the center of the cell "sees" the ground, and if so then project the corners of each cell onto the plane and add em up. depending on the fidelity you want you can choose a finer or coarser grid.Sat, 23 Nov 2019 23:24:47 GMTelenzil