Has there anything changed how BabylonJs handle Normalmaps?

Has there anything changed how the engine does calculate normalmaps.?
openGl vs. DX.?
looks like the green channel is flipped now?

Its possible we cahnged something in our workflow im not sure.

hi. i have same problems. bjs works with opengl convention. but when i export models in fbx for substance painter, paint textures and after this steps back to 3ds max and apply textures from substance painter to my materials and with this textures i export to bjs and… get problems with odd inverted green channel… and i catch error… when exporting in fbx with smooth groups. so maybe you have similar problems with smooth groups. try to dont export Smooth groups

Not changed on our side

In any case there is something not working like it should.
I will do further testing.

Are we have to bake mikkt space or “standard” unity like normalmaps?

in painter textures export you can select textures channels and customize e.g. combine rough and metallic and select type of normalmap you need select opengl format. i dont know what type of convention use in unity i think directX… but bjs use gltf normal maps convention and gltf convention is opengl format. LearnOpenGL - Normal Mapping

Thnks for the hint with the gltf normalmaps.

I fear there is something broken.
Cause if i export a gltf from maya with the BabylonJS exporter it does look right.

Is it possible that BabylonJS is reading the normalmap in the wrong colorspace?
sRGB vs linear?

looks like my fail.
I havnt checked export tangents in the babylon exporter.

I do further tests.

1 Like

Does look fine now on this asset.

4 Likes

Think i found the issue.

Its the Blinn Shader we use sometimes.
The Blinn shader does something wrong if you export to a .babylon file.

I assume the Blinn does ignore the color management.

Its not a color management issue.

Looks like the blinn shader does need inverted normalmaps.
And it does not recalculate UV shell rotation.

Good catch!!

1 Like

I’ve run into this a lot where my normals don’t look correct, anything you find out id be interested.

At one point I did a shader that converted black and white height maps to a normal map and for the life of me I could not get the z value to work and ended up switching between 1-z and z trying to figure out wtf but never really got to the end of the road; Might be related (god it feels so good to type with two hands{unrelated}).

(Nice model by the way :slight_smile: )

@Deltakosh
Did you filled a bug or should i do it?

well do you consider it a bug? I may have misunderstood then. Do you think this is a bug with the way we export blinn material? I thought you found it was a problem with the way you used Blinn

Pinging @drigax then

Yes i would call it a bug. An engine should use only one flavor of normalmaps. And it should be possible to concider UV rotations for Blinn shaders.

we actually support all kind of normal maps (as we can invert on X and Y) but I agree it should work out of the box for our exporters

1 Like

I would say we have here two diffrent issues.

  1. Maya does export the wrong normalmap orientation for blinn shaders.

  2. BabylonJs does not recalculate UV shell orientations for Blinn Shaders.

Hope this info does help to fix the issues.