desht Posted November 3, 2017 Posted November 3, 2017 Just hit a weird problem with GUI rendering, specifically drawing a tank gauge texture on a GUI screen. It works fine inside my dev environment, but when the mod is run in a regular client, the problem crops up; instead of the GUI background showing up behind the texture, the background renders solid black, or occasionally with parts of other textures intruding (which suggests that I'm being careless with my texture coords, but I'm pretty sure I'm not - and why would it work in a dev environment and not outside?) The code is here: https://github.com/desht/pnc-repressurized/blob/master/src/main/java/me/desht/pneumaticcraft/client/gui/widget/WidgetTank.java#L48 and the texture in question (16 x 64 PNG file, mostly transparent) is here: https://github.com/desht/pnc-repressurized/blob/master/src/main/resources/assets/pneumaticcraft/textures/gui/widget/widget_tank.png And an example of what it looks like (5 tanks here, 3 with solid black, 2 with other textures creeping in): https://imgur.com/a/nUi5E. The problem happens whether or not there's any fluid to render. If there is fluid, the fluid renders fine, and the gauge is rendered over the fluid OK. Just the part that's rendered over the GUI background goes wrong. Anyone seen anything like this before? It's got me scratching my head... Quote
Alexiy Posted November 4, 2017 Posted November 4, 2017 There might be other mods interfering in rendering, setting/unsetting certain GL switches. Quote
desht Posted November 4, 2017 Author Posted November 4, 2017 Yeah, I'd considered that, but my mod is the one & only mod in my non-dev test world, and I still have the problem. So other-mod interference can be ruled out. Quote
desht Posted November 4, 2017 Author Posted November 4, 2017 Well, it turns out that it was happening in my dev environment too. I've worked around the problem for now by just drawing the gauge lines directly with Gui.drawRect() calls, but I'm no nearer to working out why it was a problem... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.