A Unity package for point sampling on meshes with both CPU and GPU backends. It's been tested on Unity 6.1 and is currently compatible with the Built-in Rendering Pipeline.
- Sample points from static, dynamic, and skinned meshes
- Update points based on mesh transform and deformation in runtime
- Multiple sampling strategies:
- Triangle-based sampling
- Vertex-based sampling
- Bone-based sampling (for skinned meshes)
- CPU and GPU backends with identical API
- Shader to render billboards points with occlusion support, points size scaling control, points count demultiplier, and points count scaling based on distance to camera
- WebGPU compatible
In your Unity project, open the Package Manager (Window > Package Management > Package Manager), click the "+" button, and select "Add package from git URL...". Enter:
[email protected]:probcomp/UnityMeshSampling.git
Add the following line to your manifest.json
file in your project's Packages
folder:
{
"dependencies": {
"com.probcomp.meshsampling": "[email protected]:probcomp/UnityMeshSampling.git"
}
}
This package has been tested with Unity's experimental WebGPU integration on version 6000.1.0b10. It has been verified on a MacBook with an M3 Max and tested with builds targeting WebGPU on Chrome Version 134.0.6998.89 (arm64).
To set up WebGPU in your Unity project, follow the instructions here: https://discussions.unity.com/t/early-access-to-the-new-webgpu-backend/933493
The package includes sample scenes demonstrating:
- Static and dynamic rigid mesh sampling
- Skinned mesh sampling
- Basic CPU sampling
- GPU sampling with visualization
Import samples through the Package Manager by selecting the package, going to the "Samples" tab, and clicking "Import".
CPU Sample Preview:
GPU Sample Preview:
For history of changes, see CHANGELOG.md.