Skip to content
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

Draco v1.5.5 release. #937

Merged
merged 1 commit into from
Oct 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ delays can result in transient errors that can be difficult to diagnose when
new Draco releases are launched. To avoid the issue pin your sites to a
versioned release.

### Version 1.5.5 release:
* Using the versioned www.gstatic.com WASM and Javascript decoders continues
to be recommended. To use v1.5.5, use this URL:
* https://www.gstatic.com/draco/versioned/decoders/1.5.5/*
* Bug fix: https://github.com/google/draco/issues/935

### Version 1.5.4 release:
* Using the versioned www.gstatic.com WASM and Javascript decoders continues
to be recommended. To use v1.5.4, use this URL:
Expand Down
2 changes: 1 addition & 1 deletion cmake/draco_build_definitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ macro(draco_set_build_definitions)
# passed to libtool.
#
# We set DRACO_SOVERSION = [c-a].a.r
set(LT_CURRENT 6)
set(LT_CURRENT 7)
set(LT_REVISION 0)
set(LT_AGE 0)
math(EXPR DRACO_SOVERSION_MAJOR "${LT_CURRENT} - ${LT_AGE}")
Expand Down
2 changes: 1 addition & 1 deletion docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ GEM
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.5)
tzinfo (1.2.10)
thread_safe (~> 0.1)
unf (0.1.4)
unf_ext
Expand Down
2 changes: 1 addition & 1 deletion javascript/npm/draco3d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
News
=======

Check out the [README](https://github.com/google/draco/blob/1.5.4/README.md)
Check out the [README](https://github.com/google/draco/blob/1.5.5/README.md)
file for news about this release.

Description
Expand Down
2 changes: 1 addition & 1 deletion javascript/npm/draco3d/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "draco3d",
"version": "1.5.4",
"version": "1.5.5",
"description": "Draco is a library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.",
"main": "draco3d.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion javascript/npm/draco3dgltf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Draco github glTF branch URL: https://github.com/google/draco/tree/gltf_2.0_drac
News
=======

Check out the [README](https://github.com/google/draco/blob/1.5.4/README.md)
Check out the [README](https://github.com/google/draco/blob/1.5.5/README.md)
file for news about this release.

NPM Package
Expand Down
2 changes: 1 addition & 1 deletion javascript/npm/draco3dgltf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "draco3dgltf",
"version": "1.5.4",
"version": "1.5.5",
"description": "This package contains a specific version of Draco 3D geometric compression library that is used for glTF Draco mesh compression extension.",
"main": "draco3dgltf.js",
"scripts": {
Expand Down
Binary file modified maya/draco_maya_wrapper_macos.tar.bz
Binary file not shown.
Binary file modified maya/draco_maya_wrapper_windows.tar.bz
Binary file not shown.
4 changes: 1 addition & 3 deletions src/draco/core/draco_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
namespace draco {

// Draco version is comprised of <major>.<minor>.<revision>.
static const char kDracoVersion[] = "1.5.4";

const char *Version() { return kDracoVersion; }
static const char kDracoVersion[] = "1.5.5";

} // namespace draco

Expand Down
60 changes: 0 additions & 60 deletions src/draco/core/vector_d_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ typedef draco::Vector5ui Vector5ui;
typedef draco::VectorD<int32_t, 3> Vector3i;
typedef draco::VectorD<int32_t, 4> Vector4i;

template <class CoeffT, int dimension_t>
void TestSquaredDistance(const draco::VectorD<CoeffT, dimension_t> v1,
const draco::VectorD<CoeffT, dimension_t> v2,
const CoeffT result) {
CoeffT squared_distance = SquaredDistance(v1, v2);
ASSERT_EQ(squared_distance, result);
squared_distance = SquaredDistance(v2, v1);
ASSERT_EQ(squared_distance, result);
}

TEST(VectorDTest, TestOperators) {
{
const Vector3f v;
Expand Down Expand Up @@ -170,56 +160,6 @@ TEST(VectorTest, TestGetNormalizedWithZeroLengthVector) {
ASSERT_EQ(normalized[2], 0);
}

TEST(VectorDTest, TestSquaredDistance) {
// Test Vector2f: float, 2D.
Vector2f v1_2f(5.5, 10.5);
Vector2f v2_2f(3.5, 15.5);
float result_f = 29;
TestSquaredDistance(v1_2f, v2_2f, result_f);

// Test Vector3f: float, 3D.
Vector3f v1_3f(5.5, 10.5, 2.3);
Vector3f v2_3f(3.5, 15.5, 0);
result_f = 34.29;
TestSquaredDistance(v1_3f, v2_3f, result_f);

// Test Vector4f: float, 4D.
Vector4f v1_4f(5.5, 10.5, 2.3, 7.2);
Vector4f v2_4f(3.5, 15.5, 0, 9.9);
result_f = 41.58;
TestSquaredDistance(v1_4f, v2_4f, result_f);

// Test Vector5f: float, 5D.
Vector5f v1_5f(5.5, 10.5, 2.3, 7.2, 1.0);
Vector5f v2_5f(3.5, 15.5, 0, 9.9, 0.2);
result_f = 42.22;
TestSquaredDistance(v1_5f, v2_5f, result_f);

// Test Vector 2ui: uint32_t, 2D.
Vector2ui v1_2ui(5, 10);
Vector2ui v2_2ui(3, 15);
uint32_t result_ui = 29;
TestSquaredDistance(v1_2ui, v2_2ui, result_ui);

// Test Vector 3ui: uint32_t, 3D.
Vector3ui v1_3ui(5, 10, 2);
Vector3ui v2_3ui(3, 15, 0);
result_ui = 33;
TestSquaredDistance(v1_3ui, v2_3ui, result_ui);

// Test Vector 4ui: uint32_t, 4D.
Vector4ui v1_4ui(5, 10, 2, 7);
Vector4ui v2_4ui(3, 15, 0, 9);
result_ui = 37;
TestSquaredDistance(v1_4ui, v2_4ui, result_ui);

// Test Vector 5ui: uint32_t, 5D.
Vector5ui v1_5ui(5, 10, 2, 7, 1);
Vector5ui v2_5ui(3, 15, 0, 9, 12);
result_ui = 158;
TestSquaredDistance(v1_5ui, v2_5ui, result_ui);
}

TEST(VectorDTest, TestCrossProduct3D) {
const Vector3i e1(1, 0, 0);
const Vector3i e2(0, 1, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/draco/mesh/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ class Mesh : public PointCloud {
// Removes points that are not mapped to any face of the mesh. All attribute
// values are going to be removed as well.
void RemoveIsolatedPoints();
#endif

// Adds a point attribute |att| to the mesh and returns the index of the
// newly inserted attribute. Attribute values are mapped 1:1 to face indices.
// Returns -1 in case of error.
int32_t AddPerFaceAttribute(std::unique_ptr<PointAttribute> att);
#endif // DRACO_TRANSCODER_SUPPORTED

MeshAttributeElementType GetAttributeElementType(int att_id) const {
return attribute_data_[att_id].element_type;
Expand Down
32 changes: 32 additions & 0 deletions src/draco/scene/scene_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,38 @@ bool SceneUtils::IsDracoCompressionEnabled(const Scene &scene) {
return false;
}

IndexTypeVector<MeshIndex, Eigen::Matrix4d>
SceneUtils::FindLargestBaseMeshTransforms(const Scene &scene) {
IndexTypeVector<MeshIndex, Eigen::Matrix4d> transforms(
scene.NumMeshes(), Eigen::Matrix4d::Identity());

// In case a mesh has multiple instances we want to use the instance with
// the largest scale.
IndexTypeVector<MeshIndex, float> transform_scale(scene.NumMeshes(), 0.f);

const auto instances = SceneUtils::ComputeAllInstances(scene);
for (MeshInstanceIndex i(0); i < instances.size(); ++i) {
const auto &instance = instances[i];

// Compute the scale of the transform.
const Vector3f scale_vec(instance.transform.col(0).norm(),
instance.transform.col(1).norm(),
instance.transform.col(2).norm());

// In our framework we support uniform scale only. For now, just take the
// maximum scale across all axes.
// TODO(ostava): Investigate how to properly support non-uniform scaling.
const float max_scale = scale_vec.MaxCoeff();

if (transform_scale[instance.mesh_index] < max_scale) {
transform_scale[instance.mesh_index] = max_scale;
transforms[instance.mesh_index] = instance.transform;
}
}

return transforms;
}

} // namespace draco

#endif // DRACO_TRANSCODER_SUPPORTED
5 changes: 5 additions & 0 deletions src/draco/scene/scene_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ class SceneUtils {

// Returns true if geometry compression is eabled for any of |scene| meshes.
static bool IsDracoCompressionEnabled(const Scene &scene);

// Returns a single tranformation matrix for each base mesh of the |scene|
// corresponding to the instance with the maximum scale.
static IndexTypeVector<MeshIndex, Eigen::Matrix4d>
FindLargestBaseMeshTransforms(const Scene &scene);
};

} // namespace draco
Expand Down
20 changes: 20 additions & 0 deletions src/draco/scene/scene_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,26 @@ TEST(SceneUtilsTest, TestSetDracoCompressionOptions) {
ASSERT_FALSE(scene->GetMesh(MeshIndex(3)).IsCompressionEnabled());
}

TEST(SceneUtilsTest, TestFindLargestBaseMeshTransforms) {
// Tests that FindLargestBaseMeshTransforms() works as expected.
auto scene =
draco::ReadSceneFromTestFile("CubeScaledInstances/glTF/cube_att.gltf");
ASSERT_NE(scene, nullptr);

// There should be one base mesh with four instances.
ASSERT_EQ(scene->NumMeshes(), 1);
ASSERT_EQ(draco::SceneUtils::ComputeAllInstances(*scene).size(), 4);

const auto transforms =
draco::SceneUtils::FindLargestBaseMeshTransforms(*scene);

ASSERT_EQ(transforms.size(), 1); // One transform for the single base mesh.

// The largest instance should have a uniform scale 4.
const draco::MeshIndex mi(0);
ASSERT_EQ(transforms[mi].diagonal(), Eigen::Vector4d(4, 4, 4, 1));
}

} // namespace

#endif // DRACO_TRANSCODER_SUPPORTED
Binary file modified unity/Plugin/libdracodec_unity_android.tar.bz
Binary file not shown.
Binary file modified unity/Plugin/libdracodec_unity_ios.tar.bz
Binary file not shown.
Binary file modified unity/Plugin/libdracodec_unity_macos.tar.bz
Binary file not shown.
Binary file modified unity/Plugin/libdracodec_unity_windows.tar.bz
Binary file not shown.