I am creating a space game for my computer science project at college and I read that using a technique called a skybox can make the 3D world seem a lot bigger than it actually is.
I know the fundamentals of python but I am an absolute beginner to panda3D. I have read different things on the internet to no success and now I am completely clueless on where to even begin with creating a skybox.
Is making a skybox a bit too out of my league for a beginner? Or is it something I can definitely do?
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.
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.
I just wanted to through out that you can also make skyboxes using displayRegions, which is useful if you want to have visual effects like a much greater fov on the skybox than the regular world, which is what some other engines use as their definition of “skybox”.
skyBox = loader.loadModel('skyBoxes/skybox')
base.camNode.get_display_region(0).set_sort(1)#ensure the skybox display region is behind
viewSky = base.win.make_display_region(0, 1, 0, 1)
lens = PerspectiveLens()
#do some lens manipulation here (fov, etc.)
skyCamNode = Camera('skybox camera', orthoLens)
#Not shown: tasks to keep skyCam lined up with the player's camera.
of course, you would have to turn this on an off where relevant. Especially when the player is indoors, because then you’d be rendering a skybox they can’t even see!