Search Issue Tracker
By Design
Votes
0
Found in [Package]
12.0.0
Issue ID
1329450
Regression
No
[URP] unity_LightData and unity_SpecCube0_HDR equal to 0 on build, for render pass that use CommandBuffer.DrawMeshInstanced
How to reproduce:
1. Open attached project "450_12_repro.zip"
2. Build the project
3. Start the build
Expected result: The color of the 9 circles is the same color compared to the color in the Editor - white
Actual result: The color of the 9 circles is different - black
Reproducible with - 7.5.2 (2019.4.25f1), 10.4.0 (2020.3.5f1), 11.0.0 (2021.1.5f1), 12.0.0 (2021.2.0a15)
Not reproducible with - 2018.4.33f1 (no URP)
Comments (1)
-
liyonghelpme3
Nov 12, 2021 15:55
so no way to use command buffer to optimise rendering
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
- Texture displays visual artifacts and has a broken aspect ratio when it is imported in RGB 48-bit format
- Diagnostic Warning Resets When Navigating Away and Returning to Diagnostics Settings
- Checkbox Collides with Text in Shader Graph Preferences Settings
- Crash on mecanim::animation::TransformValuesFromClip when entering the Play Mode in a project with Animancer Pro v8
- Connection to Named Pipes fails when server and client are run
Resolution Note:
When drawing with command buffers you are taking a shortcut to the graphics device to issue a draw instanced command - this means that there is _no_ calculation for per object data like light info or spherical harmonics or similar.
if you wish to have Unity calculate this for you then you need to emit these as an intermediate renderer in an Update call per frame. This means they will be part of the normal scene processing (which happens at culling time) and the per instance data will be generated.
My recommendation is to emit this geometry at scene time with your attached material using Graphics.DrawMeshInstanced - then in your renderpass do a drawrenderers using your pass name on the context. This should result in all the per instance data being configured as you would expect.