I’m afraid it doesn’t support mapping. But you can make your custom shader. Use this ShaderMaterial with a BufferGeometry that contains position and uv attributes:
var uniforms = {
texture: yourTexture
};
var shaderMaterial = new THREE.ShaderMaterial( {
uniforms: uniforms,
vertexShader: document.getElementById( 'vertexshader' ).textContent,
fragmentShader: document.getElementById( 'fragmentshader' ).textContent,
} );
But how can I draw lines that don’t seem to be affected by any light? I see the same thing in the official website example. It’s cool to have a smooth surface like a cylinder, if you can. I don’t want every pixel to look like a color.
Before that, I used Instanced and Tube graphics to draw, but because of the large amount of data generated by a large number of triangles will lead to FPS reduction and memory overhead. Ultimately, I used the width of the line to render, and it would be perfect if I could achieve the desired effect as shown in the picture.
I was trying to make a fiddle showing how to use texture mapping in a ShaderMaterial with a Line. The uv coordinates seems to be all right, but when sampling the texture it reads black.
As it is right now, the fiddle maps the u coordinate to the red channel, going from black to red from the center of the spiral outwards.
If you uncomment the line marked in the fragment shader, the texture should be used and the line should show color patches. But the line shows black.