PDA

View Full Version : delete hidden polys?



sadkkf
01-22-2016, 01:08 PM
Hi, all--

I need to create piles of debris. Things like blocks, stones, whatever. My plan is to use Bullet to break something and let it fall then create a new object from the shattered pieces.

My question is, once the pile is made, is there a way to delete all the polys that are not visible? I imagine there will be blocks complete buried by others and I could even remove all the polys in contact with the ground.

Hopefully this makes sense. Any ideas how to do this?

ernpchan
01-22-2016, 01:12 PM
Can't think of a quick way to do this. How would you be able to determine what's 'visible'...visible to who? I know you mean the camera, but I don't know of a mechanism between Layout and Modeler for Modeler to know what polygons Layout sees. And if the camera is moving..at what time? Camera will see different things at different times during the move.

I suppose you could try a merge boolean operation...don't think that'll result in very nice geo tho.

sadkkf
01-22-2016, 01:19 PM
I'm thinking "visible" means viewable from any angle above the horizon. So, a pile of rocks on the ground...I don't need the polys touching the ground. If a rock is completely obscured by other rocks, it can be deleted.

My goal here is to optimize the object as much as possible. Kill all the polys that would never be rendered.

ernpchan
01-22-2016, 01:29 PM
Is your ground completely flat? If so, you could do a volume select on everything below that line and then delete polys.

probiner
01-22-2016, 01:32 PM
Zbrush Dynamesh :/

sadkkf
01-22-2016, 01:33 PM
Is your ground completely flat? If so, you could do a volume select on everything below that line and then delete polys.

yeah...good idea.

Now about the inside polys...seems like there's a way to apply a surface to visible polys then either select those or not those, but I could be thinking of Blender or something.

ernpchan
01-22-2016, 01:57 PM
Now about the inside polys...seems like there's a way to apply a surface to visible polys then either select those or not those, but I could be thinking of Blender or something.

Maybe...don't know of a LW way. Have to figure out how the system knows what 'visible' is.

JoePoe
01-22-2016, 02:15 PM
How about switching all your orthographic views to Texture, shift lasso select around everything in each view, hit select connected, hide..... delete what's left. (you could even rotate the pile to add to the section from angles too....(maybe just add the 45s).

Hmmm, just tested. Will only catch objects that have at least one whole poly of itself showing. So maybe do the selecting thing twice before deleting to get two "layers" deep?

Not great, but could get you pretty far along though.

FWIW, selecting in edge mode catches a bit more.

Kryslin
01-23-2016, 02:21 PM
What you are talking about is occlusion - removing polygons whose visibility is wholly blocked by other polygons.

I can't think of a way to do it in lightwave directly, not without some heavy duty script writing* ... But, maybe we can cheat with what we've got.

Run your simulation, create your piles - you'll be using this for a base. Put this in a background layer.
In your foreground layer, model a rough outline of the pile - one that is well within the outline of the original pile. Surface it a dark grey, add some turbulence for some variation (or whatever color your debris is). Make sure the mesh is closed, and the bottom goes below the bottom of the original pile. Swap layers, and perform a boolean union. Merge points, and you should have a pile that doesn't have a lot of polygons you'll never see in the middle of it. You should be able to adjust the bottom so that it lay flat on the ground plane. It might have to be cleaned up a bit afterwards.

Another one that struck me while thinking about this - make a pretty dense hemisphere that just barely fits over your base pile. Heat shrink it over the pile, surface as needed.

(*There are several solutions, requiring a lot of sorting and/or ray intersection checks. The process gets more intensive the more polygons you're checking.)

jeric_synergy
01-23-2016, 02:53 PM
A lot of CGI rendering research was put into making that operation ( occlusion sensing ) AFAP because it's crucial and happens millions (literally) of times.

Addressing it manually and perfectly would be quite labor intensive. What if there's ONE skinny crevice that exposes a lot of interior stuff?

IMO you're better off cheating a bit and making a rough hemisphere with a "rubble" image map on it, sizing/warping it to be well inside your rubble, and deleting anything inside this rubble hemisphere. If it happens to be darkish, all the better. Illusion is the name of the game here.

Sensei
01-23-2016, 03:16 PM
I need to create piles of debris. Things like blocks, stones, whatever. My plan is to use Bullet to break something and let it fall then create a new object from the shattered pieces.

My question is, once the pile is made, is there a way to delete all the polys that are not visible? I imagine there will be blocks complete buried by others and I could even remove all the polys in contact with the ground.

Hopefully this makes sense. Any ideas how to do this?

Set Transparency to 100%? Or Object's Dissolve (enveloped)

Save Transformed Object so you have debris in .lwo,
and then animate (morph?) 2nd object that's replacing 1st one that disappeared.

Surrealist.
01-24-2016, 01:20 AM
Like what Kryslin said is he only thing I could think of. Boolean. But I'd just use Subtract. Or a combination of the Heat Shrink and Boolean. Heat Shrink, Smooth Scale down far enough to be invisible and Boolean Subtract.

sadkkf
01-24-2016, 06:57 AM
Zbrush Dynamesh :/

*WISH* could afford ZBrush!

sadkkf
01-24-2016, 07:10 AM
What you are talking about is occlusion - removing polygons whose visibility is wholly blocked by other polygons.

I can't think of a way to do it in lightwave directly, not without some heavy duty script writing* ... But, maybe we can cheat with what we've got.

Run your simulation, create your piles - you'll be using this for a base. Put this in a background layer.
In your foreground layer, model a rough outline of the pile - one that is well within the outline of the original pile. Surface it a dark grey, add some turbulence for some variation (or whatever color your debris is). Make sure the mesh is closed, and the bottom goes below the bottom of the original pile. Swap layers, and perform a boolean union. Merge points, and you should have a pile that doesn't have a lot of polygons you'll never see in the middle of it. You should be able to adjust the bottom so that it lay flat on the ground plane. It might have to be cleaned up a bit afterwards.

Another one that struck me while thinking about this - make a pretty dense hemisphere that just barely fits over your base pile. Heat shrink it over the pile, surface as needed.

(*There are several solutions, requiring a lot of sorting and/or ray intersection checks. The process gets more intensive the more polygons you're checking.)

Great ideas, but they didn't work too well. Heat Shrink only shrinks to the center. It didn't fill in the holes and pockets very well.

Union was way too memory intensive.

Dang. I loved the Heat Shrink idea.

Thanks for the ideas!

sadkkf
01-24-2016, 08:16 AM
Set Transparency to 100%? Or Object's Dissolve (enveloped)

Save Transformed Object so you have debris in .lwo,
and then animate (morph?) 2nd object that's replacing 1st one that disappeared.


Not sure I understand what you're suggesting. Can you please elaborate?

sadkkf
01-24-2016, 08:18 AM
A lot of CGI rendering research was put into making that operation ( occlusion sensing ) AFAP because it's crucial and happens millions (literally) of times.

Addressing it manually and perfectly would be quite labor intensive. What if there's ONE skinny crevice that exposes a lot of interior stuff?

IMO you're better off cheating a bit and making a rough hemisphere with a "rubble" image map on it, sizing/warping it to be well inside your rubble, and deleting anything inside this rubble hemisphere. If it happens to be darkish, all the better. Illusion is the name of the game here.

Manually might be the way to go, unfortunately, but has its benefits. I could always position the rubble pieces to cover any holes. Still, I'd rather find a quicker method.

sadkkf
01-24-2016, 08:40 AM
It occurred to me I may be approaching this problem in the wrong way. Rather than try to delete the objects buried, why create them at all?

I've built a ground object roughly in the shape I want the final pile to look like and dropped my object on that. I think once I find the right friction/bounciness and other settings, this will work much better. I'll have gaps, but I can move other pieces into them much easier than deleting hidden ones.

JoePoe
01-24-2016, 11:23 AM
Don't know... my method seems to do pretty well. Especially from side views (makes sense 'cuz your looking at two walls).
Only took about two/three minutes.

Original pile ... 132042 Result... 132040 the pile that was removed.... 132041

a few visible small holes in the top view... but I'm using a very garish background color. And if you're planning on a ground plane, shadows will cover all that.

MichaelT
01-24-2016, 11:54 AM
My immediate thought is.. what is this for?

If you worry about a game engine drawing all of that then stop worrying. Most (if not all) engines wont draw anything that is fully behind non transparent geometry. Many engines will also create volumes that will test if they are visible or not, behind geometry. Which in turn will prevent them being drawn.
On the other hand, if this is for rendering.. create a half dome in the the pile (of suitable size) Anything visible from the inside of the dome, you simply delete. There probably is a script doing that somewhere ;)

tomtm
01-24-2016, 09:01 PM
Hi,
we currently run a free trial service to clean meshes and
also to remove hidden/floating parts.
It's mainly thought to optimize ultra high detail meshes
for 3d printing, but maybe it could help in your case.

http://www.voxilion.com/store

Greets Tom

probiner
01-25-2016, 07:13 AM
I would enjoy this: http://codewelt.com/multiboolean

probiner
01-25-2016, 11:14 AM
Although it doesn't solve cases like these, where the mesh intersects with it self, but it would be a nice start x) :

http://i.imgur.com/KFDbZId.png

sadkkf
01-26-2016, 01:11 PM
@JoePoe -- what's your method? EDIT: Ah, looked back and read it again. Interesting. I need to try that. You say it's quick?

@MichaelT -- I use a lot of my models in VUE where polys add up fast. Optimizing models is critical.

@TomTm -- interesting. Will it always be free? Is this a new product?


I've had pretty good luck dropping my objects onto a cone-shaped object roughly how I want the pile to look. It creates a few more gaps than I'd like, but even copying some pieces and moving them isn't a big deal.