I have a locally stored database on my Android project, it is a database of approx 100,000 Point3D(double,double,double). I need to check if each of these points are inside of the camera's frustum in unity. Will I most likely be running into performance issues querying the database and feeding all live Point3D's to unity per frame? What would be the best way to go about this if I am approaching this from the wrong direction?

  • \$\begingroup\$ Querying a database is never fun, have those points stored in some sort of temporarily strage in the memory, so you can access them, after that, you shouldn't worry, except if you do it every frame or very frequently. \$\endgroup\$
    – Bálint
    Mar 8, 2016 at 19:50
  • \$\begingroup\$ What do those points represent? \$\endgroup\$
    – Vaillancourt
    Mar 8, 2016 at 19:51
  • \$\begingroup\$ These points represent an objects coordinates in 3D space \$\endgroup\$
    – MarsYeti
    Mar 8, 2016 at 19:56
  • \$\begingroup\$ How dense are the points? Are they clustered? Connected? What accuracy do you need for frustum culling? Do the points move? 2D or 3D? \$\endgroup\$
    – Steven
    Mar 8, 2016 at 21:25

1 Answer 1


One of the approaches you could take:

If you could organize your points into 'objects' or logical group of some kind, you could then compute each object's bounding volume (either an axis-aligned-bounding-box (AABB) or a bounding-sphere), and with that, do a quick rejection based on the frustum of the camera and the bounds you've calculated.

This strategy will leave you with some points that will not be in the frustum of the camera (because their friends are).

Now it's not clear why you need to know if the point is in the frustum of the camera. If it's to reduce the load of things sent to the camera/rendering pipeline or to reduce the load of work to do on theses points, it could give you a sufficient boost that the extra work done on the points that are not seen but are not culled could be negligible.

If you really need to remove all of these not visible points, you could do a second pass to see if the bounding-volumes are not completely inside the frustum (or even flag it during the first pass); if they are not completely in the frustum, then check specifically each of the 3d points to see if they're in the frustum.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .