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)
viewSky.set_sort(0)
lens = PerspectiveLens()
#do some lens manipulation here (fov, etc.)
skyCamNode = Camera('skybox camera', orthoLens)
skyCam= skyBox.attach_new_node(newCam)
del skyCamNode
del lens
viewSky.setCamera(skyCam)
#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!
This is just what I needed and I appreciate the detailed explanation as well as it really helps me to understand what is happening rather than blindly copying some code.
I have read briefly about simplepbr and I have it installed. I will definitely experiment with this as well as models are somewhat of a minor hassle to get right. Textures even more of a pain!