A quick and ugly demo of my “3d skybox” implementation:
I made a simple source inspired “3d skybox” where in addition of the jME’s SkyFactory I can now set a model to be rendered in the background.
I render it to a different view port on the back using a different camera.
This camera’s position is scaled down from the main camera so the actual model you see here is about 10 units squared so it doesn’t get culled by the back plane. I show this by changing the render distance in the settings menu.
A few quirks I found:
- I use the default Opaque bucket because the Sky bucket doesn’t seem to render the triangles in the right order (I guess this is an optimization since it’s unnecessary for a sphere).
- The back scene of the viewport has to be under the root node (or I get an error) so it would be picked by the main view. I put it under a node with cullhint always to fix it, another way would be to reconfigure the main view port with a new scene root under the original root. At least that’s what I figure it happens.
- I have to set to false the clear flags of the main view port while the skybox is present.