mirror of
https://github.com/open-goal/jak-project
synced 2026-08-21 23:00:45 -04:00
[custom levels] A few bug fixes (#3736)
- Bug fix to KD tree splitting, should fix cases with bad vertex colors/alphas. - Normalize normals instead of asserting if they are the wrong length. **the fact that blender exports normals incorrectly is a bug and I doubt their implementation is correct if you've scaled things on only on axis.** - Automatically resize metallic texture (envmap strength) if it doesn't match the size of the rgb texture instead of asserting Co-authored-by: water111 <awaterford1111445@gmail.com>
This commit is contained in:
@@ -323,7 +323,8 @@ ExtractedVertices gltf_vertices(const tinygltf::Model& model,
|
||||
normals = extract_vec3f(data_ptr, count, byte_stride);
|
||||
for (auto& nrm : normals) {
|
||||
math::Vector4f nrm4(nrm.x(), nrm.y(), nrm.z(), 0.f);
|
||||
nrm = (w_T_local * nrm4).xyz();
|
||||
// we found that normals aren't normalized if an object is scaled in blender.
|
||||
nrm = (w_T_local * nrm4).xyz().normalized();
|
||||
}
|
||||
ASSERT(normals.size() == result.size());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user