Results 1 to 4 of 4

Thread: Sparkling Along Shared Edges

  1. #1
    Member Contributor
    Join Date
    Jul 2001
    Location
    NY
    Posts
    85

    Sparkling Along Shared Edges

    Hello -

    I'm currently creating a first-person openGL application, and am having a bit of trouble. The world is tile based, and every tile consists of a cube at a particular height (the game is mainly going to be navigating through mazes). Anyways, when you create a row of cubes, you see sparkling between the shared edges. I have implemented a hidden surface removal procedure, so none of the faces which are between two cubes are being drawn. I thought that might take care of the problem, however, it only seemed to make it a little better. When I turn lighting off, the problem goes away completely, however, I really want to leave lighting on. I have cull back facing turned on, and two sided lighting disabled. Does anybody have any other ideas as to how I could get the sparkling to go away? Thanks!

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,502

    Re: Sparkling Along Shared Edges

    Are all your tiles the same size and are coincident vertices (where the corners of 2 or more tiles meets), truly the same for each tile? Because it sounds like to me your problem is either T-Junctions, or variant vertices (which should be invariant).

  3. #3
    Member Contributor
    Join Date
    Jul 2001
    Location
    NY
    Posts
    85

    Re: Sparkling Along Shared Edges

    Yes, all the tiles have the same base size (10 units in the x direction by 10 units in the z direction). The heights can vary for each one, however. Since they are all the same size on the base, I don't see how the points could be varied - they should be the exact same... however, even on long walls, where all the boxes are the exact same height, you still get that sparkling effect. If you have any ideas as to how I could ensure the same coordinates are being used, maybe I could try that.
    Thanks.

    -lost hope

  4. #4
    Member Contributor
    Join Date
    Aug 2001
    Location
    Berkeley, Ca., USA
    Posts
    52

    Re: Sparkling Along Shared Edges

    Well, the short answer is that edges which do not share enpoints aren't guarnteed to be _exactly_ colinear even if you specify them that way. The classic example of this is a "T junction"

    Code :
    A
    |
    |C      D
    |-------
    |
    |
    B
    even if you specify A( 0.0, 1.0 ), B( 0.0, 0.0 ), C(0.0, 0.5), D( 1.0, 0.5 )
    it won't guarantee that C is colinear with AB, so you have to be sure construct your geometry such that all junctions occour on a shared vertex.

    So that explains the differing height cubes... not sure about the ones that are the same hight.... are you sure that you don't have garbage hanging around in the lower decimal places of your vertices? Weird casts, etc. can sometimes cause that...

Similar Threads

  1. Edges on mesh
    By imported_IvanK in forum OpenGL: GLSL
    Replies: 3
    Last Post: 03-05-2009, 09:01 AM
  2. Getting rid of sparkling artifacts in BM/PM/DM
    By M/\dm/\n in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 12-02-2004, 11:07 AM
  3. HPUX10.2 shared lib
    By @iL3roN in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 08-15-2002, 01:37 PM
  4. Detecting edges
    By KurtCob in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 01-26-2001, 09:53 AM
  5. Stair effect on shared edges
    By n-th in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-17-2000, 10:49 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