How do I figure out which vertices are visible?

I have a procedurally generated planet that consists of about 10,000 vertices. At a fair distance, the planet doesn’t look too bad, but once I get closer, the low resolution of the planet becomes quite apparent. I have a strategy for procedurally generating the finer detail, but what I need is a way to know which vertices are actually in the viewport of the game, so that I can optimize which areas of the planet get more detail and which parts are ignored.

How do I do that?

I suppose you could use Camera.WorldToViewportPoint for reach vertex to see if it’s x and y values are between 0 and 1. Depending on the vertex count of the mesh, this could get very expensive.

Although I’m not sure how you’re specifically generating your planet, if the parts of the planet are many different gameObjects, you can use renderer.IsVisible to determine if they are in the camera’s viewing frustum.