Bug with the Y offset axis

I have noticed that when exporting textures sometimes the texture coordinates (KHR_texture_transform) are not converted correctly. What I discovered was that the Y axis of the offset needs to be reversed i.e multiplied by -1.
That works fine for most cases but in some cases does not. Can somebody take a look at this?

Here are the tests that I run and their outcome.
The test result is after I applied the * -1 on the Y offset

Texture_is_scaled_2_by_2 = pass
Texture_is_scaled_2_by_2_offset_X_0_3 = pass 
Texture_is_scaled_2_by_2_offset_Y_0_3 = fail, looks flipped
Texture_is_scaled_2_by_2_offset_0_3_by_0_3 = fail, looks flipped

Texture_is_scaled_1_6_by_1_6 = pass
Texture_is_scaled_1_6_by_1_6_offset_X_0_3 = pass
Texture_is_scaled_1_6_by_1_6_offset_Y_0_3 = pass
Texture_is_scaled_1_6_by_1_6_offset_Y_0_3_negative = slight shift on Y
Texture_is_scaled_1_6_by_1_6_offset_0_3_by_0_3 = pass
Texture_is_scaled_1_by_2_offset_Y_0_3 = fail, looks flipped

Texture_is_scaled_1_by_1_6 = pass
Texture_is_scaled_1_by_2 = pass
Texture_is_scaled_2_by_1_6 = pass
Texture_is_scaled_2_2_by_1_6 = pass

Texture_is_scaled_3_by_3 = pass 
Texture_is_scaled_3_2_by_3 = pass
Texture_is_scaled_1_6_by_1 = pass

offset_X_0_3 = pass
offset_X_0_3_negative = pass

offset_Y_0_3 = fail, looks flipped
offset_Y_0_3_negative = fail, looks flipped

adding @bghgary

Is this for the Babylon.js serializers or the DCC exporter?

Its for the 3ds Max exporter

Adding @Guillaume_Pelletier to see if he can offer some insight

1 Like

Hello,
May i have the test scene to have a look.

gltf_coordinates_issue.zip (279.3 KB)
Here is a test scene, it only has a plane with a simple material. The material has one texture with 1.6 x 1.6 tiling. If you add - to the offset Y value in the gltf file you should get same result as the 3ds max viewport.

Any news here?

@Guillaume_Pelletier will have a look soon, it was all vacation period in France :slight_smile:

1 Like

hello guy’s,
Just published a PR, please review before merge.

2 Likes