You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello again. This is related to GLView but since @PatriceVignola forked it I figure I'd post this issue here. I'm having issues with detailed textures flickering when the model is moving:
It's a bit hard to tell from this GIF (couldn't upload video) but if you look closely there is a sort of static distortion on the detailed parts of the texture as the model rotates. It is quite visible on the device itself.
As far as I can tell the solution lies in altering initWithSize in GLImage.m. That or initWithData but changing that function hasn't done anything for me. I've tried messing around with this block in initWithSize:
I've tried passing GL_NEAREST, GL_NEAREST_MIPMAPNEAREST, and GL_LINEAR_MIPMAP_LINEAR where GL_LINEAR is but none of that has seemed to fix it. GL_NEAREST makes no difference whereas passing anything MIPMAP makes the texture white. Frankly I don't really know what I'm doing here so it's probably obvious why that didn't work.
Another solution I found was to implement anisotropic filtering by doing something like this:
The project builds fine with those lines but it doesn't seem to do anything, or I'm putting it in the wrong place.
Anyway those are the two most common solutions to the problem that I've found: mipmapping and anisotropic filtering. Does this sound right to you? Would appreciate your feedback when you get a chance.
The text was updated successfully, but these errors were encountered:
Hello again. This is related to GLView but since @PatriceVignola forked it I figure I'd post this issue here. I'm having issues with detailed textures flickering when the model is moving:
It's a bit hard to tell from this GIF (couldn't upload video) but if you look closely there is a sort of static distortion on the detailed parts of the texture as the model rotates. It is quite visible on the device itself.
As far as I can tell the solution lies in altering
initWithSize
in GLImage.m. That orinitWithData
but changing that function hasn't done anything for me. I've tried messing around with this block ininitWithSize
://create texture
glGenTextures(1, &_texture);
glBindTexture(GL_TEXTURE_2D, self.texture);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, imageData);
I've tried passing
GL_NEAREST
,GL_NEAREST_MIPMAPNEAREST
, andGL_LINEAR_MIPMAP_LINEAR
whereGL_LINEAR
is but none of that has seemed to fix it.GL_NEAREST
makes no difference whereas passing anythingMIPMAP
makes the texture white. Frankly I don't really know what I'm doing here so it's probably obvious why that didn't work.Another solution I found was to implement anisotropic filtering by doing something like this:
float aniso = 0.0f;
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &aniso);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, aniso);
The project builds fine with those lines but it doesn't seem to do anything, or I'm putting it in the wrong place.
Anyway those are the two most common solutions to the problem that I've found: mipmapping and anisotropic filtering. Does this sound right to you? Would appreciate your feedback when you get a chance.
The text was updated successfully, but these errors were encountered: