I am currently attempting to incorporate a normal map (specifically a wood texture) onto a custom part I created using THREE.BufferGeometry() and vertices.
For this specific part:
//edit Initially, I omitted this section when posting. My script recognizes this directory and does not generate any errors.
const woodPattern = new THREE.TextureLoader();
const woodTexture = woodPattern.load('/textures/wood_pattern.jpg');
const frame_upper_part_geometry = new THREE.BufferGeometry();
const frame_upper_part_positions = [
0.8, 0.8, 0.95,
-0.8, 0.8, 0.95,
-0.8, 0.8, 0.75,
-0.8, 0.8, 0.75,
0.8, 0.8, 0.75,
0.8, 0.8, 0.95,
0.6, 0.6, 0.95,
-0.6, 0.6, 0.95,
-0.6, 0.6, 0.75,
-0.6, 0.6, 0.75,
0.6, 0.6, 0.75,
0.6, 0.6, 0.95,
0.8, 0.8, 0.95,
0.6, 0.6, 0.95,
0.6, 0.6, 0.75,
0.6, 0.6, 0.75,
0.8, 0.8, 0.75,
0.8, 0.8, 0.95,
-0.8, 0.8, 0.95,
-0.6, 0.6, 0.95,
-0.6, 0.6, 0.75,
-0.6, 0.6, 0.75,
-0.8, 0.8, 0.75,
-0.8, 0.8, 0.95,
0.8, 0.8, 0.75,
-0.8, 0.8, 0.75,
-0.6, 0.6, 0.75,
-0.6, 0.6, 0.75,
0.6, 0.6, 0.75,
0.8, 0.8, 0.75,
];
frame_upper_part_geometry.setAttribute(
'position',
new THREE.Float32BufferAttribute( frame_upper_part_positions, 3 )
);
frame_upper_part_geometry.computeVertexNormals();
const frame_material = new THREE.MeshStandardMaterial({normalMap:woodTexture})
frame_material.side = THREE.DoubleSide;
frame_material.color = new THREE.Color(0x654321)
const frame_upper_part = new THREE.Mesh(frame_upper_part_geometry, frame_material)
scene.add(frame_upper_part)
I do not receive any errors, but despite adding the normal map, it doesn't appear to have an effect. However, if I added it the same way with a predefined geometry in THREE itself, it should work. Am I overlooking something?
This is the result I'm getting, no errors, but the effects of the normal map are not visible.