Thread: reasonable frustum viewing distance

  1. #1
    Banned
    Join Date
    Jan 2003
    Posts
    1,708

    reasonable frustum viewing distance

    I have noticed that the farther you can see into the distance the more inaccurate the depth buffer is, i.e an object might be 'behind' another but will show through. I was wondering if there is any standard for a frustum length. I am thinking of using 500 to 1000, before I was using 15000, lol. Ok thanks.

  2. #2
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    I haven't had this, Then again, I haven't been opertaing in
    these distances yet. How can you see an object that far away
    of being infront of or behind an object if the difference is small?
    --

  3. #3
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    with 100% accuracy the closer objects cull the objects farthest away.

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    I heard OpenGL's depth buffer can be inaccurate at times. You may want to look into using a BSP Tree instead.

  5. #5
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    I don't want to do BSP for this simple game Mr. Wizard. I think I am going to end up scaling everything down so all of the depth values produced are accurate. I wrote a worldcraft .map loader (it reads in all of the planes) but the math to find the 3 plane intersection scared me and I gave up (for now). I also don't know how to read .wad texture files. Eventually though I would like to build the .map loader into a BSP compiler that performs constructive solid geometery (adjacent convex polygons combined), reads the .wad texture files, and the hardest part of all the BSP partitioning. I already 'know' how most of it is done, but I know actually getting it to work will be quite difficult.

  6. #6
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    how many bits did you allocate to the depth buffer in your pixel format?

    > I was wondering if there is any standard for a frustum length.

    depends on scaling and how far you want to see...

    usually depending again on scaling i see 1(usually used for 2D) to 100.

    also look into the glPolygonOffset function i hear its often used to alliviate the problems your having..
    Last edited by no-one; 02-26-2003 at 09:31 PM.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  7. #7
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    originally only 16 bits but i'm experimenting with more. Is there a limit.EDIT: using 32bits instead of 16 seems to have helped.


    EDIT1:
    I don't entirely get this, could someone explain it to me in english?
    This is from MSDN. I understand how to use this(glEnable(GL_POLYGON_OFFSET) then call glPolygonOffset() but I don't understand what it does exactlY)
    When GL_POLYGON_OFFSET is enabled, each fragment's depth value will be offset after it is interpolated from the depth values of the appropriate vertices. The value of the offset is factor * Äz + r * units, where Äz is a measurement of the change in depth relative to the screen area of the polygon, and r is the smallest value that is guaranteed to produce a resolvable offset for a given implementation. The offset is added before the depth test is performed and before the value is written into the depth buffer.
    Last edited by Silvercord; 02-27-2003 at 12:03 PM.

  8. #8
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    If it starts to freak out at high variable numbers, Then why not
    just divide them all through 2?
    --

  9. #9
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    heres a pretty comprehensive explaination...

    http://www.opengl.org/developers/faq...ygonoffset.htm

    and i recommend always using a 32 bit depth buffer.
    Last edited by no-one; 02-27-2003 at 04:30 PM.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opengl: viewing distance
    By bluehead in forum Game Programming
    Replies: 2
    Last Post: 04-02-2005, 10:34 PM
  2. Distance Formula in my program..... I need help fast!!!
    By Mackology101 in forum C Programming
    Replies: 3
    Last Post: 09-23-2004, 10:10 PM
  3. shortest path problems
    By talz13 in forum C++ Programming
    Replies: 7
    Last Post: 05-08-2004, 06:13 AM
  4. Replies: 11
    Last Post: 03-25-2003, 05:13 PM
  5. Fuzzy Logic
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 10-13-2002, 04:58 PM