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

Thread: Overlaying texture on already rendered surfaces

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

    Overlaying texture on already rendered surfaces

    Hy to everyone. I'm developing an application that draws texture over surfaces. I have various tile.
    Each tile has vertexes, triangles, colors and a texture associated.
    Once that my render phase is finished , since I know all the tile s to fill completely the screen, I have the screen filled correctly and my scene is drawn.

    Now let's suppose that I want to overlay over my rendered tiles another texture and I want to put it over the same vertexes I used for my textures. I want to do it before swapping buffer, and the next texture is not related at all with my tiles. So it can be that it covers more than one tile and some of them are not covered completely.

    Is there a opengl function that permits to do it automatically?

    Just to explain better....google earth does it. If you run it and you select the feature "texture overlay" it is possible to choose
    the Z value for that. And with a slider it is possible to reach the Z = "Drape on land" and istantly the texture is draped on the 3D relief. Too quickly to think that complex operation are performed to obtain it.

    Do anyone knows how it is obtained?

    P.S.: I'm using opengl 1.0, perhaps 1.1 because I develop embedded applications. So I cannot use extensions or advanced features.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    748

    Re: Overlaying texture on already rendered surfaces

    glBlendFunc and maybe glAlphaFunc will do that for you

    First take a look here and look up these funcs.

    next take a look here for an example on how blending works, alpha testing works in a similar way.

Posting Permissions

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