Sign in to follow this  
Krisc

Removing the black on textures...

Recommended Posts

I read NeHe lesson 09 and although it removes the black from the texture it also makes the other colors translucent...how do I only remove the black and keep everything else the same...?

Share this post


Link to post
Share on other sites
Whats being done is not removing the black it's doing a blending method. The simple explination is the colors are added, so a green + black = green, where a green + grey = a dull green.

There is no simple way just to ONLY remove a black (being 0 red, gren and blue values) via blending. You can check each pixel for a black value and set an alpha channel value to be 0, 1 other wise. and use alpha blending.

Share this post


Link to post
Share on other sites
Generally the best way is to create your own alpha channel and use either blending or alpha testing (the latter being better for your case IMHO).

You can also setup color keying but it's much more difficult to setup and uses more processing power on the GPU side. Color keying should be done only for specific cases such as streaming textures (imagine you want to remove the green screen behind an actor from realtime pictures).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this