3D Skybox

Has anyone ever tried creating a 3d skybox, similar to how the Source Engine does it?

havent seen anyone. but set up a seperate scene graph, add a camera, render to texture… i dont see anything that would be a problem.

should be a straight forward process. go ahead, try, succeed :slight_smile: and if you have any questions feel free to ask for help.

Ok, I’m trying to set the display region sorting but it does not seem to help. When setting my new display region to a higher sort value than the base.cam.getDisplayRegion(1), which seems to be the one used by the render node, it does get displayed above it, but it is not visible when setting it to a lower sort value.

# Sky Camera
		self.skyBoxDR = base.win.makeDisplayRegion()
		self.skyBoxCamera = NodePath(cam)

		self.skyBox3dNode = NodePath('skybox Root')
# these don't make any difference, when True or False

Any ideas?

10 is also the sort value that is assigned to render2d, which is also set to clear the depth buffer. So it might be a good idea to use values that are all before 10, or to readjust the sort value of render2d’s as well. Note that you may use negative sort values if you like.

You might consider using base.win.getActiveDisplayRegion(0) for the first display region, rather than getDisplayRegion(1). In fact, you can use base.win.getActiveDisplayRegions() to return a list of all DisplayRegions, in order by sort value.


Got it working.

Needed to use:

cam=Camera('HUD Camera')

Instead of:


Then I just set the new display region’s sort value to -5.

Thanks David.