Custom Occlusion Culling

Thanks four your info !
I am not having performance problems yet, its just to learn how to do it, and to try some improvements on my game, I think I have an nice opportunity to do the occlusion culling in there so why not to do it ? At least to try to understand the alternatives…
I dont think I can precalculate in my case, the tragectory of the objects are very random, also, the camera moves arround the planet orbit, so I guess its impossible to precalculate anything.
I could maybe try to build some more advanced tecniques like an ring behind the planet (in relation with the camera) to detect wich object enters the red area, but I think maybe there is other alternatives…

Sure you can. For each cell in your grid, pre-calculate which cells are hidden by the planet. At runtime you can check in which cell your camera is and then cull all the objects that are currently in one of the hidden cells.

It would work similar then real occlusion culling, but without lots of its computation hits.

Of course you will have to keep track in which cell the object is, but thats a fairly cheap calculation

I see… But will I still need to loop into all objects to see if they are in or out the “red cells” right ?

The javadoc for camera. Use the method that takes near, far, fov, and aspect.

Skymap is always drawn at exactly the far plane.

You might use rays or physics to determine what needs to be culled too. Not sure about the impact on performance for your game but you probably need to do that just once in a while and not on each update.

How many rays? (Hint: one-per-pixel is the only accurate answer)

This was hashed and rehashed in another thread already. Casting Rays is not accurate and not fast.

Does the objects have the same distance from the planet? If so you can try this one:

Yes, your picture is accurate.
I see I have a lot of options here :).