Hi!
I was updating some details on my node materials and I stepped upon something weird.
I’m currently transferring material settings from a regular non-node material to a node material. For pretty much everything else it worked smoothly. But with normal maps something is weird.
In TSL I found the normalMap(<textureNode>, ?<scaleNode<vec2>>) function that takes a texture(<THREE.Texture>, ?<uvNode>) and I am using texture() on other parts and it works fine. normalMap() extends vec3 so technically it’s ready for normalNode that takes vec3 inputs alike. But when I use the following code. It just simply does nothing. Also I doubled checked the data passed in the nodes and everything seems perfectly fine.
newNodeMaterial.normalNode = normalMap(texture(material.normalMap, uv(material.normalMap.channel)), vec2(material.normalScale));
I can’t seem to be able to load normal map textures with node materials and TSL.
So has anyone successfully loaded normal map textures on a fresh node material ?
Inspired initially by this example: three.js examples
Inside they load a bump map with bumpMap() that seems very similar to normalMap(). Although after some digging, I found out by checking the source code that with bumpMap() you give a texture() but with normalMap() you need to give a vec3 already. So maybe it’s just a matter of converting texture data from texture() to vec3. I tried to called texture(...).rgb and vec3(texture(...)) with no success. It’s really confusing that normal maps can’t be loaded with their textures directly when other comparable material data can.
Can I easily convert texture() to a vec3, how ?