- Home /
How to carve/delete/erase out mesh.
How to create the carving part as seen in https://play.google.com/store/apps/details?id=com.clean.road and https://play.google.com/store/apps/details?id=com.water.balls games. Does it have any particular term which could help in research.
This looks like a duplicate of this one:
https://answers.unity.com/questions/1621804/how-to-make-snow-like-in-this-video.html
$$anonymous$$asking makes sense for the 1st one. So i think mesh manipulation is happening in the 2nd link link text Or is there other methods as well to implement that thing?
Answer by lgarczyn · Oct 04, 2019 at 08:50 PM
It's... complicated. The term you're looking for is procedural mesh geometry.
The easiest way to do it is to use shaders. You can use stencils and depth testing to make any part of a mesh A inside a mesh B invisible, and only render the mesh B if it is inside the Mesh A. That allows you for example to have a hole inside a mesh. However, that won't help you with physics or large numbers of meshes.
Another way is to have tons of meshes that you delete, move or replace as needed. Think a simple version of Minecraft. This allows you to have apparently destructible buildings, but it's actually just a bunch of meshes losing their kinematic status.
Another simple way is the Terrain component of Unity. It allows you to load a bitmap as a terrain, and to update it inside the game using a few functions. Think sims-city or Cities Skyline.
The hard way is to calculate all mesh vertices that need to be deleted, all that need to be created, and update the mesh accordingly.
https://docs.unity3d.com/Manual/GeneratingMeshGeometryProcedurally.html https://www.reddit.com/r/Unity3D/comments/7gefbs/how_we_created_destructible_terrain_in_our_game/
Your answer
Follow this Question
Related Questions
How to make a cube with metallic look and soft edges [pic included] 1 Answer
Render mesh in front of another mesh but not in general 2 Answers
Change material on multiple objects when nav mesh agent reaches waypoint 0 Answers
URP 2D lights with Mesh Renderer?,URP 2D Light for Mesh Renderer? 0 Answers
How can you make a Sprite Shader that properly uses the z coordinate? 1 Answer