Results 1 to 3 of 3

Thread: Transparent Texture - Artifacts

  1. #1
    Andrew Jameson
    Guest

    Transparent Texture - Artifacts

    Hi,
    I'm trying to produce a transparent world ... land masses solid and seas semi-transparent. I want to be able to see the reverse land masses through the sphere so I disable GL_CULL_FACE.



    Now, it works ... but it generates transparent artifacts that are not related to lighting but are related to the view angle of the object.

    I'm using the texture to control the alpha.

    glDisable(GL_CULL_FACE);
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE);
    glPushMatrix;
    glColor4f(1.0, 0.0, 0.0, 1.0);
    glBindTexture(GL_TEXTURE_2D, LogoWorld]);
    glCallList(3DWorld]);
    ..
    ..

    Any idea of what I'm doing wrong and why I'm getting these artifacts ? I've reproduced the same problem in Deep Exploration (Right Hemisphere).

    Thanks Andrew

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: Transparent Texture - Artifacts

    This is "z-fighting" : 2 pieces of geometry fighting for the same Z distance.

    Solutions :
    - increase zbuffer precison : go from 16 to 24 bits, bring near projection plane farther (never at 0 !), bring far projection plane nearer
    - make your geometry better, ie specify the *exact same coordinates* for both land masses and seas, so depending on your depth test, the last one will show.
    - in your case it seems that both "spheres" were not tesselated the same way, maybe do something about it ?

  3. #3
    Andrew Jameson
    Guest

    Re: Transparent Texture - Artifacts

    Yes ... that's what I thought at first and you're correct, the shape of the artifacts do relate to the actual mesh.

    In the end, I found that rendering it in two passes fixed the problem completely ... first pass with glCullFace(GL_FRONT) and then glCullFace(GL_BACK).

    Not actually certain as to whether this might possibly be a limitation of my graphics card / driver (NVidia GForce 2) - especially as I can reproduce the same problem in a commercial 3D explorer application. I am fairly certain that it's not z-fighting as the problem does not appear to be effected by the geometrical size of the sphere nor z-buffer depth etc.

    Thanks

    Andrew

Similar Threads

  1. Texture atlas artifacts
    By dmitry in forum OpenGL ES
    Replies: 0
    Last Post: 08-18-2016, 02:35 AM
  2. 3D texture rendering artifacts
    By vincent911001 in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 04-07-2015, 07:54 PM
  3. Texture artifacts and std::map crash
    By Zylzyl in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-02-2014, 08:05 PM
  4. texture sampling artifacts and floor()
    By ikka_ in forum OpenGL: GLSL
    Replies: 8
    Last Post: 11-25-2011, 07:22 AM
  5. Texture Artifacts
    By MutantJedi in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 09-18-2006, 01:00 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