Black Artifacts

Hi,

I have an OpenGL ES 2 code base that runs on iOS, Android, and on PC via the PowerVR emulation libraries.

When I run this code on an LG Optimus G LGE971, I see black artifacts on my model:

My first reaction was that the near clipping plane might be the issue, but because these artifacts appear on only select devices, I do not believe that is the issue. Any other ideas on what might be causing this?

Also, this isn’t captured well in the above image, but the artifacts are not static – they move around as the model rotates, etc.

Are you sure all of your triangles strips are wound in the same direction?

Maybe LG’s OpenGL ES driver does not use the same defaults for backface culling as other drivers. Try experimenting with changing these options:

    glEnable(GL_CULL_FACE);
    glCullFace(GL_BACK);
    glCullFace(GL_FRONT);

Regards, Clay

Thanks for the tip. I tried every permutation:

GL_CW & GL_BACK
GL_CW & GL_FRONT
GL_CCW & GL_BACK
GL_CCW & GL_FRONT

And even disabled culling altogether. Unfortunately, the artifacts still show up.

If it helps, the severity of the artifacting increases as the model get closer to the camera.

Also, the shader being applied to the gun does not have any lighting information – it’s a simple texture map. Here’s the fragment shader:

uniform sampler2D diffuseMap;

varying vec4 varyColor;
varying vec2 varyTex0;

void main()
{
    gl_FragColor = texture2D( diffuseMap, varyTex0.xy );
}

Thanks again.

Brennan

Quick update – I changed my shader to output the tex coordinates as the R & G channels in my fragment shader. I just set B & A to 0 and 1, respectively. Everything renders correctly (i.e. no artifacts). So, it looks like something is up with my texture settings. If I had to guess, it might be the min/max filters, since the artifacts seems to be a function of distance from the camera.

Do any of the minimization filter types work correctly? Do you have proper mipmaps? Use the PowerVR TextoolGui to be sure.

Regards, Clay

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.