texture Key Color

Started by
3 comments, last by kburkhart84 18 years, 3 months ago
is there a way to set a keycolor for a texture to have a transparency without using the alpha?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
Advertisement
You could do it manually when you load the texture file. But I think the easiest way is with the alpha channel of the file. I use the TGA file format and automatically my renderer uses the alpha channel that my TGA loader grabs from the TGA file, then it is rendered that way. It only takes a couple of lines, even without my classes.


hmm... using which function to load the texture?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
OpenGL doesn't provide you any funtions to load image, you'll need to write your own or use existing libraries. In case you want to do it yourself, take a look at Wotsit for lists of files format. Image libraries are also freely available (PaintLib for example), however in most cases the provided libraries are overwhelming - writing your own is somewhat simpler.
Which way do you prefer ?.

You may want to take a look at NeHe for OpenGL tutorials.
--> The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones <--
I learned from NEHE how to load the TGA files with the alpha channel.


This topic is closed to new replies.

Advertisement