AnalyticalGraphicsInc/cesium — pull request #749 by kring (2013-05-07 19:07:06+00:00)
Title: Improve horizon occlusion point computation

Use the WGS84 ellipsoid, rather than a sphere constructed from WGS84's minimum radius, to compute the horizon occlusion point that it used to test terrain tiles for occlusion by the Earth itself. Also, use the terrain heights instead of ignoring them like we were previously.

For the EllipsoidTerrainProvider, this should be very close to optimal. For terrain, it has the potential to cull tiles that are actually visible, but I had to try really hard to make it happen at all, and even then it wasn't very objectionable. If you manage to get it to happen without me showing you how, let me know. I bet there are similar artifacts with the old implementation in different scenarios, for what it's worth.

With more excellent work from Frank Stoner, this should be both faster and more accurate than the previous technique. It also allows us to not render a few tiles. Here are the number of tiles rendered in the different views in the terrain example, before and after this change.

View	Before	After

Default	18	18

Everest	83	80

Half Dome	122	120

SF Bay	57	53