mojira.dev
MC-254044

Draw call for rendering picked up items in core disables GL_DEPTH_TEST in post

Draw call for rendering picked up items in core disables GL_DEPTH_TEST in post.
This is caused by an additional glDisable(GL_DEPTH_TEST) after rendering picked up items while clouds are toggled off.

Steps to Reproduce:

  1. Launch MC with graphics debugger (like Nsight Graphics)

  2. Turn off Clouds.

  3. Observe GL_DEPTH_TEST state in post shaders GL_TRUE

  4. Pause the game while picking up an item (item mid flight)

  5. Observe GL_DEPTH_TEST state in post now GL_FALSE

  6. Trace back glDisable call to item pickup rendering.

Observed Results:
Draw call for rendering picked up items in core disables GL_DEPTH_TEST in post.
There is an additional glDisable(GL_DEPTH_TEST) after rendering picked up items. This poisoned state carries over to post shaders and makes it impossible to write to depth buffers only when picking up items with clouds toggled off.

Observe glitches in any shader resource packs that write to depth buffers. These depth writes are ignored if an item is being picked up.

Expected Results:

Consistent behavior for GL_DEPTH_TEST, either always on or off.

Notes:

This issue makes writing to depth buffers in post unreliable with Fabulous! graphics. This issue can easily be fixed with an added glEnable(GL_DEPTH_TEST) call before post shaders are run.

Attachments

Comments 2

I attached a resourcepack to the issue that demonstrates this problem. If you load in the game and enable Fabulous graphics, the image will show the depth map (linearized to some extent). If you throw an item and pick it up, the depth value will become constant 1.0 (shown as white) for a brief second.

If this is what's expected to happen using the resource pack while using the Fabulous! graphics I can confirm in 1.20.6:

[media]

bradley qu

(Unassigned)

Community Consensus

Platform

Low

Rendering

1.19, 1.19.1 Pre-release 4, 1.20.1

Retrieved