Normal Map isn't changing :/

Hey there,
I just started with three js and I cant figure out how to change the normal map. I watched a video explaining it (Getting Started with THREE.JS in 2021! - YouTube) and I am doing the same as him but my normal map remains the same. At first I wanted to change it and my object was just black. Then somehow it started working but now i cant use another normal map…

const textureLoader = new THREE.TextureLoader()

const normalTexture = textureLoader.load('/texture/planet.png')
const material = new THREE.MeshStandardMaterial()

material.metalness = 0.7

material.roughness = 0.2

material.normalMap = normalTexture

material.color = new THREE.Color(0x292929)

Any chances to demonstrate what’s going wrong? Try it by modifying the following live example: https://jsfiddle.net/mxnp8uz4/

I am sharing a link:

const normalTexture = textureLoader.load('/texture/planet.png')

The texture on the screenshot is not the normal map I assigned to it above. planet.png is a different file than that is shown.

Sorry, but this is not helpful. You have to share a complete code example so it’s possible to investigate the issue.

Nevermind. I got it working by restarting everything. Thanks anyways!

Maybe you need to add wait while texture will be loaded. After restart maybe texture in cache and at another user will be again not changing.

Definitely no.

2 Likes