-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mipmapping regression #98
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of small comments
source/objects/Model.cpp
Outdated
@@ -94,7 +101,7 @@ Mesh::Mesh( | |||
tri.tangents[j] = glm::normalize(glm::vec3(tri.e1[0], tri.e1[1], tri.e1[2])); | |||
} | |||
|
|||
tri.uvs[j] = glm::vec2(verts[j]->texCoord.x, verts[j]->texCoord.y); | |||
tri.uvs[j] = uvs[j]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't be needed now that it's passed to the constructor right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, my mistake
source/objects/Primitives.h
Outdated
const bool oneSided = false | ||
) : p0(p0), e1(p0 - p1), e2(p2 - p0), material(material), oneSided(oneSided) | ||
) : p0(p0), e1(p0 - p1), e2(p2 - p0), material(material), uvs(), oneSided(oneSided) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this empty initialisation doing anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
memcpy(tri.normals, normals + vi0, sizeof(glm::vec3) * 3); | ||
memcpy(tri.tangents, tangents + vi0, sizeof(glm::vec3) * 3); | ||
memcpy(tri.uvs, uvs + vi0, sizeof(glm::vec2) * 3); | ||
memcpy(tri.alphas, alphas + vi0, sizeof(float) * 3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be ideal to pass the other data in via the constructor too, but not gonna make you do that
No idea why the build is failing now due to vcpkg (the repository has never used it) |
Fixes #96
PR Type (tick all that are applicable)
Tested Targets (only applicable for changes to the binary module, delete otherwise)
Checklist
Description
Properly passes the UVs of any world/model triangle into the
TriangleBackfaceCull
class so that the data is intact once it callsComputeNormalAndLoD()