The best performance possible by using the easiest way to get amazing looking caves and overhangs on any terrain solution.
The easiest way to create caves and overhangs (and best looking) is by placing rock models within Unity Editor (in conjunction with terrain). The issue is that it’s bad for performance because there’s a lot of rock geometry (triangles) that overlap with other rocks or are below the terrain. So many triangles are draw that are never visible and this also results in overdraw on the GPU which reduces performance. This MCS extension solves that issue in a few clicks and removes all rock triangles that are never visible. What we measured is that it removes ~60-75% of the rock triangles in our arenas.
It beats GPU Instancing by +300%, basically because cell based combining is already slightly faster but with only 1/3 of the original triangles to draw it’s obvious whose the winner.
Features:
Compatible with any rock Asset.
Compatible with Unity terrain, any Voxel terrain and terrain mesh solution.
Reduces draw calls by using cell-based combining
Much faster than GPU Instancing
Geometry reduction of ~60-80%
~3x faster to render
~3x less over draw on the GPU
~3x cheaper shadows
~3x reduced lightmap texture space needed (when using lightmapping)
~3x reduced memory needed compared to Static Batching or Classic Combining
This is pretty awesome! – I’ve been waiting a LONG time for something like this.
Does this run without MCS? I ask because it seems like this should be a built-in feature!
Also –
What is the suggested workflow for working with streaming terrain (with a floating origin) when using something like World Streamer with MCS (and this)? – Is this kind of use-case / workflow being considered?
Yes we were also thinking for quite some time how to solve this either use GPU instancing or remove the inside geometry. In our Arena Builder demo players were reporting performance issues when placing a lot of rocks together to make caves, floating islands, etc. Even someone put his GTX 1080 to it’s knees with like 30 fps on a massive floating island made out of rocks. So we decided to try the geometry removal and now that we have the results we’re glad we choose this path as performance and lightmapping results are great.
It’s an extension for MCS, so MCS is needed for it.
WorldSteamer and MCS should work really well together, because WorldStreamer divides the world into Scene cells and MCS combines into cells. So e.g. if your Scene cell is 512, MCS cell size can be 16/32/64. So Scene cell size needs to be dividable by MCS cell size. The way to go would to optimize the rocks in Unity Editor and WorldStreamer will save/load the rocks with the Scenes.
So basically just place all the rocks you want, do the few clicks with MCS to optimize them and WorldStreamer will take care of the rest. I have WorldStreamer and will look into the exact details.
Not that much, combining inside a Scene does increase it’s size, but then the removal decreases the size needed x3. Also the reduced lightmap (when using lightmapping) texture space needed reduces the texture size needed, so when using lightmapping you actually would save file size quite a bit.
Our arena Scene file that I show in the video is 43.7 MB, but the lightmap textures we use are 118 MB. So when not using it the Scene file would be a few MB, but ligthmap textures would be 118 * 3 = 355 MB with same quality results. So we actually save a lot.
Yes it can be used at runtime, although it can take some time to run the removal depending on how much overlap. I can make it a lot faster if Unity fixes the Collider.Raycast bug with Physics.queriesHitBackfaces turned on (Physics.Raycast works fine, but is slower as I need the raycast only on 1 collider at the time). It doesn’t work correctly. If you shoot a ray below a sphere it hits the back face on the top. I will do a bug report for this.
I’m curious, this is called “caves & overhangs” and emphasizes caves, but isn’t it just back-face culling and poly-removal from intersecting meshes?
I need something to do that, but I don’t have a bunch of (very pretty) cave assets, more a kitbash of sci-fi assets. Since this isn’t free (any more), I’d like to know if this is what I think it is versus some specialty thing just for “caves” against terrain (I have none), before purchase.
Yes the extension is adding poly removal for intersecting meshes, MCS 2 has back-face and below terrain removal. It works on any meshes that are closed. So for other things it works as well, but what I could mostly think of the use-case to high-light this special feature is on using rocks to make or add detail to caves and overhangs. So basically you can make nice looking caves & overhangs with terrain and rocks and optimize it as best as possible.
That’s exactly how my levels are constructed and that’s what I was asking about “backface culling”. From the author’s answer, I determined it won’t do squat for our type of construction. It sounds like it’s only good for clipping against a terrain mesh. MCS has a sort of super-clunky backface culling, but… it’s super clunky and requires a TON of specialized boxes all over.
In the current version it’s not working for vertices that are in the exact same position. MCS will only remove a triangle if it’s inside another collider. However I know a way to solve it…I will release an update tomorrow that supports this feature request.