0

I'm new to Three.js and JavaScript.

I made an object with material in Blender after UV unwrapping it twice for bump maps. Then, I exported it by using THREE.JSONLoader.

The object is showing up, but the problem is, it's using the first UV map for bump maps. However, I want it to use the second UV map.

In this case, how can I make it use the second UV map? What coding is needed?

Thank you for reading.

WestLangley
  • 102,557
  • 10
  • 276
  • 276
Ricky
  • 3
  • 2

1 Answers1

0

This is currently a limitation of three.js.

The default materials in three.js all use the first set of UVs for all maps, with the exception of the light map and ambient occlusion map, which each use the second set of UVs.

Your workarounds are to hack the library, write a custom ShaderMaterial, or modify your geometry and/or textures. Since you are new to three.js and JS, I'd suggest the latter.

Also see this related answer.

three.js r.90

WestLangley
  • 102,557
  • 10
  • 276
  • 276
  • Oh really, I didn't know that it was not available unless we hack it. And the fact that light map and ambient occlusion map use the SECOND UVs makes me wonder why. However, thank you very much for answering. I backed into Blender and modified the file so that only one UV exists in it. Then, it's working now! – Ricky Feb 26 '18 at 13:57
  • OK, that's how this site works. Thanks for telling me. – Ricky Feb 27 '18 at 04:36