Optimizing Heavy Shots

A wide shot of a landscape can contain millions of instance points, many of which may not contribute to the final pixel.
This is why I developed an HDA in Houdini for The Lion King movie, which calculates which points to keep and which to cull.

How does it work?

First, we simplify the instance points by having one point represent a cluster of points within a certain radius.
This speeds up subsequent calculations.



We further optimize by working only with the points within the frustum, and we can extrude the frustum
to ensure we're not culling points near the camera's edge.



Within the frustum, we determine which points are visible and which are blocked.
One method is to shoot a ray from each point to the camera.
If the ray is not blocked, the point is visible.




We extend the visible map for safety, as it's better to retain more points than to cull necessary ones.


Additionally, we have the option never to cull a point if it is within a certain radius from the camera.


Once we've computed which points to keep and which to cull, we transfer the results to the original dense points.


Let's see the results from the rendering camera. I'll also add a large pig head to observe how many points behind it we can cull.


Nice! but what if the camera is moving?


To address this, we can keep the points visible in any frame.

I've simplified a lot of what's actually done in a production environment :)



You can download the Houdini setup I used as an example here:
Houdini File