Skip to content

Commit ec969db

Browse files
committed
Fix loading texture coordinates bug
1 parent 547b55d commit ec969db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ray-tracing-cuda/model.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ struct Model {
9595
for (int k = 0; k < 3; k++) {
9696
int idx = mesh->mFaces[j].mIndices[k];
9797
auto vertex = mesh->mVertices[idx];
98-
glm::vec2 vec2;
99-
if (HasTexCoord) {
98+
glm::vec2 vec2(0);
99+
if (HasTexCoord && mesh->HasTextureCoords(0)) {
100100
vec2 = glm::vec2(mesh->mTextureCoords[0][idx].x,
101101
mesh->mTextureCoords[0][idx].y);
102102
}

0 commit comments

Comments
 (0)