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 3 of 3

Thread: Switch between texture filtering modes

  1. #1
    Junior Member Newbie
    Join Date
    May 2008
    Posts
    15

    Switch between texture filtering modes

    Hi,

    Is it possible to switch between texture filtering modes?

    What I want to do is draw some textures using mipmaps and others using just linear filtering.


    I call glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);

    when I want to draw textures using mipmap filtering

    and glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

    when I want to draw textures using using linear filtering.

    But it doesn't seem to work.

    Any idea why?

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Switch between texture filtering modes

    Yes it is possible.

    But for mipmaping to work, you should upload all texture lod levels.

    Can you precisely define what means "it doesn't seem to work" in both cases ?

  3. #3
    Junior Member Newbie
    Join Date
    May 2008
    Posts
    15

    Re: Switch between texture filtering modes

    Thanks for the reply and sorry for my vague description,

    When I draw the whole scene with linear filtering everything works fine.

    Then I decide to use mipmap filtering on some of the textures. What happens then is that the mipmap textures draws correctly, but some(not all) of the textures using linear filter is all white.

    I build the mipmapped texture using:
    gluBuild2DMipmaps
    and the linear filtering textures using:
    glTexImage2D

    I also set the texture enviroment parameter GL_TEXTURE_MIN_FILTER before I build the texture and before I draw the texture.

Posting Permissions

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