Mojira Archive
MCM-1888

Changing stencilRef in entity materials does not cause pipeline state updates

Partner Rank: 3 (Normal)

Verification Builds:

  • 1.21.50.26 (Windows 10, Partner Build)
  • 1.21.50.26 (Windows 10, Retail Build)

Regression Builds: -

Summary: If you render multiple identical materials on the entity back to back, but with different stencilRef values, all draw calls will use the same stencilRef value of the first material to be rendered. In other words, it appears that the game does not update render pipeline state if materials being rendered are identical, however for some reason changes to stencilRef do not cause any pipeline state updates either, when they should. In order to force the engine to apply correct StencilRef changes, we have to render dummy geometry in-between draws or by making sure that materials are different in some other way, which would cause pipeline state to update (see expected.png).

Affects currently Live Content: No

Impact: We are constantly working with advanced visual effects that often include stencil operations, and this is an issue that we definitely have to be on the lookout for at all times, and occasionally work around it with dummy draw calls or additional material changes.

Repro Steps:

  1. Open the game through PIX (or other) graphics debugger
  2. Create a new world with attached add-on applied and enabled cheats
  3. Run /summon example:bug command in chat
  4. Look at the entity and take a frame capture with a graphics debugger
  5. Inspect graphics API calls for rendering of this entity

Observed Results: StencilRef is set only once, before the first draw call and is used for both calls (see observed.png)

Expected Results: StencilRef and potentially other pipeline changes will occur in-between the first and second draw calls, as the second material being rendered uses a different stencilRef value (see expected.png).

Screenshots/Videos attached: Yes, screenshots of the frame capture are attached

Notes: Repro steps in this report are aimed more towards developers rather than testers, but if simpler steps are required for verification, please let me know.

Works As Intended

Veka0

2024-11-03, 12:08 AM

2024-11-07, 07:21 PM

2024-11-07, 07:21 PM

0

1

1.21

-