Results 1 to 3 of 3

Thread: [OpenGL] Rendering good looking lines

  1. #1

    [OpenGL] Rendering good looking lines

    Hey guys

    I'm trying to render some geometry and I want to edges to look good. It now looks like this:



    You can see the black pixels near the lines. How to make this look better?

    I use the following settings:

    [pascal]
    glEnable(GL_LINE_SMOOTH);
    glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glEnable(GL_BLEND);
    glEnable(GL_DEPTH_TEST);
    glDepthFunc(GL_LEQUAL);

    //My lines are a little thicker
    glLineWidth(2);
    [/pascal]

    I allready figured that disabling depth testing solved the problem but I rather don't do that, because I don't want to see any lines located behind other geometry.

    Can someone help?

    Thanks in advance.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  2. #2

    Re: [OpenGL] Rendering good looking lines

    Try render lines after geometry? The fading to black effect in lines comes when polygons hit the z-buffer caused by lines. However if you render lines infront they may appear almost non visible, and if you disable z-buffer for lines you would see lines that are in hidden backfaces too (this is solvable by manually calculating camera angle with faces ect.. hard).

  3. #3
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Re: [OpenGL] Rendering good looking lines

    Try to turn off anti aliasing?
    NecroSOFT - End of line -

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •