You could indeed remove the vertex index from the GeomPoints primitive, e.g. using a memoryview:
points_prim = point_cloud.node().modify_geom(0).modify_primitive(0)
# the default index type is Geom.NT_uint16; Geom.NT_uint32 is only used
# when the model contains more than 65536 vertices (or when set explicitly)
int_format = "I" if points_prim.index_type == Geom.NT_uint32 else "H"
prim_array = points_prim.get_vertices()
prim_view = memoryview(prim_array).cast("B").cast(int_format)
prim_view[vertex_index:-1] = prim_view[vertex_index+1:]
prim_array.set_num_rows(prim_array.get_num_rows() - 1)
Instead of removing the vertex index, you could also overwrite it with the index of one of the remaining (“shown”) vertices:
prim_view[vertex_index] = other_vertex_index
This would be slightly faster, as it doesn’t require changing the size of the primitive. This might also be more convenient in that no indices are offset then.
As for the shader-based method, that should be possible in several ways. Although I’m far from a shader expert myself, it seems possible to accomplish this in either the vertex shader, the geometry shader or the fragment shader.
In the vertex shader, the “hidden” vertex could be positioned directly behind the camera, so it doesn’t get rendered. If I’m not much mistaken,
p3d_ViewMatrixInverse.xyz gives the inverted camera direction vector, while
p3d_ViewMatrixInverse.xyz is the camera origin. Adding these together should therefore result in a
gl_Position that you can assign to the vertex to remove it from sight.
In the geometry shader, you would only call
EndPrimitive() for “shown” vertices.
In the fragment shader, you would use
discard for “hidden” vertices.
Since you already have a shader, it might be fairly easy to integrate either of the above methods into it. It is likely possible to combine shaders as well, but I have no experience with that.
Please note that none of the above has been tested, but I hope to have given you some useful hints nonetheless.
If you want, I could try to write and test some more complete shader code when I find the time.