GPU Instancer Pro:FAQ
About GPU Instance Pro | Getting Started | Terminology | Best Practices | API Documentation | F.A.Q. | Support
Contents
- 1 General Questions
- 1.1 What is new in GPU Instancer Pro?
- 1.2 How can I upgrade my project from GPU Instancer to the Pro version?
- 1.3 Can I use Crowd Animations extension with GPU Instancer Pro?
- 1.4 What are the Minimum Requirements?
- 1.5 What are the Known Limitations?
- 1.6 How can I convert shaders manually to support GPU Instancer Pro?
- 1.7 How can I Setup my Instances to have Material Variations on them?
- 1.8 How Can I Use a no-GameObject Workflow?
- 1.9 How Can I Use Multiple Cameras?
- 1.10 How does GPU Instancer work?
- 1.11 How is GPUI Different from the Unity Material GPU Instancing Option?
- 1.12 What are the Build Settings for Android platforms?
- 2 Troubleshooting
General Questions
What is new in GPU Instancer Pro?
The system has undergone a complete redesign with numerous performance and quality-of-life improvements, catering to a broader range of use cases. GPU Instancer Pro requires Unity 2022.3 or higher to take advantage of the latest Unity features. Here are some key highlights of the Pro version:
Core Module
Centralized Rendering System: The Pro version features a centralized rendering system, allowing for efficient rendering of objects with minimal draw calls and compute shader calculations. This leads to improved GPU memory usage and overall performance. With the centralized rendering system, the use of GPUI Managers is optional. Users have the option to render objects with few API calls directly from their scripts without the need for GPUI Managers in the scene.
Improved Draw Call Batching: GPU Instancer Pro can batch draw calls from different managers/scripts when they are using the same prefabs.
Native Support for Multiple Cameras: The Pro version enables users to seamlessly use multiple cameras. By simply adding the GPUICamera component to the cameras, users can utilize multiple cameras without any additional adjustments.
Profile Scriptable Object: The settings related to rendering (culling, LOD, etc.) are stored in a Profile Scriptable Object, which is shared between prototypes (eliminating the need for Prototype Scriptable Objects). Profile Settings are written to persistent GPU buffers instead of sending the data to GPU every frame. This reduces the number of files, simplifies the addition/removal of prototypes, and optimizes GPU data transfer.
Distributed in Packages Folder: To enhance workflow efficiency, GPU Instancer Pro is structured into multiple modules, each shipped as individual packages.
Improved Editor Mode Rendering: Significant improvements have been made to the performance and user experience of rendering instances in edit mode.
Statistical Analysis: The Statistics Tab on the GPUI Managers offers detailed information on GPU Instancer rendering, including vertex counts and visible LOD counts. This data allows users to identify performance bottlenecks and optimize their projects effectively. Additionally, users can enable/disable rendering of individual prototypes with a single click to assess the performance impact of each prototype.
Terrain Module
Native Support for Multiple Terrains: The Detail and Tree Managers now natively support multiple terrains, minimizing draw calls and efficiently handling runtime changes with reduced allocations.
Distance-based Detail Density Reduction: The Detail Manager introduces new features to decrease the number of distant detail instances, enhancing performance while maintaining visual quality.
Coverage Mode Support: The Pro version supports both 'Instance Count' and 'Coverage' options for the Detail Scatter Mode terrain setting.
Terrain Holes Support: In the Pro version, the Detail Manager now accounts for terrain holes when generating detail instances.
Improved Add/Remove Functionality: Users can add and remove detail and tree instances at runtime with improved performance, enhancing the flexibility and usability of the terrain system.
Prefab Module
Improved Prefab Instance Add/Remove Operations: The Prefab Manager has enhanced performance and ease of use for adding and removing instances.
Material Variations: The Pro version includes tools to automatically create material variations without coding.
The primary objectives of these enhancements are to improve performance, flexibility, and ease of use. If you have any specific recommendations or features you'd like to see in the Pro version, please feel free to share them.
How can I upgrade my project from GPU Instancer to the Pro version?
GPU Instancer Pro has a new design and data structure and it is not possible to automatically upgrade from the GPU Instancer to the Pro version. Despite this, the Pro version maintains similar workflows and includes Prefab, Tree, and Detail managers, allowing you to set up these managers in the scene in a very similar manner. However, it's important to note that all API methods have changed, rendering any previous code for GPU Instancer incompatible with the Pro version.
Can I use Crowd Animations extension with GPU Instancer Pro?
The Crowd Animations extension for GPU Instancer Pro is currently in development. It is being redesigned and improved for the Pro version and will be released as a separate asset. Therefore, Crowd Animations cannot yet be used with GPU Instancer Pro.
What are the Minimum Requirements?
GPU Instancer Pro supports Unity 2022.3 or higher LTS versions.
The target devices should support GPU instancing and Compute Shaders.
What are the Known Limitations?
There are certain limitations that are introduced by the way Indirect GPU instancing works and/or how Unity handles it. Below you can find a list of the known limitations.
Lighting Limitations:
- Baked Global Illumination is not supported for instanced prototypes (baked lighting data will be ignored for GPUI instances, but you can use it for the rest of the scene objects)
- Light Probes are not supported (all the instances share the same probe value).
- Ray Tracing is not supported.
Shader Limitations:
- Geometry shaders are not supported.
- Tesselation shaders are not supported
Miscellaneous Limitations:
- Negative scaling on GameObjects is not supported.
How can I convert shaders manually to support GPU Instancer Pro?
See Shader Setup Guide.
How can I Setup my Instances to have Material Variations on them?
See Material Variations.
How Can I Use a no-GameObject Workflow?
How Can I Use Multiple Cameras?
How does GPU Instancer work?
The aim of GPUI is to provide an easy to use interface to use indirect instancing without having to go through the learning curves of (or extensive development times of) GPU programming and Compute Shaders. To provide this, GPUI analyzes a prefab (or Unity terrain) and uses indirect instancing to render its instances (or detail/tree prototypes). Upon sending the mesh and material data to the GPU once, GPUI creates various GPU buffers and dispatches Compute Shaders on every frame to manipulate the instance data in these buffers. This approach takes the load completely off the CPU and uses the GPU for all rendering processes - so that the CPU threads work more efficiently for game scripts. GPUI also uses different optimization techniques to effectively work on different platforms; so that whether the target platform is a high-end PC, VR, or a modern mobile device, GPUI provides the best indirect instancing strategy.
If you're not familiar with these concepts, you can take a look at the Terminology Page for more information. In any case, here is a basic primer on GPU instancing:
(Indirect) GPU instancing works by sending mesh/material data to the GPU in a single draw call. This reduces the amount of batching to one even if there are hundreds or even thousands of the same mesh/material combination. This removes the bottleneck that occurs when sending mesh and material data from CPU to the GPU, and results in higher fps if there are many of the same mesh-material combinations. That is, GPU instancing helps in scenarios where you have many instances of the same game object.
How is GPUI Different from the Unity Material GPU Instancing Option?
Untiy provides instancing support by using the "Enable GPU instancing" option in Unity Standard and Surface shaders. When you use this option, Unity will handle frustum culling and culling by baked occlusion maps automatically. However, when using this option, Unity will group together instances and issue a draw call for every 500 instances in Direct3D and 125 instances in OpenGL ES 3, OpenGL Core, and Metal. The reason for this limitation is that Unity is aiming to support as many devices as possible, and older devices have a smaller GPU buffer size.
Other options in Unity are the RenderMeshInstanced and the RenderMeshIndirect scripting APIs. The former allows for 1023 instances per batch, and the latter does not have a limit. However, when using both of these options, you need to manage frustum, occlusion and distance culling for your instances manually.
GPU Instancer uses the indirect instancing method in the background and manages all culling operations in the GPU by making use of Compute Shaders. Furthermore, GPUI gives you a user friendly interface to add indirect instancing support for your Prefabs (with LOD groups, child hierarchies etc.) and your Unity Terrains in a few clicks - without writing any code. Since GPUI automatically generates a copy of the original shader of the material that it configures to work with itself, you are also not limited to using the Standard and Surface shaders and can use most custom shaders out of the box with it.
GPUI also builds additional features on its core by allowing you to use shadows, select shadow LODs, add/remove/update instances automatically, generate billboards and a lot more. Advanced features also include support for a no-game object workflow through an easy to use scripting API.
What are the Build Settings for Android platforms?
GPUI relies heavily on Compute Shaders for its operations in the GPU. In mobile platforms, Compute Shaders are usually supported by the higher-end devices. The requirement for Compute Shaders in the Android systems is at least Open GL ES 3.1 or the Vulkan API.
GPUI does not need any additional settings when targeting Vulkan; however, you need to enable Open GL ES 3.1 support when targeting the Open GL ES API.
To do this, you can simply enable the Require ES3.1 checkbox under:
Edit->Project Settings->Player->Other Settings
.
Otherwise Unity will disable the Compute Shaders and your build will run without GPUI enabled.
Please also note that older versions of Unity have some bugs for some of the GPU models on Android devices. If you're working on an Android game, it is recommended to use the latest Unity LTS version.
Troubleshooting
I See Artifacts / Instances don't Show / Show at Incorrect Locations when Using a Custom Shader
If you are using a custom vertex/fragment shader, the shader needs to be setup for instancing. GPUI Pro sets shaders up for working with itself, but cannot automate general instancing setup since there is no good way to generalize this.
If you are using a custom shader on your instances, or if you are using an asset from the Asset Store, this will most likely be the reason why your instances do not show correctly. To setup your shaders with GPUI Pro in this case, you can take a look at setting vertex/fragment shaders up manually to work with GPU Instancer Pro.
How can I make a Clean Installation of GPU Instancer Pro?
When upgrading Unity or GPU Instancer Pro, or when there have been issues with the import process of the assets, it might be necessary to perform a clean installation to resolve the issues.
To perform a clean installation of GPU Instancer Pro, follow these steps:
1. Backup Your Project:
Before making any changes, ensure you have a backup of your project. This is crucial to avoid any data loss.
2. Remove Existing GPU Instancer Pro Files:
- Main GPU Instancer Pro files are located under the 'Packages' folder. To remove the GPU Instancer Pro packages:
1. Open the Package Manager (Window -> Package Manager). 2. Select 'Packages: In Project'. 3. Select each GPU Instancer Pro package and click on the 'Remove' button.
- GPU Instancer Pro creates user files under Assets/GPUInstancerPro folder. You can optionally also remove this folder if there are no user files you want to keep.
3. Close and re-open your Unity project.
4. Import GPU Instancer Pro:
1. Open the Package Manager (Window -> Package Manager) 2. Select 'Packages: My Assets' and find the GPU Instancer Pro. 3. First click on the 'Update' button if there is an update available. Then click on the 'Import' button.