- Home /
Clipping meshes outside certain volumes.
What is the best way to only render the parts of a mesh within a certain volume (will be a rectangular or triangular prism)? I will have multiple pairs of meshes and masking volumes, so using a depth mask shader may not work unless there is a way to match a particular mask with a particular mesh.
I am using this for a game in which the player can construct buildings on tiles on a spherical planet. The planet will either be tiled with rectangles or spheres. Since it isn't generally possible to tile a sphere with identical shapes, some of the tile shapes will invariably be slightly different. I would like a way to clip the buildings so that the only rendered portion of the mesh is the part that is "above" the correct tile.
The best method for doing something like that would be a shader. Have a look into clipping shaders