Disable horizon culling and/or view frustum culling

307 views
Skip to first unread message

M. Timson

unread,
May 6, 2015, 12:35:25 PM5/6/15
to cesiu...@googlegroups.com
Hello,
I have been working on some custom terrain and in order to make the terrain easier to work with, I want to disable horizon culling and maybe view frustum culling for now. As some older posts suggested, I tried changing the condition in line 415 of GlobeSurfaceTileProvider.js to false, to no effect. I also tried having the function return Visibility.FULL, also to know effect. After trying to make the function throw some errors, it seems as though the function isn't even called. Are these tests now done in a different function, or am I misunderstanding how these functions are called?
Thanks

Hyper Sonic

unread,
May 6, 2015, 7:28:09 PM5/6/15
to cesiu...@googlegroups.com
Do you mean this line?
if (frameState.mode === SceneMode.SCENE3D) {

The SandCastle examples use the individual js files rather than the combined Cesium.js file like the regular apps use. I placed a console.log within that if statement and it was called quite often.

EllipsoidalOccluder.prototype.isScaledSpacePointVisible

This fixes flat tiles disappearing when the camera goes under the ellipsoid
//return !isOccluded;
return true;
However you also end up loading tiles that are beyond the horizon, which is a waste. Is isScaledSpacePointVisible for the horizon only but not the frustum?

M. Timson

unread,
May 7, 2015, 11:15:23 AM5/7/15
to cesiu...@googlegroups.com
Thanks, I did still have my application set up to use the Cesium.js in the Build directory instead of the one in the Source directory, that solved my problem.

As far as disabling the culling goes, changing 
if (frameState.mode === SceneMode.SCENE3D)  to if (false) 
solved my problem, and my tiles now stay visible. We are only concerned with terrain for a small geographic location, so rendering extra tiles is a very minor concern as most levels only have one tile.

Patrick Cozzi

unread,
May 7, 2015, 5:00:21 PM5/7/15
to cesiu...@googlegroups.com, mctim...@community.nipissingu.ca
Hi

> in order to make the terrain easier to work with, I want to disable horizon culling and maybe view frustum culling for now.

Can you elaborate on "easier to work with?"  Are you running into #2271 or other issues?

Patrick

M. Timson

unread,
May 7, 2015, 5:20:41 PM5/7/15
to cesiu...@googlegroups.com, mctim...@community.nipissingu.ca
Yes, that is the issue I was having only at significantly greater distances.
I suspect it is because I have not yet computed correct horizon occlusion points. So far I have created meshes from height maps and stored them as quantized-mesh-1.0 terrain tiles, but if the camera is even relatively close to the ellipsoid all tiles disappear, sometimes even when what should be the occlusion point is still visible. Once I compute the horizon occlusion point as described at https://cesiumjs.org/2013/05/09/Computing-the-horizon-occlusion-point/ I will try re-enabling that function to see if it works as needed. 
Thank you

dr.drom...@gmail.com

unread,
Jun 1, 2015, 4:01:59 AM6/1/15
to cesiu...@googlegroups.com
Hi,
If you still stuck with it, you can calculate the bounding sphere in the client, using the built in cesium function, in BoundingSphere class (as Kevin wrote here: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/6G9CqeyjpsM).
You can also compute the horizon occlusion point in the same way (using EllipsoidalOccluder Class)
I did it for the same need and it works great, with no significant performance impact.

Mike LP

unread,
Jun 1, 2015, 4:37:27 PM6/1/15
to cesiu...@googlegroups.com, dr.drom...@gmail.com, dr.drom...@gmail.com
Good catch dr.drom
Reply all
Reply to author
Forward
0 new messages