Skip to content

Commit 1cef736

Browse files
authored
Use correct normals for meshes loaded via fast_obj (#53)
2 parents 441b723 + 712f7a4 commit 1cef736

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scene.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static bool loadObj(std::vector<Vertex>& vertices, const char* path)
144144
v.tp = 0;
145145
v.np = (meshopt_quantizeSnorm(obj->normals[gi.n * 3 + 0], 10) + 511) |
146146
(meshopt_quantizeSnorm(obj->normals[gi.n * 3 + 1], 10) + 511) << 10 |
147-
(meshopt_quantizeSnorm(obj->normals[gi.n * 3 + 1], 10) + 511) << 20;
147+
(meshopt_quantizeSnorm(obj->normals[gi.n * 3 + 2], 10) + 511) << 20;
148148
v.tu = meshopt_quantizeHalf(obj->texcoords[gi.t * 2 + 0]);
149149
v.tv = meshopt_quantizeHalf(obj->texcoords[gi.t * 2 + 1]);
150150
}

0 commit comments

Comments
 (0)