Results 1 to 3 of 3

Thread: Mixing/adding multiple textures to one object

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2009
    Posts
    7

    Mixing/adding multiple textures to one object

    Hi,

    I've implemented environment mapping to an object in my scene - this object reflects the environment. My problem is now that I want to mix the environment map with a normal texture so it doesnt look too metallic. For example a shiny stone (stone texture) that reflects just a little of its environment.

    I hope you can help me ...

    Here's my current code for drawing such an object:

    glEnable(GL_TEXTURE_GEN_S);
    glEnable(GL_TEXTURE_GEN_T);
    glEnable(GL_TEXTURE_GEN_R);

    glEnable(GL_TEXTURE_CUBE_MAP);


    glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);


    glBindTexture(GL_TEXTURE_CUBE_MAP, m_envtex);

    glPushMatrix();

    GLfloat white[] = { 1.0, 1.0, 1.0, 1.0 };

    glTranslatef(0,0,0);
    glColor3f(1.0f, 1.0f, 1.0f);
    gluSphere(sphere_quad,3, 10, 10);

    glPopMatrix();

    glDisable(GL_TEXTURE_CUBE_MAP);
    glDisable(GL_TEXTURE_GEN_S);
    glDisable(GL_TEXTURE_GEN_T);
    glDisable(GL_TEXTURE_GEN_R);

  2. #2
    Senior Member Frequent Contributor scratt's Avatar
    Join Date
    May 2008
    Location
    Thailand
    Posts
    555

    Re: Mixing/adding multiple textures to one object


  3. #3
    Junior Member Newbie
    Join Date
    Apr 2009
    Posts
    7

    Re: Mixing/adding multiple textures to one object

    ahh ok thank you alot - hmm but this looks like java, but I guess it's nearly the same with c++

Similar Threads

  1. Multiple textures assigned to an object? How to?
    By keelx in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 04-22-2011, 05:26 PM
  2. Framebuffer Object, can't write to multiple Textures
    By Abaddon in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 10-12-2007, 05:51 AM
  3. Adding one more object causes others to disappear.
    By Mathematix in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 02-22-2004, 09:01 AM
  4. Mixing RGBA and Paletted Textures
    By Sheepie in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 04-11-2001, 01:45 PM
  5. Mixing 2D and 1D textures.
    By Nutty in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 02-20-2001, 06:53 AM

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