Texture edges are moving when camera is moved

眉间皱痕 提交于 2019-12-08 05:44:51

问题


The textures look good as long as the camera remains in a fixed position and rotation. However, when the camera is moving or rotating, (partial) lines appear between textures. I think it has to do something with subpixel correction. The texel is switching between the previous and the next one.

For my textures I use:

glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );

glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );

The same problem appears when using GL_NEAREST.

The fragment shader uses simple texture lookups:

color = texture( textureID, UV );

Or maybe this is an aliasing problem?

Edit - image

Edit - UV image: same problem

Edit Normals as colors

It looks like the depth is not sorted well.

I am using perspective projection.

来源:https://stackoverflow.com/questions/33087680/texture-edges-are-moving-when-camera-is-moved

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!