Depth texture attachment

This topic contains 2 replies, has 2 voices, and was last updated by  Joe Davis 7 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30211

    Slion
    Member

    I’m trying to use a texture as frame buffer depth attachment.
    glTexImage2D gives me an invalid parameter error when using GL_DEPTH_COMPONENT as pixel format. Using GL_UNSIGNED_BYTE as pixel type. Then the frame buffer check fails. My frame buffer works fine when I’m not trying to use that depth texture as depth attachment.

    I’m on WinXP with NVidia GeForce GTS 250. OpenGL ES 2.0 ( SDK build: 2.06.26.0641 )
    Extensions string contains GL_OES_depth_texture

    What’s the trick to use texture as depth attachment?

    #34125

    Slion
    Member

    As I was writing the above question I suddenly remembered that I totally forgot to search the SDK for some examples. Silly me! Turns out the shadow mapping training course does use a depth textures and it uses GL_UNSIGNED_INT as pixel types. So my mistake was to use GL_UNSIGNED_BYTE as pixel type.

    #34126

    Joe Davis
    Member

    I’m glad you managed to resolve the issue. It’s an easy mistake to make 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.