Results 1 to 4 of 4

Thread: problem with reading zBuffer on ATI

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2009
    Posts
    3

    problem with reading zBuffer on ATI

    Hi,

    I have a strange problem with reading values from zBuffer. When i start my application everything works fine untill I enlarge size of the window.

    When I get resize event I set up new viewport values (by calling glViewport)
    After that, when I call:

    glReadPixels(x, y, 1, 1, GL_DEPTH_BUFFER_BIT, GL_FLOAT, floatPtr);

    with x,y outside the previous viewport it doesn't set anything in floatPtr or it sets incorrect values.

    I'm running Windows XP [Version 5.1.2600]
    My graphics card: ATI Radeon X300/X550/X1050 Series
    Drivers: Catalyst: 09.03 OpenGL Version: 6.14.10.8543
    My project is in c# and I'm using tao wrapper.

    Has anyone experienced similar problems with ATI cards? My program works fine with nVidia.

    Should I do something more than just setting viewport and then render my scene like always after I get resize event?

    Thanks for any help.

  2. #2
    Junior Member Newbie
    Join Date
    Dec 2009
    Posts
    3

    Re: problem with reading zBuffer on ATI

    MORE INFO:

    After resize I also call gluPerspective with new apsect ratio, clear all buffers and then do actual render...

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2007
    Location
    USA
    Posts
    9

    Re: problem with reading zBuffer on ATI

    Make sure you're setting everything up the same way, and in the same order. Have a function/method that sets up your viewport (something like vpSetup(width, height, blah blah)) and then call that for both the initial setup and for resize events.

    Also, welcome to the wonderful world of OpenGL on ATI hardware

  4. #4
    Junior Member Newbie
    Join Date
    Dec 2009
    Posts
    3

    Re: problem with reading zBuffer on ATI

    Hey, thanks. Repeating initial opengl initialization after resizing really helped. Resizeing windows is not so smooth anymore but my application is working correctly.

    I've never seen any sample code doing initial open setup more than once - at the beginning of an application so this idea wasnt really obvious for me...

Similar Threads

  1. Problem in reading the "Blue Book"
    By Heifer in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-26-2005, 01:09 AM
  2. zbuffer problem - terrain not showing up on globe
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-15-2003, 07:30 AM
  3. ZBuffer: Mistake or Problem
    By Powerino in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 09-18-2003, 07:25 AM
  4. MD3 Reading Problem
    By nukem in forum OpenGL: Advanced Coding
    Replies: 8
    Last Post: 11-24-2002, 07:40 PM
  5. ZBuffer problem?
    By kaysoft in forum OpenGL: Basic Coding
    Replies: 10
    Last Post: 10-03-2002, 11:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean