Hey, I mapped a UV value between [0.1, 1.1] to [0, 1], which is equivalent to rotating a circle by one tenth, but at the point where the texture is connected appears a line. At first I think it may be casued by accuracy or aliasing, however it seems not after tested.
Here is the problem image:
and this is the code:
sphereGeometry = new THREE.SphereGeometry(10, 60, 40);
sphereMaterial = new THREE.ShaderMaterial({
uniforms: {
originalTexture: { value: originalImage },
},
fragmentShader: `
precision mediump float;
uniform sampler2D originalTexture;
varying vec2 vUv;
float getPosition(float p, float offset) {
if (p + offset > 1.) {
return p + offset - 1.;
}
return p + offset;
}
vec2 GeneratePosition(vec2 v, vec2 offset) {
return vec2(getPosition(v.x, offset.x), getPosition(v.y, offset.y));
}
void main() {
gl_FragColor = texture2D(originalTexture,GeneratePosition(vUv, vec2(0.01, 0.)));
}
`,
vertexShader: `
varying vec2 vUv;
void main() {
vUv = uv;
vec4 modelViewPosition = modelViewMatrix * vec4(position, 1.0);
gl_Position = projectionMatrix * modelViewPosition;
}
`,
side: THREE.BackSide,
});
sphere = new THREE.Mesh(sphereGeometry, sphereMaterial);
scene.add(sphere);