Deformation, adjustment of mesh


Haven’t been around here since html5dev!!

I’m trying to resurrect a game I produced using Basic4Android and Babylonjs.

One issue I’ve got now is if I have say a barrier or relatively simple cube defined and my player shoots at the cube with a bullet what is the best way of deforming or taking away some of the cube. Ideally ‘randomly’ but pseudo randomly is fine. I was starting to think of using CSG and subtracting a pre-defined mesh from the cube, but I’m not so sure this is the right way to go…

So let’s say I shoot once, it makes a dent or hole and shooting again removes more or passes through.

It’s a mobile game if that makes any difference (i.e. in terms of performance).

I’ve now started to consider making up the cube or barrier of smaller blocks and then removing the point of impact cube and a number of connecting blocks, but that feels a bit overkill as well and could well impact the performance if I’ve got lots of these structures to handle.

Or is invert normal the way to go? Although my mesh is fairly simple so it might need to be increased in terms of mesh complexity to handle this the way I want to.

FYI Basic4Android is now free to use!!

Is the destruction part of the gameplay? 'cause if not, especially in mobile, decals could be probably the way to go.

For real destruction, maybe you have to see how some games make their cooking (Frosbite engine for Battlefield for example, or search some conference using destruction GDC keywords also :)).

Hi @Vinc3r

Yes it is part of the gameplay. The Player shoots a bullet, it hits a barrier or wall and some of the wall is removed.

I’ll take a look at the PG you’ve linked to. Ah that isn’t what I’m trying to achieve. I want/need the mesh to lose some of its structure when hit.


Might go with something like this

Will have to see what performance is like…