johnzero7 / XNALaraMesh

Blender addon Import/Export XPS Models, Poses
536 stars 94 forks source link

Invert Normal Node? #50

Closed ArieLeo closed 5 years ago

ArieLeo commented 5 years ago

What the reason of inverting the normal map? it well literally inverting the normal vector which causing weird shading in eevee image image

and here's the result if i bypass the invert node image

as you can see bypassing the invert normal node giving me correct normal direction.

I'm just wondering why the normal have to be inverted from the start.

johnzero7 commented 5 years ago

Blender and XPS have different coordinate systems. Blender is X+Y+Z+ XPS is X+Y-Z+

That means that to get the same result in XPS and Blender you need to invert the Green channel (or Y channel). The addon created that node and assigns the values R0 G1 B0 to invert only the Green to see the same result in Blender that you would get in XPS.

It uses 0 to leave the channel as it is and 1 to invert it. Any other value will produce wired results, for example .5 will nullify the channel

chocmake commented 5 years ago

Update Despite no reply here to mention it, the repo appears to have had a v2.0 update for Blender 2.8 added following this post. At the time of writing previously v1.9.2 was the addon version stated to be compatible for Blender 2.8 and which apparently had the issue described (now removed from the Releases it appears). v2.0 resolved this inverted node problem. Good stuff.

So this was what was inverting the lighting of the scene. Btw using the latest version of the plugin the values weren't as per the above post, but instead to R0 G3 B4, any idea why? As resetting it to the values described above fix the inverted lighting issue but it was required for every import. @johnzero7

Default values in latest version (checked in multiple different model imports) using Blender 2.80.75.

Invert node default