Morgrimm Posted September 10, 2014 Posted September 10, 2014 I've been trying to render a translucent texture in for my item, but no matter how I color it, or what setting I try to use, it always renders solid black instead of tinted like it should be. Anyone have an idea for a fix? Code: http://pastebin.com/UVp9xvaV Here's an image of the item as it renders now (the black shape should be a tinted eye): http://imgur.com/zqOyNFT Thanks in advance Quote
Ewe Loon Posted September 10, 2014 Posted September 10, 2014 if the problem is the item in slot 1 then take a good look at it it is rendering transparencies (look at to outside shape) check your transparency on the inside bit, if it has a slight opacity it will render as fully opaque the only items i have ever seen in the game with opacity are all blocks and they use @SideOnly(Side.CLIENT) public int getRenderBlockPass() { return 1; } to do that, but i dont know how you would for an item, that is if it is possible Quote
TheGreyGhost Posted September 10, 2014 Posted September 10, 2014 Hi Try adding GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); just after your GL11.glEnable(GL11.GL_BLEND); -TGG Quote
Morgrimm Posted September 10, 2014 Author Posted September 10, 2014 Nope, that didn't work. The item still renders black, as in the picture D: Could it be the image itself? Quote
TheGreyGhost Posted September 10, 2014 Posted September 10, 2014 Hi After looking more closely at your code I think the problem is probably here GL11.glColor3f(c.getRed() / 255, c.getGreen() / 255, c.getBlue() / 255); This uses integer division so it becomes GL11.glColor3f(0, 0, 0); Try / 255.0F instead of / 255 -TGG Quote
Morgrimm Posted September 10, 2014 Author Posted September 10, 2014 That fixed it Wow, I can't believe it was that simple of a mistake... I need to go through my specifics more. Thanks Grey Ghost! :3 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.