Merge pull request #51757 from RevoluPowered/fix-sprite3d-using-invalid-normals-tangents

Fix octahedral compression with Sprite3D
This commit is contained in:
Rémi Verschelde 2021-08-17 07:43:04 +02:00 committed by GitHub
commit daa5da0d2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -386,11 +386,11 @@ SpriteBase3D::SpriteBase3D() {
// create basic mesh and store format information
for (int i = 0; i < 4; i++) {
mesh_normals.write()[i] = Vector3(0.0, 0.0, 0.0);
mesh_normals.write()[i] = Vector3(0.0, 0.0, 1.0);
mesh_tangents.write()[i * 4 + 0] = 0.0;
mesh_tangents.write()[i * 4 + 1] = 0.0;
mesh_tangents.write()[i * 4 + 2] = 0.0;
mesh_tangents.write()[i * 4 + 3] = 0.0;
mesh_tangents.write()[i * 4 + 2] = 1.0;
mesh_tangents.write()[i * 4 + 3] = 1.0;
mesh_colors.write()[i] = Color(1.0, 1.0, 1.0, 1.0);
mesh_uvs.write()[i] = Vector2(0.0, 0.0);
mesh_vertices.write()[i] = Vector3(0.0, 0.0, 0.0);