Search code examples
iphoneopengl-estexture2d

OpenGL ES - Pixel 'Interference' at bottom of texture


I'm loading an int* array of RGBA pixel data from a UIImage, doing manipulation on it, then setting the pixels to a Glubyte* texture buffer and writing them to the texture with

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texWidth, texHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, texBuffer);

This works fine, however I get some weird pixelation "interference" at the bottom of the screen.

Anyone have any idea what might be causing this effect?

EDIT: Solved this myself, see my answer


Solution

  • The problem here was in the int* buffer declaration, it should have been:

    int* pixelArray = malloc(4*w*h);