MineKhan icon indicating copy to clipboard operation
MineKhan copied to clipboard

WebGL warnings when hotbar is empty

Open ghost opened this issue 3 years ago • 2 comments

When i empty my hotbar, the are warnings in the console. Here is the warning: WebGL: INVALID_OPERATION: drawArrays: no buffer is bound to enabled attribute

ghost avatar Nov 18 '21 01:11 ghost

There is no buffer to bind since there are no items to render, therefore JavaScript throws errors that binding the buffer to webgl was unsuccessful.

Oranamous avatar Nov 18 '21 21:11 Oranamous

Actually it's the targeted block outline causing it. When an inventory item is rendered, block lighting is disabled first. Apparently it just stays disabled globally until the next time you unpause the game. Chunks are rendered with VAOs, so they don't use the global attribute settings, which is why I never noticed.

Anyway, the block outline doesn't pass a buffer for block lighting since it's just black. That's what causes the warning. The safest solution would probably be to disable it every frame before rendering the outline, but the completely unsafe solution with marginally better performance would be to leave lighting disabled permanently, and just hope I don't forget if I ever change anything.

Willard21 avatar Nov 19 '21 00:11 Willard21

This is fixed

Willard21 avatar Apr 14 '23 17:04 Willard21