Results 1 to 2 of 2

Thread: texturing and lighting

  1. #1
    Senior Member Regular Contributor
    Join Date
    Feb 2001

    texturing and lighting

    i´m having a small openGL scene with a few cubes floating around and a light source. now if i try to apply a texture to one of the cubes, the whole scene gets a lot darker although the light is still on.

    i initialize the texture a sfollows, shouldn´t be a problem!?

    glGenTextures(1, &texture[0]);
    glBindTexture(GL_TEXTURE_2D, texture[0]);
    gluBuild2DMipmaps(GL_TEXTURE_2D, 3, text1->w, text1->h, GL_RGB, GL_UNSIGNED_BYTE, text1->pixels);

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000

    Re: texturing and lighting

    If you use GL_MODULATE (which is the default), the texture will be muliplied with the polygon color, and if you use lighting, this is what you want. Now, if your texture is dark, then when multiplying, the result will also be dark, even though lighting is on. Try increase the brightness of your texture, it should be as bright as possible.

    [This message has been edited by Bob (edited 02-19-2001).]

Similar Threads

  1. Problem with lighting & texturing
    By kiattisak in forum OpenGL: Advanced Coding
    Replies: 12
    Last Post: 01-29-2016, 01:31 PM
  2. 3D Texturing and Lighting
    By Chalnoth in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 11-07-2002, 06:51 AM
  3. Lighting and Texturing
    By Furrage in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-13-2002, 12:09 AM
  4. Lighting and Texturing Problems
    By King Fuzzy in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-23-2001, 05:01 PM
  5. Lighting & Texturing not working despite using GL_MODULATE
    By Tod Baudais in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 03-02-2001, 08:05 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