Results 1 to 2 of 2

Thread: Trouble with Textures and Materials

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2005
    Location
    Indianapolis, IN
    Posts
    10

    Trouble with Textures and Materials

    I am just having a quick problem with lighting. When I put in

    glEnable(GL_COLOR_MATERIAL);
    glColorMaterial(GL_FRONT_AND_BACK,
    GL_AMBIENT_AND_DIFFUSE);

    my materials render right but my textures don't.

    when I take the code out, my textures render
    but my materials are gray to white depending on the ambient values of my light.

    How can I have my materials show through and my textures render correctly?
    (-------------(_ __ _ ()
    Just having a good time
    "YA RIGHT!!!"

  2. #2
    Guest

    Re: Trouble with Textures and Materials

    Hey there!

    Try this:
    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

    Here's what this call does:
    final color = texel color * lit polygon color

    Hope that helps

    Regards,
    David

Similar Threads

  1. Textures or Materials?
    By GhostMonkey in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 04-20-2012, 05:07 AM
  2. Overlapped materials and textures
    By imported_ArmanS in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 12-20-2007, 07:02 AM
  3. Overlapped textures and materials
    By ArmanS in forum COLLADA
    Replies: 0
    Last Post: 12-20-2007, 01:41 AM
  4. Materials and Textures
    By azcoder in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 01-04-2003, 08:32 AM
  5. lighting with materials and textures
    By azcoder in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 12-31-2002, 12:33 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