Search Issue Tracker

Won't Fix

Votes

0

Found in

2021.3.33f1

2022.3.16f1

2023.2.4f1

2023.3.0b1

Issue ID

UUM-59243

Regression

No

CommandBuffer.DrawMeshInstanced does not set unity_BaseInstanceID and decals flicker when splitting batches

--

-

How to reproduce:
1. Open the attached “RenderingCommandBuffers50b22.zip“ project
2. Open the “_DeferredDecals“ Scene (Assets/DefferedDecals)
3. Enter Play Mode

Expected result: Decals don’t flicker
Actual result: Decals are flickering

Reproducible with: 2021.3.33f1, 2022.3.16f1, 2023.2.4f1, 2023.3.0b1

Reproducible on: macOS 14.0 Sonoma (Intel)
Not reproducible on: No other environment tested

Notes:
- Also reproducible in Player
- The user noted that his goal was to add per-instance data to command buffer drawn deferred decals. A maximum of 1023 items per call can be drawn to DrawMeshInstanced, but if the data is too large it will split the call into multiple batches, in the user’s case, it does batches of 511, 511, and 1. The user used the instanceID property to look up data in an array that is set on the MaterialPropertyBlock, but the subsequent batches started to flicker
- Selecting the "LevelManager" GameObject in the Hierarchy and changing the "Max Batch Size" to around 500 or below (may vary on the machine) in the Inspector will cause the issue to stop from happening

  1. Resolution Note:

    Issue seems to be from incorrect instance property setup from the user's side. Modified shader file sent to customer. Please reopen if that did not fix it.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.