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

Thread: Apply a texture with some constant alpha value

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2004
    Posts
    28

    Apply a texture with some constant alpha value

    I'd like to allpy a texture to my object with variable opacity - for example, have a texture on an object that's only faintly visible, or an environment map that looks like shiny plastic (the material I set) instead of chrome. How could I do that?

  2. #2
    Intern Contributor
    Join Date
    Nov 2001
    Posts
    77

    Re: Apply a texture with some constant alpha value

    The only way I know of to do that is to use glEnable(GL_BLEND), set your blending functions, and draw the translucent object. Lighting and materials should still apply, so long as you don't disable them.

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2004
    Posts
    28

    Re: Apply a texture with some constant alpha value

    So I can't do it in one pass then?

    What I want is to have just a slight bit of my texture showing on my solid red sphere, not to have my sphere be see-through.

  4. #4
    Junior Member Regular Contributor
    Join Date
    Jan 2004
    Location
    Los Angeles, CA, USA
    Posts
    216

    Re: Apply a texture with some constant alpha value

    It's definately doable in one pass. For sure you can do it with a fragment program, but you should be able to do it using multitexturing, and perhaps even with the right texture function. I forget which that might be.

  5. #5
    Junior Member Newbie
    Join Date
    Feb 2004
    Posts
    28

    Re: Apply a texture with some constant alpha value

    Ah, that's the problem, I don't know what it might be either.

    I wish fragment programs were easy in OpenGL...

  6. #6
    Member Regular Contributor
    Join Date
    Oct 2001
    Location
    Princeton, NJ
    Posts
    391

    Re: Apply a texture with some constant alpha value

    I think this may be what you want http://oss.sgi.com/projects/ogl-samp...nv_combine.txt

    use INTERPOLATE and you should be able to get the effect you want unless I misunderstand

Posting Permissions

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