Point cloud self occlusion/hide from camera view

   3829   7   0
User Avatar
Member
59 posts
Joined: April 2006
Offline
Hi,
I am trying to isolate the points of a point cloud that are visible from a camera. With ray/intersect/intersect_all nodes only work with primitives, so I though is there is any way to intersect on points (maybe making them bigger or thickening the ray?) other than create a primitive per point with a copy node, which slows things down quite a bit.

I was wondering if there is any way to access the OpenGL buffer of the viewport, as the occlusion works there if you scale up the point size in the Display Options>Point Size.

Thanks!
User Avatar
Member
28 posts
Joined: Nov. 2013
Offline
I think it can be a lot more efficient but this could be a technique to try:
Edited by arjanM - June 3, 2018 09:03:03

Attachments:
pointcloudOcclusion3.hipnc (143.8 KB)

User Avatar
Member
59 posts
Joined: April 2006
Offline
Thanks for your reply. Although creating primitive per points works, I am trying to avoid creating more geometry as I am dealing with huge point clouds.
User Avatar
Member
28 posts
Joined: Nov. 2013
Offline
The extra prims where somewhat of a work around to get the correct pscale values.
It was meant more as an example to use the uvtexture to flatten the point cloud in camera space and then use the pcfind function to remove points.
I made an example without the extra prims and just divided one by the old pscale and then I needed to multiply it by 1.7 to make it work. I don't know the correct math to do this, but it works and it is quite fast.

Attachments:
pointcloudOcclusion4.hipnc (123.9 KB)

User Avatar
Member
59 posts
Joined: April 2006
Offline
I don't know what I was thinking but for some reason I though group using “Keep by Normals” and choose camera didn't work on points. It does.
User Avatar
Member
4512 posts
Joined: Feb. 2012
Offline
I created a free scene that deletes points from a camera view using occlusion in a point cloud with variable radius, without instancing actual geometry:

Because of the perspective distortion, it might look like there are overlapping points but I added a planar camera projection preview mode that shows that no point is actually overlapping.

https://www.patreon.com/posts/19277999 [www.patreon.com]

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
User Avatar
Member
59 posts
Joined: April 2006
Offline
Great job! Thanks!
User Avatar
Member
3 posts
Joined: June 2021
Offline
This wrangle might me helpfull


string cam = chs("cam");
vector screenP = toNDC(cam, v@P);

if(screenP.x > 1 || screenP.x < 0) removepoint(0,@ptnum);
  • Quick Links