Billboard sprites or something similar for very far objects


Imagine I have an 3d object. If I move my camera too far away, so that visible size (the size of object at the screen) of the object will be 1 pixel or even less (probably this can be defineable via anglular diameter), the object starts to flicker, because it’s size could be less of a pixel. So, I need somehow to change this object… no, the visible part of this object which is now like 1 pixel in size, to some kind of billboard with a texture of an similar object. This billboard should remain its size even if I move my camera further away. Imagine it as a sun at the sky - we see it as a sphere, but if we would travel fast enough away from sun, it will get smaller, and when it will be as big as a tiny dot, I want to see it like a 4-ended star, which looks a bit bigger, than a tiny dot.

The only way I see how this can be done is to make a plane (transparent at close distances) together with this 3d object, and modify shaders from both 3d object and a plane so that if the object is far enough, it’s color “fades out”, and the pixel color of the plane “blends in”… But this approach gives me a lot of questions, like how to make this billboard plane to stay fixed in it’s visible size when I move even further? Scale it every frame?

“Imposters” is what you are looking for. There have been a few threads on that in the forum, but nothing directly built into jme3 core.

Your stars are a bit of a special case however, you will have to control their size every frame if you want them to always show up. And the flickering is probably z-fighting in the depth buffer. In that case they need to remain close to you.

You could possibly make a custom sky-box that can have these ‘out of range’ imposters painted on it with a shader. Or another option is to have the imposters remain at a maximum distance away, I’m not sure on the math for that one though; might be hard to not make them slide around and follow you over long distances.

Especially for far away stars, point meshes could be intresting, as far as I know they are always renderd with at least 1pixel size.

Correct me if I am wrong, but I have found a BillboardControl class, which can be attached to Geometry as a Control, soo… this will give me that my geometry (plane) will always face camera. Good. Now I need somehow to scale the plane so it’s angular size always remains fixed.