Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/supremepanda/gpuinstancemanager
Easy to use GPU instance manager for Unity.
https://github.com/supremepanda/gpuinstancemanager
batching gpu-instancing optimization performance unity unity-asset unity3d
Last synced: 3 months ago
JSON representation
Easy to use GPU instance manager for Unity.
- Host: GitHub
- URL: https://github.com/supremepanda/gpuinstancemanager
- Owner: supremepanda
- License: mit
- Created: 2023-02-23T20:11:16.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-12T22:29:16.000Z (11 months ago)
- Last Synced: 2024-06-06T11:45:02.233Z (8 months ago)
- Topics: batching, gpu-instancing, optimization, performance, unity, unity-asset, unity3d
- Language: C#
- Homepage:
- Size: 68.4 KB
- Stars: 36
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GPU Instance Manager
[![Unity 2019.1+](https://img.shields.io/badge/unity-2019.1%2B-blue.svg)](https://unity3d.com/get-unity/download)
[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://github.com/supremepanda/GPUInstanceManager/blob/master/LICENSE)
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/furkanbaldir)GPU Instance Manager provides a lot of batch savings to improve your game performance in Unity. GPU Instancing is a good way to improve your performance issues and also battery usages. Without GPU Instancing, Unity draws every single mesh one by one. For example, you have 300 cubes, Unity will create 300 draw call so there will be 300 batch (too bad). With this asset, you can draw 300 cubes using only 1 draw call. (Without shadows etc.)
### Installation
1. You can add git url via **Package Manager => Add package from git url**
```
https://github.com/supremepanda/GPUInstanceManager.git#upm
```2. You can also install via git url by adding this entry in your **manifest.json**
```
"com.supremepanda.gpu_instance_manager": "https://github.com/supremepanda/GPUInstanceManager.git#upm"
```### When should I use GPU Instancing?
- If you are using same mesh and same material more than one. (bullets etc.) and
- If your objects can not be static. (If you can use static, use static and do not use gpu instancing)### How to use?
1. Add **GPUInstanceService** prefab to your scene.
2. Add **GPUInstanceComponent** to your object that it exists MeshRenderer and MeshFilter.
=> On GPUInstanceComponent, **uniqueMeshId** field provides using ability with same mesh and different materials at the same time. If you want to use your mesh with different material variations, you should give an integer id to separate your components. Otherwise, it is always be 0 (zero) and all meshes will be draw with same material.
Your component sends its data to GPUInstanceManager to add, update or remove itself. So, that 's all.### Important notes
- If your gameobject has not MeshRenderer or MeshFilter, you should uncheck auto-find checkboxes and assign manually. (Also you can always set your mesh, material and transform target assignments manually.)
- This asset provides only 1023 meshes at the same time. If you want more than, do not use this asset. (for now.. It will be added with next updates.)