Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Colours going wrong

  1. #1
    Guest

    Colours going wrong

    I've been playing around a bit today, and had a my first go at trying to use textures. Essentially, I am just drawing a big quad with a texture on it as a background. This goes okay until I draw something else (in this case just another quad but not textured, just gradient filled). Once I do that, the next time the program goes through the update loop and re-draws, the background texture seems to be drawing only the red channel of the texture. Any suggestions?

  2. #2
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    4,388

    Re: Colours going wrong

    You probably have a GL_MODULATE texture environment and don't specify a color for the textured geometry.

    Either specify a color for the first piece geometry (white would be a good start) or change your texture environment to GL_REPLACE. Either should correct your problem.

    OpenGL is a state engine. Whatever state you leave at the end of one frame gets carried to the start of the next frame so you need to be careful about how you manage all state.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •