Disable horizon culling and/or view frustum culling

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

Do you mean this line?

if (frameState.mode === SceneMode.SCENE3D) {
https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/GlobeSurfaceTileProvider.js#L415 (Cesium v1.9)

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
https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/EllipsoidalOccluder.js#L131 (Cesium v1.9)

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?

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.

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

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

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.

Good catch dr.drom