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: glCopyTexImage2D unpleasentness.

  1. #1
    Junior Member Newbie
    Join Date
    May 2003
    Location
    Melb, Oz.
    Posts
    2

    glCopyTexImage2D unpleasentness.

    Hi

    I'm trying to generate a dynamic texture and use it to draw my scene. I'm using the generated texture to draw a heap of polys. Generating the texture doesn't seem to slow things down too much, so all is well there.

    What I don't understand is actually USING the texture slows things down. If I generate the texture but draw everything with a different texture it's ok, if I draw exactly the same stuff with the generated texture it's a lot slower.

    Is there any reason for this? Is there a better way to do this stuff in general? It's nothing too fancy, I'm just drawing a basic scene to a texture, then drawing another basic scene with the mapped with the texture.

    Thanks!

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: glCopyTexImage2D unpleasentness.

    If you're updating the texture dynamically, you should use glCopyTexSubImage instead. This will update an existing image with new data. Otherwise you're destroying the old one, and creating a new texture.Maybe the driver can be smart enough to notice that you only update it and skip at least the recreation part, but don't count on it.

    Anyways, sounds strange, post some code.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,704

    Re: glCopyTexImage2D unpleasentness.

    The texture doesn't have to traverse the AGP bus to get to the card until you actually use it. Thus, you're probably seeing a texture upload penalty on first use.
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

Posting Permissions

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