Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


Transparency Question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Kukakente   Members   -  Reputation: 109

Like
1Likes
Like

Posted 12 September 2012 - 07:50 PM

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.

Sponsor:

#2 Hodgman   Moderators   -  Reputation: 30878

Like
1Likes
Like

Posted 12 September 2012 - 09:01 PM

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.

Edited by Hodgman, 12 September 2012 - 09:01 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS