Search Issue Tracker
By Design
Votes
3
Found in [Package]
9.0.0-preview.33
Issue ID
1266291
Regression
No
[HDRP] Given shader doesn't use instancing variant when DrawProcedural() instance count is >1
How to reproduce:
1. Open attached "NoiseBall4.zip" project
2. Open Game Object's "Noise Ball" Inspector window
3. In the Script Component, notice that Instance Count is set to 8
4. Observe the Scene View
Expected result: 7 other instances of Noise Ball are visible to the right of the original
Actual result: Only one instance is visible
Reproducible with: 7.4.1 (2019.4.5f1), 8.2.0(2020.1.1f1), 9.0.0-preview.33(2020.1.1f1, 2020.2.0a19)
Could not test: 2018.4 (errors when updating the project)
Note:
- You can view the expected results by opening NoiseBall -> NoiseBall.shader, at line 309 change FORCE_INSTANCING_TO_BE_ON to 1
- FORCE_INSTANCING_TO_BE_ON defines "uint instanceID : SV_InstanceID;" rather than relying on UNITY_VERTEX_INPUT_INSTANCE_ID, which should be enabled if rendering with an instancing variant.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Channel remapping dropdown in the Terrain Layer does not open when clicked on the title
- The Editor freezes indefinitely when a large number of elements are entered in the Subgraphs or Categories lists
- Some Visual Effects package Assets links to documentation are not working
- Heatmap asset’s documentation button in the Inspector window leads to “Sorry... that page seems to be missing!” page when clicked
- Crash on MonoBehaviour::CallMethodIfAvailable when performing various actions
Resolution Note:
This is by design. Regular DrawProcedural calls will not use the built in batching instancing code and it is up to users to declare and use instance ID themselves. If you want to use the built in code for instancing you will have to use some thing like https://docs.unity3d.com/ScriptReference/Graphics.DrawMeshInstancedProcedural.html