MeshCut Guide
- Last UpdatedAug 22, 2023
- 3 minute read
Meshcut feature for Particles System Renderer
Use the MeshCut feature to render particles inside volumes.

How it works
It creates a mask using the Meshes specified in the MeshCut parameters.
Example for drawWhenInside
-
The following examples use just one mesh, but you can specify multiple MeshCuts simultaneously.
-
Rendering MeshCut meshes does not make any visibility test. They always render when the particles that use them are visible. There is no command to show/hide the MeshCut meshes. Any show/hide calls to the original CMesh do not apply to the MeshCut rendering.
Note: In this example, the volume mesh faces are flipped inside so that they can be used for collisions.

The particles render only where the mask is 1 (white) when the drawWhenInside parameter is On.
Particles render only where the mask is 0 (black) when the drawWhenInside parameter is Off.

Example when the MeshCut is not needed
If particles are already colliding with the volume, then the MeshCut is not needed when the particles are so small that they are not rendered outside the volume.

Example for managing collision
You can tweaking the collision distance between the particles and the volume to render the particles inside the volume without using the MeshCut. This is because the particles would collide "before" the volume.
-
In the image on the left, the particles collide with the top of the volume.
-
In the image on the right, the particles collide way before the volume.
The volume is the same in both images. Only the collision distance parameters have changed.

Example for a Mesh inside the volume
In this example, there is a sphere model inside our volume, and the particles are not rendered because the sphere is creating a 'hole' inside the MeshCut mask. In fact, the sphere is nearer to camera than the volume mesh's front polygon. The volume mesh is rendered with the faces flipped.
By using the noZTest parameter, the volume mesh renders without checking the Z buffer. The mask is also written where the sphere is.

Example for entering the volume
In this example, we want to view the particles from both the outside and the inside of the volume.
-
In this case, the volume (1) has the faces flipped outside. From an outside camera, everything looks good (2).
-
When entering the volume, the faces no longer render (3) because they are on the back and are not visible from this camera.
-
The noFaceCull parameter renders both the front-facing and the back-facing faces (4). This makes the mesh doubleface.
-
You can enable the noZTest parameter (5) to render the particles over sphere.
