Hey Everyone i just wanted to ask how i would go about making a certain color transparent in opengl.
Example:
I want to be able to load a texture onto an object but when it appears on the screen it doesnt show a certain color that i gace chosen. srry if this is worded wierd. Like how would i go about setting a Color key for a certain color so opengl doesnt show it or loads it with the texture.
I would love for someone to help much thx.
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Transparency Question
Modern graphics APIs have no native support for colour-key transparency.
The usual technique is, when you load your texture, loop through every pixel and if it matches your 'transparent' colour, then replace it with [0,0,0,0], then render the image with alpha transparency.
The usual technique is, when you load your texture, loop through every pixel and if it matches your 'transparent' colour, then replace it with [0,0,0,0], then render the image with alpha transparency.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement