Question

I've gotten the texture to load, but it seemingly displays a single color of the texture. I've targeted the texture coordinates first, and can't seem to get the texture to display right. the intended texture is below:

Test image for plane.

256x256

The texture is being displayed, but seemingly in a solid color. Maybe zoomed in to one pixel of the texture, or a warp of bad texture coordinates.:

Texture display.

Geometry:

static float squareCoords[] = {     
        -0.1f,  0.1f, 0.0f,  
        -0.1f, -0.1f, 0.0f,   
        0.1f, -0.1f, 0.0f,    
        0.1f,  0.1f, 0.0f };  

Texture coordinates:

final float TextureCoordinates[]  =
    {
            0.0f, 0.0f,
            0.0f, 1.0f,
            1.0f, 1.0f,
            1.0f, 0.0f,
    };

The texturing process is encapsulated inside the Entity class and I could include more code if it isn't immediately obvious to a second pair of eyes.

Was it helpful?

Solution

On an unforeseeable note, GLES20.glEnableVertexAttribArray(mTextureUniformHandle); was not set.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top