Jump to content
  • Advertisement
Sign in to follow this  
Slug

Texture Color Inversion, How to...

This topic is 4891 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can i inverse the color of a texture i wanna draw, like in a camera film or something like that... Did i have to reload the texture differently or can i re-use the same??? Thx for your help...

Share this post


Link to post
Share on other sites
Advertisement
For some unknown reason my textures are displayed with color inverted (i.e. black -> white, white->black).
Once I figure out what went wrong with my program, there's an easy answer for you :-)

Share this post


Link to post
Share on other sites
alright, figured out my problem:

I used
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND);
// texture environment color to its default value of (0,0,0,0).

Share this post


Link to post
Share on other sites
Quote:
Original post by Slug
How can i inverse the color of a texture i wanna draw, like in a
camera film or something like that... Did i have to reload the texture differently or
can i re-use the same??? Thx for your help...
You can check out glLogicOp, although that will affect the final pixels that would be rendered, not the texels from one texture.

EDIT: To only affect one texture, you can use GL_ARB_texture_env_combine and set a source as GL_TEXTURE with its operand as GL_ONE_MINUS_SRC_COLOR. Read the spec and come back if you have any questions.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!