Texture repeating results in black objects

Started by
9 comments, last by Vorel512 12 years ago

[quote name='Vorel512' timestamp='1334574713' post='4931687']
Okay, so...

If I put the texture parameters before the texture creation the scene renders perfect.
I assume, that GLKTextureLoader "lock" the params.


You mean, you put your glTexParameteri calls to occur before the calls to glBindTexture and/or the line [GLKTextureLoader textureWithContentsOfFile... ? This will result in the glTexParameteri calls applied to whatever old texture that happened to be bound to GL_TEXTURE_2D, and not the new texture you loaded.

In OpenGL ES, to enable GL_REPEAT, the texture MUST have width and height power of 2. If not, GLES is specified to give silent failure at your face, and read black from the texture instead. See the Notes part at glTexParameter documentation pages to confirm this.

With your original code, try replacing GL_REPEAT with GL_CLAMP_TO_EDGE to test that the texture will then render properly.
[/quote]
Hi clb!

My problem were solved! By the way thanks for the reply!!!!!

This topic is closed to new replies.

Advertisement