disable culling on a single node

I need to disable culling on a single object. I am making a space based game, and in order to get the proper feel for rotation I am using the concept from the solar system demo of an inside-out sphere painted with a starfield. To get the feel for motion I have a bunch of space “dust” (very small objects) that you fly past to show relative motion.

I currently have my culling set to just outside the sphere.

The problem is that the dust uses a lot of resources. If I set culling as close as I want to disable unneeded dust, though, my planet and sun get culled too soon, or they “fall through” the starfield.

I would like to disable culling on the starfield and set it to very large scale. Disable culling on the planet and sun, and set the cull to a near enough point that everything else makes sense.

I saw another thread where David says it is possible, but I am not sure how it is done.


You can disable culling like this:


There is 3 types of culling in panda3d.

node culling (what pro said)
near/far culling - what i think you are talking about
backface culling - triangles from inside out.

What i done in my game is have 2 display regions with 2 scenes. Basically i created another scene which renders planets and stuff and I use the other to render close up stuff like spaceships and rocks. I do depth clear between them but not color clear. Works great. You just have to make sure that rotations of your cameras are in sync.

This way you can do all the advance things in your star system level and all the advanced things you want at the planet level.

I stole this approach from Celestia btw.

You forgot portal culling, Panda supports that too (and it’s very useful!)

You can also make an artificially close far plane for certain nodes of your scene with code something like this:

plane = PlaneNode('plane')
plane.setPlane(Plane(Vec3(0, -1, 0), Point3(0, distance, 0)))
pnp = base.camera.attachNewNode(plane)


This creates a clipping plane, parented to the camera at the distance specified by “distance”, which only clips anything parented to the node “clippedObject”. Since its clipEffect is set to 0, it doesn’t actually create a clipping plane (which would be a tiny bit more expensive), but it still culls objects that completely fall behind the plane, resulting in a performance gain similar to pulling in the far plane.