TerraMesh
An API for terrain to mesh conversion and mesh manipulation
模組介紹 作者原文
TerraMesh
This is a simple plugin that allows conversion of Unity Terrains to Mesh objects. Based on a fork of Triangle.NET and includes all of its functionality. This is supposed to be used by developers, it doesn't do anything by itself!
How to use:
- Create an instance of meshing configuration TerraMeshConfig
- Use.Meshify method on the desired Unity Terrain object to turn it into mesh
- Obtain the material instance from the mesh renderer of newly created mesh terrain and run.SetupMaterialFromTerrain method to copy texture references from TerrainLayers
More information here:
Information
It has two ways of meshing:
- Uniform: if you don't provide a box collider it will apply a regular grid with a specified step size (1 = exactly the same as original, 2 = resolution halved, 3 = resolution/3, etc).
- Variable: Provide a box collider intersecting with your terrain and apply non-uniform meshing: within the box it will use min step size, outside the box the step will gradually increase towards the edges (only in multiples of two).
HIGHLY recommend to use the 2nd option!
- Falloff factor regulates how fast the step size changes.
- Use refine mesh option if you see very thin triangles appearing, this can happen if your terrain is rectangular or a very high falloff used with big maximum step, realistically this should be disabled in most cases.
- Copy trees toogle will save trees from your terrain as separate objects
- Carve holes toggle will carve holes in the mesh if they exist in your terrain.
Grass is NOT supported, probably won't be.
Performance considerations!
- Set your mesh terrain/trees objects to static and set the material of your trees/grass to use "GPU Instanced" option - this will allow batching, instead of rendering each object in separate draw calls.
- To keep rendering performance the same, your terrain should have less than 100k vertices, for vanilla sized moons the number is close to 20-30k.
- It automatically applies a mesh collider so be careful with high polygon counts! You can run the tool with lower quality and use the simpler mesh for the collider!
- Ideally, have a high res terrain for your playable area and low res outer terrain (w/o collider) to create a feeling of a vast environment.
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
前置依賴
下面這些內容需要先安裝,否則該模組不會生效:
BepInEx-BepInExPack