How to know if point of an object is visible to camera?

Imagine a 3D GameObject, which for simplicity could be a Cube. And imagine I got a point of it’s surface.
How to check if that point is visible from camera? If I pick a point that is lying on the side of cube which is visible to camera then the camera sees it obviously. But if I pick a point which is on the opposite side of the cube, which is not visible to camera because that part of cube is not facing the camera, then point is not visible. Even though all the points of cube are projected into camera view.

I could use the:

cam.WorldToViewportPoint(point)

And perform checks if point is visible in camera or not, but this won’t work if I’m selecting point that is on the side which is not visible.

For example let’s say the image above is what I’m observing from the camera. Then any point picked from the surface of 0,1 and 2 would be visible. And any other points from surfaces 3,4 and 5 are invisible.

First do the WorldToViewportPoint thing. if it’s outside of the camera frustum, it’s not visible.

Then, if it’s inside the frustum, do a raycast to that point and if you don’t hit another point before hitting that point, it’s visible. When you get the raycast hit point, check the normals too, just to make sure you haven’t hit a face that is facing away or something.

Hi @morzhik

You didn’t even try to explain what you are trying to achieve with this… instead of an abstract example, can you explain where and why you need this? How are you “picking a point”?

If you for example used raycasting (I don’t know what you are doing…) you wouldn’t need anything special, you could use simply the raycast hit normal to decide if it is facing towards camera or not.