Results 1 to 3 of 3

Thread: Forcing the depth value

  1. #1

    Forcing the depth value


    Can anyone tell me how I can force an object to be displayed in front of all other objects on the screen, regardless of what it's Z value is?

    I'm hoping there's just a simple switch command in OpenGL that will allow me to do this.

    Many thanks in advance.

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000

    Re: Forcing the depth value

    If it's a 2D object, the most common way is to draw it last with depth test disabled.
    If it's a 3D object in need of depth testing, draw it last and clear the depth buffer before rendering it.
    Other tricks are glDepthRange settings where zFar ends up in front of your other scene's depth values.

  3. #3

    Re: Forcing the depth value

    OK, thanks very much! I'll give that a go and see if it works.



Similar Threads

  1. forcing vsync off
    By mogumbo in forum OpenGL: Linux
    Replies: 2
    Last Post: 04-03-2017, 09:16 AM
  2. Forcing GL to draw
    By Ferenzzy in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-27-2005, 04:35 AM
  3. Forcing a mipmap level
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-10-2003, 03:55 AM
  4. Forcing a redisplay
    By pjbibby in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 03-09-2001, 02:28 AM
  5. Forcing OpenGL not to use available hardware?
    By bridger in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-05-2000, 11:31 PM

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