Selecting invisible primitives from a point

   871   3   0
User Avatar
Member
141 posts
Joined: Dec. 2015
Offline
Hi guys,

I need to optimize a huge scene. I thought it would be a good idea to define viewpoints find the primitives that are not visible from that point, and remove them. Unfortunately, I need a super dense mesh to really hit all the polygons.

I'm curious what would be your method?
User Avatar
Member
53 posts
Joined: Feb. 2017
Offline
You can use the VDB SOP to define a camera frustum which you can then use to for example group primitives by bounding volume. The ones not in that group could be deleted. Work that work for your case?
Technical VFX artist @ Housemarque / Sony Interactive Entertainment
User Avatar
Member
141 posts
Joined: Dec. 2015
Offline
It's a good idea, but for me, it wouldn't really work well.

So the idea is that I have a path where my car would go in an environment. I need to remove the primitives/polygons which are not visible from the given path (occluded, there normal is pointing away from the path, etc.)

I resampled the path and placed a dense sphere to each point, then I used ray SOP to find the primitives that are not at all, and then removed them. But I had to have a super dense mesh, and still, it'd miss a lot of primitives...I was also thinking to spit tons of particles into the scene from the spline path and remove the polygons no particle hit
User Avatar
Member
53 posts
Joined: Feb. 2017
Offline
szmatefy
It's a good idea, but for me, it wouldn't really work well.

So the idea is that I have a path where my car would go in an environment. I need to remove the primitives/polygons which are not visible from the given path (occluded, there normal is pointing away from the path, etc.)

I resampled the path and placed a dense sphere to each point, then I used ray SOP to find the primitives that are not at all, and then removed them. But I had to have a super dense mesh, and still, it'd miss a lot of primitives...I was also thinking to spit tons of particles into the scene from the spline path and remove the polygons no particle hit

How about using the dot product? You can calculate alignment of two vectors with the dot product and it will be returned as a float value between 1 and -1 where each opposite means either perfect alignment or opposite and 0 is perpendicular. You could maybe resample your path. For each primitive in the geometry, find the closest point on the path, calculate the positional difference so you get a vector pointing from one prim to the path. Then dot() that vector by the primitive normal and take out if the alignment is opposite. This however would still not account for a very bendy path where prims might be seen from totally different angles and positions on that path. In that case you would maybe want to include more points in the sampling, or just run the whole sequence through a solver with a similar approach. Maybe not a perfect solution... but just figured I'd share my thoughts
Technical VFX artist @ Housemarque / Sony Interactive Entertainment
  • Quick Links