Rendered item issues (render state leak?) with Skulls in the world
maruohon opened this issue ยท 5 comments
There seems to be some sort of render state leak, when vanilla mob heads/skulls are rendered on screen. When placing some skulls nearby, some of the drawers start rendering their item in a darker shade.
I'm testing/using Storage Drawer 3.6.2 + Chameleon 2.2.2 on MC 1.10.2, Forge 2239 and also 2254.
Examples:
- Normal, no skulls shown: http://i.imgur.com/6O532Bw.png
- Skull shown, renders darker: http://i.imgur.com/Gxwg5nX.png
- Normal (well on some of them), no skulls shown: http://i.imgur.com/c3YT7CD.png
- Skull shown, some drawers turn darker and get z-fighting on the items' edges: http://i.imgur.com/24wruIs.png
It's a bug in Minecraft! TileEntitySkullRenderer
turns on GL_RESCALE_NORMAL without turning it back off.
MC rendering is always fun this way. There's several vanilla entities and tile entities which do not clean up their states properly, so it becomes our responsibility to clean up after all of them.
Thanks, now I was able to fix my own rendering code too, which is what I was testing yesterday with Storage Drawers after I noticed that issue with the rendering of my block (the rendering code for which I "borrowed" from Storage Drawers since I'm useless at rendering things...) :D
Turns out it's not just GL_RESCALE_NORMAL. TileEntitySkullRenderer turns off face culling and doesn't turn it back on. That caused the funny edges and z-fighting.