GPU Instancer Logo


Getting Started


GPU Instancer consists of three main Monobehavior classes called Prefab Manager, Detail Manager and Tree Manager.


GPU Instancer Prefab Manager


Add Prefab Manager
GPU Instancer -> Add Prefab Manager


By adding your prefabs to the GPU Instancer Prefab Manager, the prefab instances you add to your scenes are automatically rendered by GPU Instancer. It also provides additional functionality such as adding/removing instances at runtime, changing material properties per instance, and enabling/disabling GPU Instancing and Rigidbodies on instanced objects (at a specified area) at runtime. Note that prefab manager only accepts user created prefabs. It will not accept prefabs that are generated when importing your 3D model assets.

In the Inspector window, press the "?" button at the top-right corner to get detailed information about setting up the manager.

Click on the descriptions below to see details.


Auto Select Camera: When checkbox is active, GPU Instancer will use the first camera with the "MainCamera" tag at startup. If the checkbox is inactive, the desired camera can be set manually. GPU Instancer uses this camera for various calculations including culling operations.
Use Frustum Culling: toggles frustum culling globally for all the prototypes in this manager. If turned on, you can still turn frustum culling off for individual prototypes.
Use Occlusion Culling: toggles occlusion culling globally for all the prototypes in this manager. If turned on, you can still turn occlusion culling off for individual prototypes. Please note that occlusion culling may lag if the FPS falls to extremely low levels. If this is a possiblitiy, it could be better to turn it off.
Register Prefabs In Scene: This button can be used to register the prefab instances that are currently in the scene, so that they can be used by GPU Instancer. For adding new instances at runtime check API documentation.
Add: Click on this button and select a prefab to add a prefab prototype to the manager.
Is Shadow Casting: specifies whether the object will cast shadows or not. Shadow casting requires extra shadow passes in the shader resulting in additional rendering operations. GPU Instancer uses various techniques that boost the performance of these operations, but turning shadow casting off completely will increase performance.
Max Distance: defines the maximum distance from the selected camera within which this prototype will be rendered.
Is Frustum Culling: specifies whether the objects that are not in the selected camera's view frustum will be rendered or not. If enabled, GPU Instancer will not render the objects that are outside the selected camera's view frustum. This will increase performance. It is recommended to turn frustum culling on unless there are multiple cameras rendering the scene at the same time.
Frustum Offset: defines the size of the area around the camera frustum planes within which objects will be rendered while frustum culling is enabled. GPU Instancer does frustum culling on the GPU which provides a performance boost. However, if there is a performance hit (usually while rendering an extreme amount of objects in the frustum), and if the camera is moving very fast at the same time, rendering can lag behind the camera movement. This could result in some objects not being rendered around the frustum edges. This offset expands the calculated frustum area so that the renderer can keep up with the camera movement in those cases.
Is Occlusion Culling: specifies whether the objects that are occluded by other objects will be rendered or not. If enabled, GPU Instancer will not render the objects that are behind others and would normally not be visible. This will increase performance. It is recommended to turn occlusion culling on unless there are multiple cameras rendering the scene at the same time.
LOD Cross-Fade: enables cross-fade style blending between the LOD levels of this prototype. This can have a minor impact on performance since during the cross-fading, both LOD levels will be rendering.
Animate Cross-Fading: animates the cross-fading instead of it being distance based. The animation starts with the first occurance of the changed LOD. During the animation, both LOD levels will be rendered.
LOD Fade Transition Width: can use the "LOD Fade Transition Width" value to define the cross-fading zone at between LOD Levels. This zone is the distance in which the prototype LODs are cross faded. Higher numbers result in wider transition zones. In the transition zone, both LOD levels will be rendered.
LOD Bias Adjustment: effects the LOD level distances per prototype. When it is set to a value less than 1, it favors less detail. A value of more than 1 favors greater detail.
Enable Runtime Modifications: if enabled, transform data (position, rotation, scale) for the prefab instances can be modified at runtime with API calls.
Start With RigidBody: if enabled, prefab instances that have a RigidBody component will start with an active RigidBody and it will be active until they go to Sleep state (stop moving).
Add/Remove Instances At Runtime: if enabled, new prefab instances can be added or existing ones can be removed at runtime with API calls
Extra Buffer Size: specifies the amount of prefab instances that can be added without reinitializing compute buffers at runtime. Instances can be added at runtime with API calls.
Auto. Add/Remove Instances: if enabled, new prefab instances will be added or existing ones will be removed automatically at runtime without API calls.
Auto. Update Transform Data: if enabled, transform updates on prefab instances will be made automatically at runtime without API calls.
Generate Billboard: if enabled, GPU Instancer will automatically generate a camera facing billboard of this prototype to use as its final LOD level. This billboard is made of a single quad mesh, and as such it can increase the performance for distant instances greatly.
Billboard Quality: defines the resolution of the billboard textures. Higher resolutions result in better looking billboards, but use more memory. Texture atlasses are not square for 2D billboards; so for example "2048" option results in a 2048x256 texture resolution.
Billboard Frame Count: defines the total amount of snapshots that are taken from different angles for this billboard. Higher frame counts result in more accurate view differences in different view angles, but result in lower resolution frames since they are all packed in the same atlas.
Replace LOD Culled With Billboard: if enabled, GPU Instancer will use the generated billboard instead of the "Culled" distance defined in this prototype's LOD Group. Deselect this option if you want to use a custom billboard distance.
Billboard Distance: defines the distance to the camera in which the prototype will render as the billboard. Increase this if you want the prototypes to switch to billboards further away from the camera.
Regenerate Billboard: this button regenerates the billboard atlases for this prototype and updates the current textures with the changed settings.
Show Billboard: this button instantiates a quad mesh at (0,0,0) position and shows the generated billboard on it. You can use this to inspect how the billboards will look like at runtime.



GPU Instancer Detail Manager




Add Detail Managers (Requires a terrain in scene)
GPU Instancer -> Add Detail Manager For Terrains


GPU Instancer Detail Manager takes over rendering of detail prototypes added to your Unity terrain. It comes with a grass shader which gives you the ability to customize how your grass will look on your terrain with a set of shader properties that can be edited from the manager.

In the Inspector window, press the "?" button at the top-right corner to get detailed information about setting up the manager.

Click on the descriptions below to see details.


Paint On Terrain: This button is used to navigate to the Unity terrain component that this manager is referencing. Details should be painted on the terrain using Unity's native tools as usual. Detail data on the terrain will be automatically detected by GPU Instancer.
Unset Terrain: This button is used to disable GPU Instancing on the terrain. It can later be enabled again by using the "Set Terrain" button.
Auto Select Camera: When checkbox is active, GPU Instancer will use the first camera with the "MainCamera" tag at startup. If the checkbox is inactive, the desired camera can be set manually. GPU Instancer uses this camera for various calculations including culling operations.
Use Frustum Culling: toggles frustum culling globally for all the prototypes in this manager. If turned on, you can still turn frustum culling off for individual prototypes.
Use Occlusion Culling: toggles occlusion culling globally for all the prototypes in this manager. If turned on, you can still turn occlusion culling off for individual prototypes. Please note that occlusion culling may lag if the FPS falls to extremely low levels. If this is a possiblitiy, it could be better to turn it off.
Simulate At Scene Camera: This button can be used to render the terrain details on the scene camera using the current GPU Instancer setup. This simulation is designed to provide a fast sneak peak of the GPU Instanced terrain details without having to enter play mode.
Max Detail Distance: defines the maximum distance from the camera within which the terrain details will be rendered. Details that are farther than the specified distance will not be visible. This setting also provides the upper limit for the maximum view distance of each detail prototype.
Detail Density: goes from 0.0 to 1.0, with 1.0 being the original density, and lower numbers resulting in less detail objects being rendered.
Wind Vector: specifies the [X, Z] vector (world axis) of the wind for all the prototypes (in this terrain) that use the "GPUInstancer/Foliage" shader (which is also the default shader for the texture type grass details). This vector supplies both direction and magnitude information for wind.
Healthy / Dry Noise Texture: can be used to specify the Healthy Color / Dry Color variation for all the prototypes that use the "GPUInstancer/Foliage" shader in this terrain (which is also the default shader for the texture type grass details). Texture type detail prototypes are also scaled by this noise. This image must be a greyscale noise texture.
Wind Wave Normal Texture: can be used to specify the vectors of all wind animations and coloring for all the prototypes that use the "GPUInstancer/Foliage" shader in this terrain (which is also the default shader for the texture type grass details). This image must be a normal map noise texture.
Auto SP Cell Size: Detail Manager uses spatial partitioning for loading and unloading detail instances from GPU memory according to camera position. Detail instances are grouped in cells with a calculated size. By selecting "Auto SP Cell Size", you can let the manager decide which cell size to use. If you deselect "Auto SP Cell Size", you can determine a "Prefered SP Cell Size".
Generate Prototypes: This button can be used to synchronize the detail prototypes on the Unity terrain and GPU Instancer. It will reset the detail prototype properties with those from the Unity terrain, and use default values for properties that don't exist on the Unity terrain.
Add: Click on this button and select a texture or prefab to add a detail prototype to the manager.
Is Shadow Casting: specifies whether the object will cast shadows or not. Shadow casting requires extra shadow passes in the shader resulting in additional rendering operations. GPU Instancer uses various techniques that boost the performance of these operations, but turning shadow casting off completely will increase performance.
Max Distance: defines the maximum distance from the selected camera within which this prototype will be rendered.
Is Frustum Culling: specifies whether the objects that are not in the selected camera's view frustum will be rendered or not. If enabled, GPU Instancer will not render the objects that are outside the selected camera's view frustum. This will increase performance. It is recommended to turn frustum culling on unless there are multiple cameras rendering the scene at the same time.
Frustum Offset: defines the size of the area around the camera frustum planes within which objects will be rendered while frustum culling is enabled. GPU Instancer does frustum culling on the GPU which provides a performance boost. However, if there is a performance hit (usually while rendering an extreme amount of objects in the frustum), and if the camera is moving very fast at the same time, rendering can lag behind the camera movement. This could result in some objects not being rendered around the frustum edges. This offset expands the calculated frustum area so that the renderer can keep up with the camera movement in those cases.
Is Occlusion Culling: specifies whether the objects that are occluded by other objects will be rendered or not. If enabled, GPU Instancer will not render the objects that are behind others and would normally not be visible. This will increase performance. It is recommended to turn occlusion culling on unless there are multiple cameras rendering the scene at the same time.
LOD Cross-Fade: enables cross-fade style blending between the LOD levels of this prototype. This can have a minor impact on performance since during the cross-fading, both LOD levels will be rendering.
Animate Cross-Fading: animates the cross-fading instead of it being distance based. The animation starts with the first occurance of the changed LOD. During the animation, both LOD levels will be rendered.
LOD Fade Transition Width: can use the "LOD Fade Transition Width" value to define the cross-fading zone at between LOD Levels. This zone is the distance in which the prototype LODs are cross faded. Higher numbers result in wider transition zones. In the transition zone, both LOD levels will be rendered.
LOD Bias Adjustment: effects the LOD level distances per prototype. When it is set to a value less than 1, it favors less detail. A value of more than 1 favors greater detail.
Detail Density: goes from 0.0 to 1.0, with 1.0 being the original density, and lower numbers resulting in less detail objects being rendered.
Detail Scale: can be used to set a range for the instance sizes for detail prototypes. For the texture type detail prototypes, this range applies to the "Healthy / Dry Noise Texture" above. The values here correspond to the width and height values for the detail prototypes in the Unity terrain. X: Minimum Width - Y: Maximum Width Z: Minimum Height - W: Maximum Height
Noise Spread: property specifies the size of the "Healthy" and "Dry" patches for the Detail Prototypes that use the "GPUInstancer/Foliage" shader. This corresponds to the "Noise Spread" propety of the detail prototypes in the Unity terrain. A higher number results in smaller patches. The Healthy / Dry noise texture can be changed globally for all detail prototypes that use the "GPUInstancer/Foliage" shader from the "Healthy/Dry Noise Texture" property above.
Use Custom Material: can be used to specify that a custom material will be used for a detail prototype instead of the default generated material that uses the "GPUInstancer/Foliage" shader. Note that Cross Quads are available for custom materials as well, but their ability to billboard at a distance will not be avalilable since GPU Instancer handles billboarding in the "GPUInstancer/Foliage" shader.
Custom Material: can be used to specify the custom material to use for a detail prototype instead of the default "GPUInstancer/Foliage" shader. The shader that this material uses will be automatically set up for use with GPU Instancer. This process creates a copy of the original shader (in the same folder) that has the necessary lines of code. Note that this process will NOT modify the material.
Cross Quads: if enabled, a mesh with multiple quads will be generated for this detail texture (instead of a single quad or billboard). The generated quads will be equiangular to each other. Cross quadding means more polygons for a given prototype, so turning this off will increase performance if there will be a huge number of instances of this detail prototype.
Quad Count: defines the number of generated equiangular quads for this detail texture. Using less quads will increase performance (especially where there will be a huge number of instances of this prototype).
CQ Billboard Distance: When Cross Quads is enabled, "Cross Quad Billboard Distance" specifies the distance from the selected camera where the objects will be drawn as billboards to increase performance further. This is useful beacause at a certain distance, the difference between a multiple quad mesh and a billboard is barely visible. The value used here is similar to the screenRelativeTransitionHeight property of Unity LOD groups.
CQ Distance Debug: When Cross Quads is enabled, "Cross Quad Billboard Distance Debug" can be used to test the Cross Quad billboarding distance.
Billboard: if enabled, the generated mesh for this prototype will be billboarded. Note that billboarding will turn off automatically if cross quads are enabled.
Detail Healthy Color: "Healthy" color of the the Healthy / Dry noise variation for the prototypes that use the "GPUInstancer/Foliage" shader. This corresponds to the "Healhy Color" property of the detail prototypes in the Unity terrain. The Healthy / Dry noise texture can be changed globally (terrain specific) for all detail prototypes that use the "GPUInstancer/Foliage" shader from the "Healthy/Dry Noise Texture" property above.
Detail Dry Color: "Dry" color of the the Healthy / Dry noise variation for the prototypes that use the "GPUInstancer/Foliage" shader. This corresponds to the "Dry Color" property of the detail prototypes in the Unity terrain. The Healthy / Dry noise texture can be changed globally (terrain specific) for all detail prototypes that use the "GPUInstancer/Foliage" shader from the "Healthy/Dry Noise Texture" property above.
Ambient Occlusion: The amount of "Ambient Occlusion" to apply to the objects that use the "GPUInstancer/Foliage" shader.
Gradient Power: "GPUInstancer/Foliage" shader provides an option to darken the lower regions of the mesh that uses it. This results in a more realistic look for foliage. You can set the amount of this darkening effect with the "Gradient Power" property, or turn it off completly by setting the slider to zero.
Wind Idle Sway: specifies the amount of idle wind animation for the detail prototypes that use the "GPUInstancer/Foliage" shader. This is the wind animation that occurs where wind waves are not present. Turning the slider down to zero disables this idle wind animation.
Wind Waves: specifies whether there will be wind waves for the detail prototypes that use the "GPUInstancer/Foliage" shader. The normals texture that is used to calculate winds can be changed globally (terrain specific) for all detail prototypes that use the "GPUInstancer/Foliage" shader from the "Wind Wave Normal Texture" property above.
Wind Wave Tint Color: is a shader property that acts similar to the "Grass Tint" property of the Unity terrain, except it applies on a per-prototype basis. This color applies to the "Wind Wave Tint" properties of all the objects that use the "GPUInstancer/Foliage" shader (which is also the default shader for the texture type grass details).
Wind Wave Size: specifies the size of the wind waves for the detail prototypes that use the "GPUInstancer/Foliage" shader.
Wind Wave Tint: specifies how much the "Wind Wave Tint" color applies to the wind wave effect for the detail prototypes that use the "GPUInstancer/Foliage" shader. Turning the slider down to zero disables wind wave coloring.
Wind Wave Sway: specifies the amount of wind animation that is applied by the wind waves for the detail prototypes that use the "GPUInstancer/Foliage" shader. This is the wind animation that occurs in addition to the idle wind animation. Turning the slider down to zero disables this extra wave animation.
Apply Changes To Terrain: button can be used to modify the Unity terrain component with the changes that are made in Detail Manager.

GPU Instancer Tree Manager


Add Tree Manager
GPU Instancer -> Add Tree Manager For Terrains


GPU Instancer Tree Manager takes over rendering of tree prototypes added to your Unity terrain. It comes with a billboard generator which gives you the ability to generate billboard atlasses out of the box for better performance while rendering trees.

In the Inspector window, press the "?" button at the top-right corner to get detailed information about setting up the manager.

Click on the descriptions below to see details.


Auto Select Camera: When checkbox is active, GPU Instancer will use the first camera with the "MainCamera" tag at startup. If the checkbox is inactive, the desired camera can be set manually. GPU Instancer uses this camera for various calculations including culling operations.
Use Frustum Culling: toggles frustum culling globally for all the prototypes in this manager. If turned on, you can still turn frustum culling off for individual prototypes.
Use Occlusion Culling: toggles occlusion culling globally for all the prototypes in this manager. If turned on, you can still turn occlusion culling off for individual prototypes. Please note that occlusion culling may lag if the FPS falls to extremely low levels. If this is a possiblitiy, it could be better to turn it off.
Max Tree Distance: defines the maximum distance from the camera within which the terrain trees will be rendered. Trees that are farther than the specified distance will not be visible. This setting also provides the upper limit for the maximum view distance of each tree prototype.
Generate Prototypes: This button can be used to synchronize the tree prototypes on the Unity terrain and GPU Instancer. It will reset the tree prototype properties with those from the Unity terrain, and use default values for properties that don't exist on the Unity terrain.
Add: Click on this button and select a prefab to add a prefab prototype to the manager.
Is Shadow Casting: specifies whether the object will cast shadows or not. Shadow casting requires extra shadow passes in the shader resulting in additional rendering operations. GPU Instancer uses various techniques that boost the performance of these operations, but turning shadow casting off completely will increase performance.
Max Distance: defines the maximum distance from the selected camera within which this prototype will be rendered.
Is Frustum Culling: specifies whether the objects that are not in the selected camera's view frustum will be rendered or not. If enabled, GPU Instancer will not render the objects that are outside the selected camera's view frustum. This will increase performance. It is recommended to turn frustum culling on unless there are multiple cameras rendering the scene at the same time.
Frustum Offset: defines the size of the area around the camera frustum planes within which objects will be rendered while frustum culling is enabled. GPU Instancer does frustum culling on the GPU which provides a performance boost. However, if there is a performance hit (usually while rendering an extreme amount of objects in the frustum), and if the camera is moving very fast at the same time, rendering can lag behind the camera movement. This could result in some objects not being rendered around the frustum edges. This offset expands the calculated frustum area so that the renderer can keep up with the camera movement in those cases.
Is Occlusion Culling: specifies whether the objects that are occluded by other objects will be rendered or not. If enabled, GPU Instancer will not render the objects that are behind others and would normally not be visible. This will increase performance. It is recommended to turn occlusion culling on unless there are multiple cameras rendering the scene at the same time.
LOD Cross-Fade: enables cross-fade style blending between the LOD levels of this prototype. This can have a minor impact on performance since during the cross-fading, both LOD levels will be rendering.
Animate Cross-Fading: animates the cross-fading instead of it being distance based. The animation starts with the first occurance of the changed LOD. During the animation, both LOD levels will be rendered.
LOD Fade Transition Width: can use the "LOD Fade Transition Width" value to define the cross-fading zone at between LOD Levels. This zone is the distance in which the prototype LODs are cross faded. Higher numbers result in wider transition zones. In the transition zone, both LOD levels will be rendered.
LOD Bias Adjustment: effects the LOD level distances per prototype. When it is set to a value less than 1, it favors less detail. A value of more than 1 favors greater detail.
Generate Billboard: if enabled, GPU Instancer will automatically generate a camera facing billboard of this prototype to use as its final LOD level. This billboard is made of a single quad mesh, and as such it can increase the performance for distant instances greatly.
Billboard Quality: defines the resolution of the billboard textures. Higher resolutions result in better looking billboards, but use more memory. Texture atlasses are not square for 2D billboards; so for example "2048" option results in a 2048x256 texture resolution.
Billboard Frame Count: defines the total amount of snapshots that are taken from different angles for this billboard. Higher frame counts result in more accurate view differences in different view angles, but result in lower resolution frames since they are all packed in the same atlas.
Replace LOD Culled With Billboard: if enabled, GPU Instancer will use the generated billboard instead of the "Culled" distance defined in this prototype's LOD Group. Deselect this option if you want to use a custom billboard distance.
Billboard Distance: defines the distance to the camera in which the prototype will render as the billboard. Increase this if you want the prototypes to switch to billboards further away from the camera.
Regenerate Billboard: this button regenerates the billboard atlases for this prototype and updates the current textures with the changed settings.
Show Billboard: this button instantiates a quad mesh at (0,0,0) position and shows the generated billboard on it. You can use this to inspect how the billboards will look like at runtime.