hi, very often I need to invert green (Y) channel in normal maps back and force only because of different 3d app renders models differently. This inverting option exist almost everywhere but I can’t find it in three js. Maybe I miss something?
Here’s best explanation of why this needs:
Basically it’ not the matter of API used to render normal map but mostly a matter of inverting of a green channel.
I’m not concidering changing the image itself. Also, this question discussed here without a resolution:
02:34AM - 18 Jun 14 UTC
04:57AM - 01 Jul 14 UTC
I posted this question on stackoverflow a few days ago and didn't get any replie
3ds max example:
Have you tried setting
normalScale.y to -1 in MeshStandardMaterial
nope, I never know it exists. will that invert a color of specific channel?
how I can use it for a material node? or map node?
I’m using phong material btw
Its in phong material also.
normalScale.xy basically gets multiplied to xy of the normal from the map. So setting it to -1 should invert it.
thank you. seems like I can’t find a way to properly use it.
material.normalScale.set( 0.0, -1.0 );
yes, probably also set
material.needsUpdate = true
material.normalScale.set( 1, -1 );
but that doesn’t seem work. also I have
THREE.WebGLRenderer: Texture marked for update but image is undefined warning all the time with fbxloader()
I see this demo:
and this source code: three.js/webgl_materials_displacementmap.html at 00a692864f541a3ec194d266e220efd597eb28fa · mrdoob/three.js · GitHub
but I can’t implement it to my code for some reason.
okay, I resolved update warning by this code:
var tex = material.map.clone();
tex.needsUpdate = true;
but normalScale still doesn’t work. any thoughts how to make it work?
okay, I resolved it with:
material.normalScale = new THREE.Vector2(-1, -1);
but for some reason now it ignores my
so, increasing these parameters actually fixed the issue:
material.normalScale = new THREE.Vector2(-2.2, -2.2);
case closed. thank you