Results 1 to 9 of 9

Thread: a problem in rendering

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    Tehran, Iran
    Posts
    8

    a problem in rendering

    hi all,
    Im a beginner in openGL. I wrote a flight simulator with OpenGL. but I have a great problem with my objects in far distance. when my plane go away from my objects then OpenGL can't recogonize their depth and my objects begin to flickering. What's the reason and how can solve this problem.

    thanks for ur attention
    shafa

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

    Re: a problem in rendering

    You should push the near clip plane as far out as you can possibly accept. The precision of the depth buffer is linked to the values of the near and far clip planes.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    Tehran, Iran
    Posts
    8

    Re: a problem in rendering

    thanks, but I know it. my problem is different. my clip plane is far. Problem is happend when two objects is near to each other. (for example when the aeroplane go up and away from then earth, take off bands and earth cant be recogonized and in one frame band rendered and in the next eath is rendered or any pert of both)

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: a problem in rendering

    So how is your problem different? It sounds to me like z-fighting. Bob's suggestion of moving the near plane out as far as possible will reduce the precision needed for the depth buffer and reduce z-fighting.

    Also, how many bits is the depth buffer you're using?
    Deiussum
    Software Engineer and OpenGL enthusiast

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    Tehran, Iran
    Posts
    8

    Re: a problem in rendering

    thank you very much for your response.
    I find it know and test it. But I dont know how can I find my precision bits. please tell me how can I know it.

    thanks a lot

  6. #6
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    Russia, Vladivostok
    Posts
    7

    Re: a problem in rendering

    As I remember, U must define far & near clipping plane, when U write such:
    glViewPort(...) (sorry for my bad english, i'm Russian
    Mail me for more (I'll find it, i think...)
    RTFM
    YEAH!

  7. #7
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: a problem in rendering

    If you use glut, I don't think you can set the depth buffer precision. At least, I'm not sure how you would do so offhand. There may be a way.

    If you are using Windows and initializing the window with the SetPixelFormat stuff, you specify the precision of the depth buffer using one of the fields of the PIXELFORMATDESCRIPTOR struct.
    Deiussum
    Software Engineer and OpenGL enthusiast

  8. #8
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    Boston, MA
    Posts
    1

    Re: a problem in rendering

    As far as I know, depth buffer precision is gotten from a ratio of near clip distance to far clip distance. I am just a VERY new beginner, but I'm learning fast.

  9. #9
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: a problem in rendering

    I'm talking about 16 vs. 24 vs. 32 bit depth buffers. Higher number of bits provides for more precision simply because there is a greater range of numbers that can be stored.

    These can be set by using a pixel format with the appropriate value in the cDepthBits field of the PIXELFORMATDESCRIPTOR struct.
    Deiussum
    Software Engineer and OpenGL enthusiast

Similar Threads

  1. Rendering problem
    By andrei.alex in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 11-13-2015, 04:50 AM
  2. Problem rendering
    By Darth_Malloc in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 07-12-2012, 10:38 PM
  3. Rendering problem
    By tabor25 in forum OpenGL: Advanced Coding
    Replies: 12
    Last Post: 07-10-2007, 05:08 PM
  4. Problem with rendering
    By Satyajit in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-23-2007, 03:32 AM
  5. Rendering problem
    By iris_raj in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 10-08-2003, 05:33 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