From c794de8eeac935649aa556f009776567ed201787 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 21 Feb 2020 03:48:46 +0100 Subject: Fix texture coordinates for obj files (flip y coord) --- src/model_loader/ObjModelLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/model_loader/ObjModelLoader.cpp b/src/model_loader/ObjModelLoader.cpp index a42f8d7..f70123a 100644 --- a/src/model_loader/ObjModelLoader.cpp +++ b/src/model_loader/ObjModelLoader.cpp @@ -179,7 +179,7 @@ namespace amalgine { if(num_columns == 2) { columns[0].data[columns[0].size] = '\0'; columns[1].data[columns[1].size] = '\0'; - temp_texture_coords.push_back({ atof(columns[0].data), atof(columns[1].data) }); + temp_texture_coords.push_back({ atof(columns[0].data), 1.0f - atof(columns[1].data) }); } } else if(line_data.size > 7 && memcmp(line_data.data, "mtllib ", 7) == 0) { StringView column_data = { line_data.data + 7, line_data.size - 7 }; -- cgit v1.2.3