Mcs Caves & Overhangs [RELEASED]

Hi as promised here’s the update that allows to remove same position triangles (vertices). I also submitted it to the Asset Store.

You just need to enable the new remove same position triangles and it should work:
5993642--644873--upload_2019-8-11_20-38-2.png

Example:

4845776--465923--upload_2019-8-11_20-39-36.png

Overdraw before combining:

4845776--465926--upload_2019-8-11_20-40-6.png

Overdraw after combining:
4845776--465935--upload_2019-8-11_20-42-5.png

That is a huge optimization :wink:

4847069–466199–MCS_remove_samePosition_triangles2.unitypackage (19.3 KB)

5 Likes

This update is great!
It worked well in my project.
Thank you for the your update.

4846358--466025--capture1.png
4846358--466028--capture2.png
4846358--466031--capture3.png
4846358--466034--capture4.png

2 Likes

If the mesh model pivot is not the center of the model, “Remove Same Position Triangles” will not work well.
Is it possible to work even if the mosh model pivot is not the center of the model?

4846538--466094--キャプチャ1.PNG
4846538--466097--キャプチャ2.PNG
4846538--466100--キャプチャ3.PNG
4846538--466103--キャプチャ4.PNG

Yep it’s possible. Can you check if it works correctly now?

4847069–466199–MCS_remove_samePosition_triangles2.unitypackage (19.3 KB)

“MCS_remove_samePosition_triangles2.unitypackage” is same as “MCS_remove_samePosition_triangles.unitypackage”.

That is strange, seems that Unity doesn’t detect the difference. Can you delete this script CreateOverlapColliders

And try reimport version 2 again? The CreateOverlapColliders.cs should look like this on line 314:

4847249--466217--upload_2019-8-12_11-10-33.png

I removed “CreateOverlapColliders.cs” and imported “MCS_remove_samePosition_triangles2.unitypackage”.
The CreateOverlapColliders.cs is like this.
4847492--466259--capture1.png

Perhaps unity import package system in my development environment may not work well.

Anyway, I added the above code and “Remove same position triangles” worked well.
Thank you.
4847492--466265--capture2.png
4847492--466268--capture3.png

I’ve got a couple of questions —

  1. Does this grid thing still work if the edges don’t collide 100% in the same position?
    For example, let’s say I have amorphously-squared rock volumes that I lay around on a grid that actually go over the size of a single standard grid square in all three dimensions. In a lot of places, they’d overlap, but around edges or as a wall or corner, some parts should be culled but not others. Would this remove those triangles that are overlapped?

  2. Also, how costly would this be in terms of hard-disk space at runtime or in the project (since most of these rocks would be instanced and mostly identical in my project)? – I’m worried that a new mesh would have to be created for all of these rock volumes and stored in the project indefinitely (despite them essentially being the same rock).

1). Yes it would remove them, MCS removes triangles that are inside another mesh, for the same position overlap I added a slight scale up of the other mesh of 1mm to include if the vertex is on the surface of the mesh.

2). Indeed combining adds to memory usage, but the geometry % you remove also makes the same % of less memory it uses compared to traditional combining. So if you remove 60% of geometry the mesh uses 60% less memory. How much that would be depends on how many vertices you use multiplied by memory usage per vertex. E.g. position (Vector3 = 12 bytes) + normals (Vector3 = 12 bytes) + tangents (Vector4 = 16 bytes) + uv (Vector2 = 8 bytes) = ~42 bytes per vertex. Also on disk this gets compressed by Unity (in the build).

1 Like

Indeed. I was mainly trying to figure out how well this approach might fare against just instancing the same meshes at runtime (and keeping the overdraw). I’d really like to have the best of both worlds since I’m using volumes of smaller repeated similarly sized meshes to make the world, but I’m not terribly sure how I might approach that with your setup to eliminate overdraw. Any ideas?

Can you show a screenshot of how it looks and one with wire-frame?

I’m trying MCS with the Cave add-on to remove tris from a bunch of cliff rock meshes that intersect the terrain. However, I’m having a little trouble with the mesh colliders. I need mesh colliders because the top surfaces of these cliff rocks are walkable. But:

  1. On some meshes, the MCS-generated mesh collider doesn’t match the mesh render – it’s higher, and so the player-character walks about a meter above the mesh surface. Very odd, and only happens with some meshes. Any idea what could be going on there?

  2. On my original prefabs, I have a mesh collider on LOD0 and box colliders on other LODs (necessary for NPC collision detection). But MCS puts mesh colliders on all LODs. Is there a way for MCS to transfer the colliders that I’ve set up?

thx
Dave

  1. Can you DM me the mesh on which it happens? I didn’t have this issue so far.
  2. That must be a bug, will look into fixing it.

If you disable the Add MeshColliders option, which leaves the original colliders intact, does it work then?

4853753--467111--upload_2019-8-13_17-16-24.png

4853753--467108--upload_2019-8-13_17-14-42.png

4853753--467114--upload_2019-8-13_17-19-30.png

This is basically the idea. That one rock is repeated. The instances inside the box would be removed.

It will work with MCS. How many vertices and triangles does your rock mesh have? It looks a bit expensive, probably best to use Lods for it.

The other option would be to use instancing and have each rock face as a separate instance. In both cases you could have more variations to break the tiling. MCS will always be faster, but will use more memory so you have to evaluate if the memory usage is acceptable. Another possibility to use less memory would be to use normal cubes with MCS and use distance based tessellation on them with a displacement map.

I’ve just purchased the MCS Cages and Overhangs addon and am taking it for a spin. One thing I’ve noticed is that the licensing info in the downloaded package is different from that on the Asset Store. I assume the license file in the package needs an update?

Also, MCS itself and the Caves & Overhangs add on package have different licenses on the Asset Store itself. Is that deliberate?

In any case, I just pointed MCS at one of my outdoor island scenes and am pretty excited by the results. For what it’s worth, I’d pay far more than the asking price for this.

Thanks for the purchase. Can you show me some screenshots of what you mean? I don’t get a license file when importing the package.

Just PM’d you. Don’t need them cluttering up this thread!

Ah yes I forgot to update the readme. Thanks for telling, I will fix it for the next update.

1 Like

Hello,

can you link the rocks used in the video ? you said they are from asset store.

Thank you.