90 Commits

Author SHA1 Message Date
Arseny Kapoulkine 8dd018ac65 Update version to 0.22 everywhere 2024-10-23 16:36:37 -07:00
Arseny Kapoulkine 3b2ffa24d3 gltfpack: Switch from manual UTF8 conversion to a manifest
Since CMake supports manifest files as sources, it's a little easier to
specify UTF-8 as the ANSI encoding via that; this is embedded into .exe
and is used for command line arguments as well so the rest of the code
just works.
2024-09-13 23:12:29 -07:00
Arseny Kapoulkine 8d97dd7ad2 demo: Add nanite.cpp along with -n (make nanite)
This is a stub that will be expanded to provide a demo of Nanite-like
(hierarchical clustered level of detail) processing. This is necessary
both to serve as an example of how to implement it using all best
practices as well as a testing harness; right now meshoptimizer has
enough functionality to implement *a* pipeline, but for best performance
currently some algorithms need to be swapped out. Long term the goal is
for this to be close to optimal while using just meshopt_ functions.
2024-09-03 11:51:54 -07:00
Arseny Kapoulkine 99c69460e9 Update version to 0.21
Also rebuild meshopt_simplifier wasm to accomodate recent improvements.
2024-06-25 09:57:52 -07:00
Arseny Kapoulkine 20a6c3596f Add MESHOPT_SOVERSION CMake option to specify soversion
This patch is taken from Debian patches:
https://salsa.debian.org/roehling/meshoptimizer/-/blob/master/debian/patches/0001-Add-SOVERSION-to-library.patch?ref_type=heads

Specifying soversion currently is at the guidance of the packager;
experimental APIs are not ABI stable but non-experimental APIs are ABI
stable. Since gltfpack uses experimental APIs as well, it probably means
that distributions need to bump soversion on library updates in
practice.

Fixes #644.
2024-01-31 10:00:21 -08:00
Arseny Kapoulkine 4546fed287 Update version to 0.20 2023-11-02 08:53:55 -07:00
Arseny Kapoulkine 9de52583ab Clean up parsing library integration
- Move meshloader.cpp to gltf/parselib.cpp to make it easier to
  customize the build for gltfpack
- Remove cgltf from tools/meshloader (now tools/objloader) to make
  non-gltfpack builds a little faster
- Fix vcachetuner Makefile build setup
2023-10-06 18:28:56 -07:00
Arseny Kapoulkine 55ad650bb4 quantization: Introduce a new file, quantization.cpp
meshopt_quantizeFloat and meshopt_quantizeHalf are moved to the new
file. These are larger (esp. float->half), not as commonly used as
unorm/snorm, don't benefit as much from inlining as it's more rare that
they are used with constant arguments in perf-sensitive context, and
also not used anywhere inside meshoptimizer itself, which means we still
get to keep the independence between different translation units (we'll
need to be careful with this in the future...).

A new file makes for a convenient place to add more quantization
utilities in the future as well.

These are used in gltfpack, which doesn't see a noticeable perf
degradation on geometry-heavy meshes that use quantizeFloat.
2023-08-24 11:42:22 -07:00
Arseny Kapoulkine ce6b8d273c Bump CMake minimum version to 3.5
This is required to avoid deprecation warnings on CMake 3.27+
2023-07-30 11:26:05 -07:00
Arseny Kapoulkine 87dc0bfa88 Update version to 0.19 2023-04-29 10:29:38 -07:00
Arseny Kapoulkine bbaa6da47a By default, don't treat warnings as errors in CMake builds
We now enable warnings as errors in CI CMake builds only using a new
MESHOPT_WERROR option; this ensures that while configurations tested in
CI are warning-free, meshoptimizer can be used on an untested compiler
version without errors.

For simplicity, Makefile builds for now keep -Werror unconditionally
since these would mostly be used during meshoptimizer development.
2022-10-03 20:59:52 -07:00
Vladimír Vondruš 8bcf3803ec Don't add -Werror on GCC, it can break compilation in certain cases.
The _mm_undefined_si128() AVX-512 intrinsics on GCC produces an
"uninitialized variable" warning (which is, well, what is it intended to
actually do), and that makes the code not compile even though there's no
actual error. I discovered this only because I use -march=native to
build system packages and recently upgraded to an AVX-512-equipped
hardware.

I assume this is just a temporary compiler wart that will eventually get
fixed, so there's no point in trying to silence that warning from
within meshoptimizer.
2022-09-17 12:34:33 +02:00
Arseny Kapoulkine d5b51f4e85 Update version to 0.18 and copyright year to 2022 2022-07-30 22:37:45 -07:00
DragonJoker 6ef41b00b8 CMake: Updated install script, added COMPONENT. 2022-06-09 16:43:57 +02:00
Arseny Kapoulkine 1f744a5733 Convert Basis path from relative to absolute in CMake 2021-12-28 14:40:10 -08:00
Arseny Kapoulkine 66a10a31af Split Basis integration into two files
This allows us to iterate much faster on basisenc.cpp.
2021-12-28 14:08:47 -08:00
Arseny Kapoulkine c388a88da7 Merge branch 'master' into gltf-basisu 2021-12-28 11:07:20 -08:00
Arseny Kapoulkine 5270fb7077 Update version to 0.17 2021-11-21 11:02:31 -08:00
Arseny Kapoulkine 75786211e0 gltfpack: Automatically enable SSE4.1 for x86_64 builds
Also fix CMake builds for Linux by adding pthread.
2021-06-06 22:32:21 -07:00
Arseny Kapoulkine 9b25831808 gltfpack: Fix CMake option type
option() only works for booleans.
2021-06-06 22:25:14 -07:00
Arseny Kapoulkine 374a20604e gltfpack: Improve basisu integration
Add CMake support, enable SSE and fix MSVC builds
2021-06-06 22:13:30 -07:00
Arseny Kapoulkine a66f365d20 gltfpack: Switch to C++11
This is going to make Basis integration easier; there's no real reason
to keep using C++98 for gltfpack. Note that meshoptimizer continues to
use C++98 and that is unlikely to change.
2021-06-06 21:22:42 -07:00
Arseny Kapoulkine 0cae2e0d32 Remove basistoktx from CMakeLists.txt 2021-06-05 20:42:06 -07:00
abma ee407b663f Update CMakeLists.txt 2021-05-17 16:24:46 -07:00
abma 059990049a fix checks in CMakeLists.txt
CMP0077 requires >= 3.13
CMP0091 + CMP0092 requires >= 3.15
2021-05-17 16:24:46 -07:00
Arseny Kapoulkine cb2072c36f Update version to 0.16 2021-04-06 22:59:24 -07:00
Arseny Kapoulkine eec4a16cf9 Replace miniz with sdefl
This change replaces the old custom version of miniz with sdefl. sdefl
has less code, doesn't require modifications and performs about as well.

New versions of sdefl are available on https://github.com/vurtun/lib
2020-12-24 08:46:46 -08:00
Arseny Kapoulkine 5685eacd74 Simplify implementation of MESHOPT_BUILD_SHARED_LIBS
Instead of overwriting builtin BUILD_SHARED_LIBS option we can simply
change the type of the meshoptimizer library, which is cleaner.
2020-12-21 14:07:08 -08:00
Arseny Kapoulkine c04da03002 Update version to 0.15 2020-10-21 19:53:32 -07:00
Arseny Kapoulkine d3e1cd2a22 tools: Remove lodviewer
gltfpack support for simplification output supersedes this; lodviewer
didn't support a lot of features a full-fledged viewer would need
anyway.
2020-05-13 20:35:06 -07:00
Vladimír Vondruš 37b24422dd Various fixes to make lodviewer compile on non-Windows systems.
* Missing include for strstr()
 * With -Wall -Wextra -Werror, unreferenced function arguments are
   treated as errors as well, made them unnamed
 * Fix linking to non-bundled GLFW (the target to link to is glfw in
   both cases, so just use that)

This still fails to link on Linux/macOS due to the GL library not being
linked.
2020-04-18 16:52:23 +02:00
Vladimír Vondruš 5578890c50 Add a dedicated CMake option for building gltfpack.
On systems that have GLFW installed the MESHOPT_BUILD_TOOLS option would
otherwise build the internal lodviewer tool as well, which might not be
desirable.
2020-04-18 16:51:56 +02:00
Vladimír Vondruš 58d430618a CMake: make shared libs work again.
BUILD_SHARED_LIBS got renamed to MESHOPT_BUILD_SHARED_LIBS, but the
unprefixed variant is what needs to be set for add_library() to work as
desired.
2020-04-18 13:30:18 +02:00
Arseny Kapoulkine daa89ad6b0 Update version to 0.14
Also add the version to js/meshopt_decoder.js since it's often
distributed separately from the rest of the library.
2020-04-17 14:42:38 -07:00
Arseny Kapoulkine db52e5b32a CMake: Enable CMP0077 in CMake 3.12+
This allows overriding MESHOPT_ options from the parent CMakeLists.txt
when that uses add_subdirectory.

Also refactor CMake version checks to use NOT LESS - GREATER_EQUAL is
only available in CMake 3.7+ but NOT LESS should work everywhere and is
more concise.
2020-03-13 08:23:25 -07:00
Arseny Kapoulkine 235e149d30 vertexfilter: Add OctS8/OctS12/QuatR12 scaffolding
These are the 3 filters we will need to implement - for now just add
scaffolding on C++/JS side for these, with no encoding/decoding code.
2020-02-16 18:12:45 -08:00
Arseny Kapoulkine 523d6844e7 gltf: Move JSON writing to json.cpp/write.cpp
json.cpp contains basic JSON helpers, write.cpp contains glTF-specific
bits.
2020-02-07 18:44:53 -08:00
Arseny Kapoulkine e530c499cc gltf: Move node-related functionality to node.cpp 2020-02-07 18:31:56 -08:00
Arseny Kapoulkine 37664fbdc7 gltf: Move image-related functionality to image.cpp
For now writeImage et al is still in gltfpack.cpp - this code probably
needs refactoring before it can be extracted.
2020-02-07 18:29:35 -08:00
Arseny Kapoulkine ed8dcf527a gltf: Move file I/O functionality to fileio.cpp
Also add forgotten comment to basistoktx.cpp
2020-02-07 18:24:49 -08:00
Arseny Kapoulkine 0d776eba94 gltf: Move stream-related functionality to stream.cpp
For now this includes both quantization bounds and actual stream
writing/compression functions.
2020-02-07 18:21:01 -08:00
Arseny Kapoulkine 5efbbc9202 gltf: Move material functionality into material.cpp
Also move usesTextureSet into material.cpp since that's where
material-specific logic actually is necessary.
2020-02-07 18:15:03 -08:00
Arseny Kapoulkine d1b6cf9d46 gltf: Move mesh processing out of gltfpack.cpp
This is a bit messier than animations since we need to move various mesh
analysis/filtering functions as well.
2020-02-07 18:11:29 -08:00
Arseny Kapoulkine 600e31b55d gltf: Move animation processing out of gltfpack.cpp 2020-02-07 18:07:53 -08:00
Arseny Kapoulkine 756052d151 gltf: Move .obj parsing out of gltfpack.cpp
Also add a stub for glTF parsing, but not moving the code yet.
2020-02-07 17:56:07 -08:00
Arseny Kapoulkine 67efa98db3 Move gltfpack sources to gltf/
This adds a folder that we can put all gltfpack-related sources to.

The name was chosen over gltfpack to avoid conflicts with gltfpack
executable name since this doesn't change the build structure for now.
2020-02-07 17:36:26 -08:00
Sergey Kosarevsky 6be913ae71 tools/lodviewer: Add lodviewer to CMakeLists.txt (#89)
* tools/lodviewer: Add `lodviewer` to CMakeLists.txt

* CMake: use find_package() and MESHOPT_BUILD_TOOLS_GLFW_FOLDER_NAME option to look for GLFW
2019-12-20 23:02:48 -08:00
Sergey Kosarevsky 7ba09804b1 CMake: added MESHOPT_ prefix for CMake options (#90) 2019-12-20 16:57:25 +03:00
Hans-Kristian Arntzen 7024acdd5f Fix build on Android (CMake < 3.7).
VERSION_GREATER_EQUAL is not available on older CMake versions.
2019-12-15 17:27:56 +01:00
Arseny Kapoulkine 9652fa260f Update version to 0.13 2019-11-27 09:36:24 +01:00