I've been struggling to understand normal mapping with Three.js. Despite my efforts, I can't seem to get it right.
Below is the code I've been working on:
Javascript:
var bufferGeometry = new THREE.BufferGeometry();
bufferGeometry.fromGeometry( new THREE.BoxGeometry(2,2,2) );
var positionAttributes = bufferGeometry.getAttribute('position');
var uvAttributes = bufferGeometry.getAttribute('uv');
// Rest of the JavaScript code...
Vertex shader:
// Vertex shader code here...
Fragment shader:
// Fragment shader code here...
Here is the outcome:
https://i.sstatic.net/3akfc.png
However, the end result doesn't look quite right. I've referenced a tutorial at , but I'm still unable to achieve the desired effect in Three.js. Any suggestions or insights would be greatly appreciated!