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
- 2D Light Textures show the lights of any 'blend style' index higher than theirs (if present) when they aren't visible by the Camera using Render Graph
- [SpeedTree] Wireframe mode not rendering correctly ST assets
- Light2D affecting only the Default Sorting Layer will also affect any Custom Lit Sprite not on that Layer when using Render Graph
- Decals do not get projected onto a GameObject draw with the Render Objects Renderer Feature when according to Event it should be projected
- The Depth value is not being written correctly in the Scene view when the Full Screen Pass Renderer Feature is applied on a GameObject with the Render Object Feature
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