setRenderModePerspective not working for GeomPoints?

Hi everyone,

I would like to use GeomPoints to display point clouds. Though, it does not look that great yet when zooming out with the camera. The point clouds are a bit overloaded if the GeomPoints are not scaling according to their distance to the camera. Here I read that setRenderModePerspective should make them be rendered smaller/bigger when the camera is closer to/farther from the GeomPoint. But it does not work for me. Am I doing something wrong?

vdata = GeomVertexData('name', GeomVertexFormat.get_v3c4(), Geom.UHDynamic)
vertex = GeomVertexWriter(vdata, 'vertex')
color = GeomVertexWriter(vdata, 'color')
prim = GeomPoints(Geom.UHDynamic)
geom = Geom(vdata)
node = GeomNode('point')
nodepath= NodePath(PandaNode("nodepath"))

The code works for me. However, perhaps you have a shader assigned? When testing your code I noticed the auto-shader doesn’t currently handle perspective points correctly.

I filed a bug report for that:

1 Like

That’s it! Had the auto shader active. It works for me when I just don’t assign the shader for the geom points. Thank you for looking into this and recognizing the problem!

The issue has been fixed and the fix will be part of Panda3D 1.10.14.

You can also set hardware-point-sprites 0 in Config.prc to work around this issue, if you need to use the shader generator, but there will be a performance penalty.

1 Like