1.15: Incorrect diffuse shading in GUI for item models with blended vertex normals
grondag opened this issue ยท 1 comments
This is probably because Mojang is using glShadeModel(GL_FLAT)
for GUI item rendering. Doing so means the normal from the first vertex is used for the entire primitive.
This serves no useful purpose because the normals are populated for all vertices and will all have the same value in the nominal case. But it has been this way for a long time and Mojang has little incentive to change it because all of their models use the quad face normal for all vertices.
IIRC, Indigo in 1.14 has a patch to address this for modded models, and a similar patch will likely be needed in 1.15.
However, the code being used to manage GL State in 1.15 appears to be an attempt to win this year's award for Most Egregiously Inappropriate and Gratuitous Abuse of Lambda Functions. Between you and me, I like their chances.
Said lambda abuse is also why I'm not completely certain I've identified the cause. I'm not willing to debug that monstrosity until I'm ready to fix this, and I'm not willing to fix this until we are closer to the 1.15 release and Mojang is done doing... whatever this is.