Skip to content

Commit 6571558

Browse files
authored
Draco v1.5.0 release. (#779)
1 parent 3b3f109 commit 6571558

330 files changed

Lines changed: 35093 additions & 626900 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cmake-format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
# If comment markup is enabled, don't reflow the first comment block in
6565
# eachlistfile. Use this to preserve formatting of your
6666
# copyright/licensestatements.
67-
first_comment_is_literal = False
67+
first_comment_is_literal = True
6868

6969
# If comment markup is enabled, don't reflow any comment block which matchesthis
7070
# (regex) pattern. Default is `None` (disabled).

.gitmodules

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
[submodule "third_party/googletest"]
2-
path = third_party/googletest
3-
url = https://github.com/google/googletest.git
2+
path = third_party/googletest
3+
url = https://github.com/google/googletest.git
4+
[submodule "third_party/eigen"]
5+
path = third_party/eigen
6+
url = https://gitlab.com/libeigen/eigen.git
7+
[submodule "third_party/tinygltf"]
8+
path = third_party/tinygltf
9+
url = https://github.com/syoyo/tinygltf.git
10+
[submodule "third_party/filesystem"]
11+
path = third_party/filesystem
12+
url = https://github.com/gulrak/filesystem

BUILDING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ _**Contents**_
44
* [Mac OS X](#mac-os-x)
55
* [Windows](#windows)
66
* [CMake Build Configuration](#cmake-build-configuration)
7+
* [Transcoder](#transcoder)
78
* [Debugging and Optimization](#debugging-and-optimization)
89
* [Googletest Integration](#googletest-integration)
10+
* [Third Party Libraries](#third-party-libraries)
911
* [Javascript Encoder/Decoder](#javascript-encoderdecoder)
1012
* [WebAssembly Decoder](#webassembly-decoder)
1113
* [WebAssembly Mesh Only Decoder](#webassembly-mesh-only-decoder)
@@ -72,6 +74,21 @@ C:\Users\nobody> cmake ../ -G "Visual Studio 16 2019" -A x64
7274
CMake Build Configuration
7375
-------------------------
7476

77+
Transcoder
78+
----------
79+
80+
In order to build the `draco_transcoder` target, the transcoding support needs
81+
to be explicitly enabled when you run `cmake`, for example:
82+
83+
~~~~~ bash
84+
$ cmake ../ -DDRACO_TRANCODER_SUPPORTED=ON
85+
~~~~~
86+
87+
The above option is currently not compatible with our Javascript or WebAssembly
88+
builds but all other use cases are supported. Note that binaries and libraries
89+
built with the transcoder support may result in increased binary sizes of the
90+
produced libraries and executables compared to the default CMake settings.
91+
7592
Debugging and Optimization
7693
--------------------------
7794

@@ -135,6 +152,28 @@ To run the tests execute `draco_tests` from your build output directory:
135152
$ ./draco_tests
136153
~~~~~
137154

155+
Third Party Libraries
156+
---------------------
157+
158+
When Draco is built with transcoding and/or testing support enabled the project
159+
has dependencies on third party libraries:
160+
161+
- [Eigen](https://eigen.tuxfamily.org/)
162+
- Provides various math utilites.
163+
- [Googletest](https://github.com/google/googletest)
164+
- Provides testing support.
165+
- [Gulrak/filesystem](https://github.com/gulrak/filesystem)
166+
- Provides C++17 std::filesystem emulation for pre-C++17 environments.
167+
- [TinyGLTF](https://github.com/syoyo/tinygltf)
168+
- Provides GLTF I/O support.
169+
170+
These dependencies are managed as Git submodules. To obtain the dependencies
171+
run the following command in your Draco repository:
172+
173+
~~~~~ bash
174+
$ git submodule update --init
175+
~~~~~
176+
138177
WebAssembly Decoder
139178
-------------------
140179

CMakeLists.txt

Lines changed: 131 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
1616

17-
# Draco requires C++11.
17+
# Draco requires modern compiler support.
18+
set(CMAKE_C_STANDARD 99)
1819
set(CMAKE_CXX_STANDARD 11)
1920
project(draco C CXX)
2021

@@ -81,6 +82,7 @@ draco_reset_target_lists()
8182
draco_setup_options()
8283
draco_set_build_definitions()
8384
draco_set_cxx_flags()
85+
draco_set_exe_linker_flags()
8486
draco_generate_features_h()
8587

8688
# Draco source file listing variables.
@@ -508,12 +510,77 @@ list(APPEND draco_maya_plug_sources
508510
"${draco_src_root}/maya/draco_maya_plugin.cc"
509511
"${draco_src_root}/maya/draco_maya_plugin.h")
510512

513+
if(DRACO_TRANSCODER_SUPPORTED)
514+
list(APPEND draco_animation_sources
515+
"${draco_src_root}/animation/animation.cc"
516+
"${draco_src_root}/animation/animation.h"
517+
"${draco_src_root}/animation/node_animation_data.h"
518+
"${draco_src_root}/animation/skin.cc"
519+
"${draco_src_root}/animation/skin.h")
520+
521+
list(APPEND draco_io_sources
522+
"${draco_src_root}/io/gltf_decoder.cc"
523+
"${draco_src_root}/io/gltf_decoder.h"
524+
"${draco_src_root}/io/gltf_encoder.cc"
525+
"${draco_src_root}/io/gltf_encoder.h"
526+
"${draco_src_root}/io/gltf_utils.cc"
527+
"${draco_src_root}/io/gltf_utils.h"
528+
"${draco_src_root}/io/image_compression_options.h"
529+
"${draco_src_root}/io/scene_io.cc"
530+
"${draco_src_root}/io/scene_io.h"
531+
"${draco_src_root}/io/texture_io.cc"
532+
"${draco_src_root}/io/texture_io.h"
533+
"${draco_src_root}/io/tiny_gltf_utils.cc"
534+
"${draco_src_root}/io/tiny_gltf_utils.h")
535+
536+
list(APPEND draco_material_sources
537+
"${draco_src_root}/material/material.cc"
538+
"${draco_src_root}/material/material.h"
539+
"${draco_src_root}/material/material_library.cc"
540+
"${draco_src_root}/material/material_library.h")
541+
542+
list(APPEND draco_mesh_sources
543+
"${draco_src_root}/mesh/mesh_splitter.cc"
544+
"${draco_src_root}/mesh/mesh_splitter.h"
545+
"${draco_src_root}/mesh/mesh_utils.cc"
546+
"${draco_src_root}/mesh/mesh_utils.h")
547+
548+
list(APPEND draco_scene_sources
549+
"${draco_src_root}/scene/mesh_group.h"
550+
"${draco_src_root}/scene/scene.cc"
551+
"${draco_src_root}/scene/scene.h"
552+
"${draco_src_root}/scene/scene_indices.h"
553+
"${draco_src_root}/scene/scene_node.h"
554+
"${draco_src_root}/scene/scene_utils.cc"
555+
"${draco_src_root}/scene/scene_utils.h"
556+
"${draco_src_root}/scene/trs_matrix.cc"
557+
"${draco_src_root}/scene/trs_matrix.h")
558+
559+
list(APPEND draco_texture_sources
560+
"${draco_src_root}/texture/source_image.cc"
561+
"${draco_src_root}/texture/source_image.h"
562+
"${draco_src_root}/texture/texture.h"
563+
"${draco_src_root}/texture/texture_library.cc"
564+
"${draco_src_root}/texture/texture_library.h"
565+
"${draco_src_root}/texture/texture_map.cc"
566+
"${draco_src_root}/texture/texture_map.h"
567+
"${draco_src_root}/texture/texture_transform.cc"
568+
"${draco_src_root}/texture/texture_transform.h"
569+
"${draco_src_root}/texture/texture_utils.cc"
570+
"${draco_src_root}/texture/texture_utils.h")
571+
endif()
572+
511573
#
512574
# Draco targets.
513575
#
514576
if(EMSCRIPTEN AND DRACO_JS_GLUE)
515577
# Draco decoder and encoder "executable" targets in various flavors for
516-
# Emsscripten.
578+
# Emscripten.
579+
580+
if(DRACO_TRANSCODER_SUPPORTED)
581+
message(FATAL_ERROR "The transcoder is not supported in Emscripten.")
582+
endif()
583+
517584
list(APPEND draco_decoder_src
518585
${draco_attributes_sources}
519586
${draco_compression_attributes_dec_sources}
@@ -788,7 +855,45 @@ else()
788855
INCLUDES
789856
${draco_include_paths})
790857

791-
set(draco_object_library_deps
858+
if(DRACO_TRANSCODER_SUPPORTED)
859+
draco_add_library(
860+
NAME
861+
draco_material
862+
TYPE
863+
OBJECT
864+
SOURCES
865+
${draco_material_sources}
866+
DEFINES
867+
${draco_defines}
868+
INCLUDES
869+
${draco_include_paths})
870+
871+
draco_add_library(
872+
NAME
873+
draco_scene
874+
TYPE
875+
OBJECT
876+
SOURCES
877+
${draco_scene_sources}
878+
DEFINES
879+
${draco_defines}
880+
INCLUDES
881+
${draco_include_paths})
882+
883+
draco_add_library(
884+
NAME
885+
draco_texture
886+
TYPE
887+
OBJECT
888+
SOURCES
889+
${draco_texture_sources}
890+
DEFINES
891+
${draco_defines}
892+
INCLUDES
893+
${draco_include_paths})
894+
endif()
895+
896+
list(APPEND draco_object_library_deps
792897
draco_attributes
793898
draco_compression_attributes_dec
794899
draco_compression_attributes_enc
@@ -817,14 +922,19 @@ else()
817922
draco_points_dec
818923
draco_points_enc)
819924

925+
if(DRACO_TRANSCODER_SUPPORTED)
926+
list(APPEND draco_object_library_deps
927+
draco_material draco_scene draco_texture)
928+
endif()
929+
820930
# Library targets that consume the object collections.
821931
if(MSVC)
822932
# In order to produce a DLL and import library the Windows tools require
823933
# that the exported symbols are part of the DLL target. The unfortunate side
824934
# effect of this is that a single configuration cannot output both the
825935
# static library and the DLL: This results in an either/or situation.
826-
# Windows users of the draco build can have a DLL and an import library,
827-
# or they can have a static library; they cannot have both from a single
936+
# Windows users of the draco build can have a DLL and an import library, or
937+
# they can have a static library; they cannot have both from a single
828938
# configuration of the build.
829939
if(BUILD_SHARED_LIBS)
830940
set(draco_lib_type SHARED)
@@ -955,6 +1065,22 @@ else()
9551065
LIB_DEPS
9561066
${draco_dependency})
9571067

1068+
if(DRACO_TRANSCODER_SUPPORTED)
1069+
draco_add_executable(NAME
1070+
draco_transcoder
1071+
SOURCES
1072+
"${draco_src_root}/tools/draco_transcoder.cc"
1073+
"${draco_src_root}/tools/draco_transcoder_lib.cc"
1074+
"${draco_src_root}/tools/draco_transcoder_lib.h"
1075+
${draco_io_sources}
1076+
DEFINES
1077+
${draco_defines}
1078+
INCLUDES
1079+
${draco_include_paths}
1080+
LIB_DEPS
1081+
${draco_dependency})
1082+
endif()
1083+
9581084
draco_setup_install_target()
9591085
draco_setup_test_targets()
9601086
endif()

README.md

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,29 @@ delays can result in transient errors that can be difficult to diagnose when
1414
new Draco releases are launched. To avoid the issue pin your sites to a
1515
versioned release.
1616

17+
### Version 1.5.0 release
18+
* Adds the draco_transcoder tool. See the section below on the glTF transcoding
19+
tool, and BUILDING.md for build and dependency information.
20+
* Some changes to configuration variables have been made for this release:
21+
- The DRACO_GLTF flag has been renamed to DRACO_GLTF_BITSTREAM to help
22+
increase understanding of its purpose, which is to limit Draco features to
23+
those included in the Draco glTF specification.
24+
- Variables exported in CMake via draco-config.cmake and find-draco.cmake
25+
(formerly FindDraco.cmake) have been renamed. It's unlikely that this
26+
impacts any existing projects as the aforementioned files were not formed
27+
correctly. See [PR775](https://github.com/google/draco/pull/775) for full
28+
details of the changes.
29+
* A CMake version file has been added.
30+
* The CMake install target now uses absolute paths direct from CMake instead
31+
of building them using CMAKE_INSTALL_PREFIX. This was done to make Draco
32+
easier to use for downstream packagers and should have little to no impact on
33+
users picking up Draco from source.
34+
* Certain MSVC warnings have had their levels changed via compiler flag to
35+
reduce the amount of noise output by the MSVC compilers. Set MSVC warning
36+
level to 4, or define DRACO_DEBUG_MSVC_WARNINGS at CMake configuration time
37+
to restore previous behavior.
38+
* Bug fixes.
39+
1740
### Version 1.4.3 release
1841
* Using the versioned www.gstatic.com WASM and Javascript decoders continues
1942
to be recommended. To use v1.4.3, use this URL:
@@ -143,6 +166,7 @@ _**Contents**_
143166
* [Encoding Tool](#encoding-tool)
144167
* [Encoding Point Clouds](#encoding-point-clouds)
145168
* [Decoding Tool](#decoding-tool)
169+
* [glTF Transcoding Tool](#gltf-transcoding-tool)
146170
* [C++ Decoder API](#c-decoder-api)
147171
* [Javascript Encoder API](#javascript-encoder-api)
148172
* [Javascript Decoder API](#javascript-decoder-api)
@@ -185,9 +209,11 @@ Command Line Applications
185209
------------------------
186210

187211
The default target created from the build files will be the `draco_encoder`
188-
and `draco_decoder` command line applications. For both applications, if you
189-
run them without any arguments or `-h`, the applications will output usage and
190-
options.
212+
and `draco_decoder` command line applications. Additionally, `draco_transcoder`
213+
is generated when CMake is run with the DRACO_TRANSCODER_SUPPORTED variable set
214+
to ON (see [BUILDING](BUILDING.md#transcoder) for more details). For all
215+
applications, if you run them without any arguments or `-h`, the applications
216+
will output usage and options.
191217

192218
Encoding Tool
193219
-------------
@@ -254,8 +280,27 @@ The basic command line looks like this:
254280
./draco_decoder -i in.drc -o out.obj
255281
~~~~~
256282

283+
glTF Transcoding Tool
284+
---------------------
285+
286+
`draco_transcoder` can be used to add Draco compression to glTF assets. The
287+
basic command line looks like this:
288+
289+
~~~~~ bash
290+
./draco_transcoder -i in.glb -o out.glb
291+
~~~~~
292+
293+
This command line will add geometry compression to all meshes in the `in.glb`
294+
file. Quantization values for different glTF attributes can be specified
295+
similarly to the `draco_encoder` tool. For example `-qp` can be used to define
296+
quantization of the position attribute:
297+
298+
~~~~~ bash
299+
./draco_transcoder -i in.glb -o out.glb -qp 12
300+
~~~~~
301+
257302
C++ Decoder API
258-
-------------
303+
---------------
259304

260305
If you'd like to add decoding to your applications you will need to include
261306
the `draco_dec` library. In order to use the Draco decoder you need to

0 commit comments

Comments
 (0)