Automatical view frustum culling (?) prevents coordinates changes in the vertex shader

In short, the frustum culling of a given object is informed by the bounds of that object–which, as you will likely infer, is not moved with shader-driven vertices.

(This is an issue that can also occur when using Actor-animations that move their vertices significantly beyond their baseline bounds, by the way.)

One simple answer, then, is to replace these bounds. For an object that it’s always okay to render, a set of bounds that is infinitely big should do: being “infinite” in size, it’s always “in view”. In Panda, this object is called an “omni bounding volume”.

It can be used something like this:

In your importations:

from panda3d.core import OmniBoundingVolume

Elsewhere:

# Create a bounding-object
bounds = OmniBoundingVolume()
# Apply it to the affected object
self.affectedNodePath.node().setBounds(bounds)
# Inform Panda that it needn't do any further bounds-testing below this node
self.affectedNodePath.node().setFinal(True)
2 Likes