使用mipmap的纹理坐标不连续性会创建接缝
我刚刚开始学习openGL,并且在使用mipmap对球体进行纹理化时得到了此工件。基本上,当片段对我的纹理的边缘进行采样时,它会检测不连续性(例如从1到0)并选择最小的mipmap,从而创建此丑陋的接缝: 丑陋的缝http://cdn.imghack.se/images/6bbe0ad0173cac003cd5dddc94bd43c7.png 因此,我尝试使用textureGrad手动覆盖渐变: //fragVert is the original vertex from the vertex shader vec2 ll = vec2((atan(fragVert.y, fragVert.x) / 3.1415926 + 1.0) * 0.5, (asin(fragVert.z) / 3.1415926 + 0.5)); vec2 ll2 = ll; if (ll.x < 0.01 || ll.x > 0.99) ll2.x = .5; vec4 surfaceColor = textureGrad(material.tex, ll, dFdx(ll2), dFdy(ll2)); …