Results 1 to 5 of 5

Thread: Water Surface Problem

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2001
    Location
    Halifax,NS,Canada
    Posts
    16

    Water Surface Problem

    I am creating a transparent water surface on a 3D texture covered terrain.

    Everything looks fine until I start rotating and moving around in the terrain. The areas that are on the water surface level flicker alot. It looks like big random chunks of it go under the water surface and then above it. I was looking for information about Z-Buffer and that the textures are fighting for the Z-Buffer, but no luck ..

    Can you suggest something please ..

  2. #2
    Senior Member Regular Contributor
    Join Date
    Oct 2001
    Location
    Princeton, NJ
    Posts
    380

    Re: Water Surface Problem

    you probably have a depth buffer precision issue. There are three solutions. One is to increase the number of bits, try switching from 16 to 32 bit color if possible. Another is to pull in the far clipping plane and the third is to bump out the near clipping plane. If you can afford to its probably best just to bump the near plane out

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2001
    Location
    Halifax,NS,Canada
    Posts
    16

    Re: Water Surface Problem

    Originally posted by chowe6685:
    you probably have a depth buffer precision issue. There are three solutions. One is to increase the number of bits, try switching from 16 to 32 bit color if possible. Another is to pull in the far clipping plane and the third is to bump out the near clipping plane. If you can afford to its probably best just to bump the near plane out
    In the program I'm using
    gluPerspective(45, (float) width()/height(), m_radius/100, m_radius*10000);
    so
    near = m_radius/100;
    far = m_radius*10000;
    where
    m_radius = max((maxX-minX),(maxY-minY));

    So you are saying that I should pump the near higher ?

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

    Re: Water Surface Problem

    Remove "/100" from your near plane calculation and somewhat better depth buffer precision. If you have a 16 bit depth buffer, you better replace if with "*10" or so instead.

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2001
    Location
    Halifax,NS,Canada
    Posts
    16

    Re: Water Surface Problem

    Thanks alot for the tips .. I can't set the depth buffer bit size .. I'm using QT. And it is set to 1.

Similar Threads

  1. The surface of the water
    By wolfgangabersdorf in forum OpenGL ES
    Replies: 1
    Last Post: 08-16-2013, 11:49 AM
  2. Project advice - Water surface animation
    By Martin Shaw in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 02-17-2011, 03:41 PM
  3. Shader for water surface
    By mishuk in forum OpenGL: GLSL
    Replies: 1
    Last Post: 05-19-2006, 12:13 PM
  4. water reflection problem
    By wow in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 04-19-2004, 07:24 AM
  5. Water surface rendering
    By ioquan in forum OpenGL: Advanced Coding
    Replies: 19
    Last Post: 09-18-2003, 02:17 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