NEI setting incorrect GL flags post chunk overlay render
Opened this issue ยท 9 comments
I found an compatability issue with Lunatrius Laser Levels mod, where the color of the laser level build guides dissapears to near invisibility if I press F9 to toggle NEI's chunk grid. I reported this problem in their topic and they said:
"As for the bug, the grid/chunk border renderer is setting some OpenGL state and it's not resetting it to the previous, expected value. Mods should always try to revert any OGL changes to ensure maximum compatibility with other mods."
For reference, here is my initial report of that issue, complete with screenshots, and in the posts after that Lunatrius has replied including the quote above. I hope that this info can help you guys find out what goes wrong here and I hope that you can fix it!
I don't know I just passed the message by Lunatrius on here, all I know is that this only happens with NEI's chunk grid involved. I will post this back in the NEI thread though, maybe that will help get the exact error clear!
Here are the two screenshots that I posted in a spoiler tag in the reply that I linked to above:
This is how the laser levels should look:
This is how they look after I activated the chunk grid:
The only way to get the original color back is by relogging or restarting minecraft, turning off the chunk grid doesn't help. But I wanted to use both, so that didn't help much either.
Ok, NEI first disables Texture2d, enables blend, sets blendFunc to srcAlpha and oneMinusSrcAlpha, disabled lighting, at the end of the draw call it enables lighting disables blend then enables texture2d. unless you are just assuming the correct blendfunc is applied it might be on your end.
After going through the code, it most likely wasn't a faulty state. I had a similar issue with InGame Info XML a while ago, when the color wasn't reset back to (1, 1, 1, 1), tinting the text a different color (whatever rendered before it). Should be fixed on my end Lunatrius/Laser-Level@efc680e
Fixed the fix and as it turns out NEI enables lighting (it's disabled in vanilla/forge when the event is fired).
It's worth looking into this - this call might be one of the reasons why the sky and/or some items in the old NEI overlay used to flicker when you tried to interact with NEI.
Ahhhh, i see. Ill work on some stuff to fix it. Possibly a way to push and pop specific GL states.