How do I make a skybox?

Welcome to the forum :smile:

A skybox is 100% something you can accomplish. Effectively to create a skybox we want a 3d cube with a texture on each face there are lots of premade ones but you can also make one pretty easily. Once we have a 3d model creating one in Panda3D is simple.

# Load the skybox
self.skybox = loader.loadModel("skybox/name_of_your_skybox")
self.skybox.setScale(2000)
self.skybox.reparentTo(render)
self.skybox.setShaderOff()
self.skybox.setBin('background', 0)
self.skybox.setDepthWrite(0)
self.skybox.setLightOff()

What the above does is make it so the box has no depth and will be unaffected by any lights we’ve . Finally setBin helps us set when a model will be rendered and so any models in background will be the first ones drawn. Combining all of this will create a skybox.

Code is from this post.

If you need any additional help feel free to ask. :smile:

1 Like