Skip to content

Commit ae02fab

Browse files
authored
Merge pull request #854 from PhilipeSousa/fix-obj-uv-direction
Fix OBJ texture Y direction inversion (#841)
2 parents e55aa88 + dcfbfad commit ae02fab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/modules/data/modelData_obj.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static bool parseMtl(char* path, char* base, ModelDataIO* io, arr_image_t* image
5454
.color = { 1.f, 1.f, 1.f, 1.f },
5555
.glow = { 0.f, 0.f, 0.f, 1.f },
5656
.uvShift = { 0.f, 1.f },
57-
.uvScale = { 1.f, -1.f },
57+
.uvScale = { 1.f, 1.f },
5858
.metalness = 1.f,
5959
.roughness = 1.f,
6060
.clearcoat = 0.f,
@@ -207,7 +207,7 @@ bool lovrModelDataInitObj(ModelData** result, Blob* source, ModelDataIO* io) {
207207
float vt[2];
208208
char* s = line + 3;
209209
vt[0] = strtof(s, &s);
210-
vt[1] = strtof(s, &s);
210+
vt[1] = 1.0f - strtof(s, &s);
211211
arr_append(&uvs, vt, 2);
212212
} else if (line[0] == 'f' && line[1] == ' ') {
213213
char* s = line + 2;

0 commit comments

Comments
 (0)