Results 1 to 4 of 4

Thread: Texture Problem

  1. #1
    Guest

    Texture Problem

    Hi all!

    I want my texture to look exactly like a bmp picture. Is this possible?

    When I try to do this the texture get different colors than the BMP file. What is wrong?

    I tried with both GL_MODULATE and GL_DECAL, but it does not work. What of these two enviroment options is correct to use in this case?

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Apr 2004
    Posts
    990

    Re: Texture Problem

    When using GL_MODULATE you need to set glColor4f(1.0,1.0,1.0,1.0)

    Or just set it to GL_REPLACE:

    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE , GL_REPLACE)

    Nico

  3. #3
    Guest

    Re: Texture Problem

    Thanks for the quick replay.

    I tried to use GL_REPLACE and it worked fine if I disabled GL_BLEND. The problem is that some parts of my texture is transparent. (Using alpa blending: 0 value=not visible, 255=visible). So when I turn of the blending the image is no longer transparent. And if I use blending the image have different colors than the original bmp file.

    I want the image to look exactly like the bmp file with some pixels not visible. Is this possible in openGL?

  4. #4
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: Texture Problem

    This can be done with glEnable(GL_ALPHA_TEST) instead of blending. Use glAlphaFunc to set the comparison function and reference alpha value.

Similar Threads

  1. Render to texture problem or problem in approach
    By Taimoorak in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-07-2018, 06:04 AM
  2. Replies: 1
    Last Post: 01-10-2005, 09:50 AM
  3. Replies: 0
    Last Post: 01-09-2005, 06:01 PM
  4. Replies: 0
    Last Post: 01-09-2005, 05:53 PM
  5. Replies: 1
    Last Post: 01-09-2005, 05:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean