Cube size is irrelevant, as is the size of the scene you render onto the cube. The trick is to render the cube before everything else in the scene without depth testing or updating, with the cube centred at the camera - that way when the rest of the scene is rendered it will appear in front of the cube map. I just used the search function of this forum to get https://discourse.panda3d.org/viewtopic.php?t=3192&highlight=skybox, which has code that looks right in the 4th post. Also, there is a cubemap generation tutorial posted in general discussion right, now which might be of use.
As a side not if you want stuff in your skybox like mountains, clouds or planets i suggest creating a separate display region with its own root nodes and stuff.
It comes with blender template. You just make (or download) the scene, activate each camera, render, save…repeat 6 times. Then you have a perfect skybox. Can do it in 2 minutes.
I tried thought code, but something wrong happens with blender mesh, it wont be texturized… i followed the solar system tutorial made by Shao Zhang and Phil Saltzman, all understood, but seems to be that i have the trouble with blender…
ClCheung, thanks for that tip, i’m going to check it out…
Based into Panda3d’s Manual, there is a CubeMap section, that i couldn’t understand very well… the skybox variable in the code i just typed is a wrong syntax, what could be the right way to script 6 images for a cubemap…?
i saved the xml code as space.egg, renamed the contents image name files (into egg) to the existent ones… and success …
Skybox is visible now, its works good and looks fine !
A question… : Its looks like camera can reach the end of skybox and cross over it, (because skybox is a model).
It is possible to parent camera with skybox? so player never will get cross over the skybox… certainly, the camera moves with skybox at the same time… you can imagine that will made a perfect skybox…
If not possible, make the spaceshuttle very slow and tiny could be a solution…
I usually do it by adding a task, set the position of the skybox to the position of camera. May be reparent the skybox to camera node also do the work. Try it and let us know !
I tried to do parent skybox with the camera, the result was the skybox does not won’t to move, just the spaceship… now i think it, its logic that happened, since while the camera rotate, rotate the skybox too, so we are going to see for ever the front of the skybox,
i guess there is a difference between cubemaps and skybox, skybox is a model right?, a cubemap is a permanent image that you never will reach or touch, for the space maybe better to do a cubemap, for a fighting game skybox is nice,…
The technic you teach me is very useful, but the problem when the player’s ship moves, the star’s images lose resolution…
Just let me put to you two examples in video… soon i’m going to upload… and will let’s opine about it
May be you can take a look on how the skybox can be well positioned with Yarr demo or my demo: discourse.panda3d.org/viewtopic.php?t=5915
In my demo, you can select “Ocean 2 - xxx”. Skybox is always positioned to the camera position (but not follow the rotation). It will have the proper effect that you want. It is not neccessary to use cubemap, as far as I know.
Thomas : The second way was very well, i think i should that way inside the planets !,
ClCheung : Nice !!!, “Skybox is always positioned to the camera position (but not follow the rotation)” that is just that i’m looking for (to the space scene), i’m going to check out your link post to view your framework program…