2781 Commits

Author SHA1 Message Date
openharmony_ci c6db1d5a23 !5 merge master into master
修改bundle.json文件 Signed-off-by: wangshilin <wangshilin20@h-partners.com>

Created-by: weixin_44878761
Commit-by: wangshilin
Merged-by: openharmony_ci
Description: ### 一、内容说明(相关的Issue)



### 二、建议测试周期和提测地址  
  建议测试完成时间:xxxx.xx.xx  
  投产上线时间:xxxx.xx.xx  
  提测地址:CI环境/压测环境  
  测试账号:  

### 三、变更内容
  * 3.1 关联PR列表

  * 3.2 数据库和部署说明  
    1. 常规更新 
    2. 重启unicorn
    3. 重启sidekiq
    4. 迁移任务:是否有迁移任务,没有写 "无"
    5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无"

  * 3.4 其他技术优化内容(做了什么,变更了什么)
    - 重构了 xxxx 代码
    - xxxx 算法优化


  * 3.5 废弃通知(什么字段、方法弃用?)



  * 3.6  后向不兼容变更(是否有无法向后兼容的变更?)


  
### 四、研发自测点(自测哪些?冒烟用例全部自测?)
  自测测试结论:


### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方)
  检查点:

| 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 |
|------|------------|----------|---------------|
| xxx  | 否          | 需要       | 不需要           |
|      |            |          |               |

  接口测试:

  性能测试:

  并发测试:

  其他:



See merge request: openharmony/third_party_meshoptimizer!5
OpenHarmony-v6.1-Release OpenHarmony-v7.0-Beta1 OpenHarmony-v6.1-LTS OpenHarmony-v7.0-Release
2025-10-29 10:37:01 +08:00
wangshilin 268083b2e1 修改bundle.json文件 Signed-off-by: wangshilin <wangshilin20@h-partners.com> 2025-10-28 19:38:02 +08:00
wangshilin 196600ca05 删除patches Signed-off-by: wangshilin <wangshilin20@h-partners.com> 2025-10-25 18:54:51 +08:00
wangshilin 506aa74d2b 修改build.gn Signed-off-by: wangshilin <wangshilin20@h-partners.com> 2025-10-13 17:31:13 +08:00
wangshilin d5849b7875 修改patches.json Signed-off-by: wangshilin <wangshilin20@h-partners.com> 2025-10-10 19:39:13 +08:00
wangshilin 977fe4bab9 孵化仓联合构建 Signed-off-by: wangshilin <wangshilin20@h-partners.com> 2025-10-10 17:44:56 +08:00
wangshilin 6d1fc7ad43 修改bundle.json Signed-off-by: wangshilin <wangshilin20@h-partners.com> 2025-10-10 11:16:08 +08:00
openharmony_ci 834779123f merge master into master
修改 readme Signed-off-by: wangshilin <wangshilin20@h-partners.com>

Created-by: weixin_44878761
Commit-by: wangshilin
Merged-by: openharmony_ci
Description: ### 一、内容说明(相关的Issue)



### 二、建议测试周期和提测地址  
  建议测试完成时间:xxxx.xx.xx  
  投产上线时间:xxxx.xx.xx  
  提测地址:CI环境/压测环境  
  测试账号:  

### 三、变更内容
  * 3.1 关联PR列表

  * 3.2 数据库和部署说明  
    1. 常规更新 
    2. 重启unicorn
    3. 重启sidekiq
    4. 迁移任务:是否有迁移任务,没有写 "无"
    5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无"

  * 3.4 其他技术优化内容(做了什么,变更了什么)
    - 重构了 xxxx 代码
    - xxxx 算法优化


  * 3.5 废弃通知(什么字段、方法弃用?)



  * 3.6  后向不兼容变更(是否有无法向后兼容的变更?)


  
### 四、研发自测点(自测哪些?冒烟用例全部自测?)
  自测测试结论:


### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方)
  检查点:

| 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 |
|------|------------|----------|---------------|
| xxx  | 否          | 需要       | 不需要           |
|      |            |          |               |

  接口测试:

  性能测试:

  并发测试:

  其他:


See merge request: openharmony-sig/third_party_meshoptimizer!2
2025-09-29 11:11:04 +08:00
wangshilin f124276d72 修改 readme Signed-off-by: wangshilin <wangshilin20@h-partners.com> 2025-09-29 10:36:17 +08:00
wangshilin 72bcfdffb3 修改README.OpenSource名称 Signed-off-by: wangshilin <wangshilin20@h-partners.com> 2025-09-29 10:26:49 +08:00
openharmony_ci 6340fbc4ff merge master into master
增加相关文档,测试用例。Signed-off-by: wangshilin <wangshilin20@h-partners.com>

Created-by: weixin_44878761
Commit-by: wangshilin
Merged-by: openharmony_ci
Description: ### 一、内容说明(相关的Issue)



### 二、建议测试周期和提测地址  
  建议测试完成时间:xxxx.xx.xx  
  投产上线时间:xxxx.xx.xx  
  提测地址:CI环境/压测环境  
  测试账号:  

### 三、变更内容
  * 3.1 关联PR列表

  * 3.2 数据库和部署说明  
    1. 常规更新 
    2. 重启unicorn
    3. 重启sidekiq
    4. 迁移任务:是否有迁移任务,没有写 "无"
    5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无"

  * 3.4 其他技术优化内容(做了什么,变更了什么)
    - 重构了 xxxx 代码
    - xxxx 算法优化


  * 3.5 废弃通知(什么字段、方法弃用?)



  * 3.6  后向不兼容变更(是否有无法向后兼容的变更?)


  
### 四、研发自测点(自测哪些?冒烟用例全部自测?)
  自测测试结论:


### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方)
  检查点:

| 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 |
|------|------------|----------|---------------|
| xxx  | 否          | 需要       | 不需要           |
|      |            |          |               |

  接口测试:

  性能测试:

  并发测试:

  其他:


See merge request: openharmony-sig/third_party_meshoptimizer!1
2025-09-28 16:35:03 +08:00
wangshilin 0c14133ec6 增加ROM Signed-off-by: wangshilin <wangshilin20@h-partners.com> 2025-09-28 15:21:29 +08:00
wangshilin 95ada4cafa 修改OAT.xml Signed-off-by: wangshilin <wangshilin20@h-partners.com> 2025-09-24 14:24:36 +08:00
wangshilin 3635ceb024 增加bundel.json, 删除测试用例。Signed-off-by: wangshilin <wangshilin20@h-partners.com> 2025-09-24 11:53:05 +08:00
wangshilin 56826cdef9 OAT.xml修改 README.md修改 Signed-off-by: wangshilin <wangshilin20@h-partners.com> 2025-09-22 20:44:30 +08:00
wangshilin eee33d2ffe 修改整体协议为MIT,删除OAT.xml中多余的注释,增减src目录下的过滤条件,readme.opensource.md中owner的修改,源代码的测试文件tests.cpp 放到了testcase目录下。Readme文档修改,去掉和字,把图兴学换成了具体解释,解释gltf全称,提供OH上的使用方法.Signed-off-by: wangshilin <wangshilin20@h-partners.com> 2025-09-22 18:57:58 +08:00
wangshilin c7e2cf7da9 增加相关文档,测试用例。Signed-off-by: wangshilin <wangshilin20@h-partners.com> 2025-09-18 20:24:47 +08:00
Arseny Kapoulkine 4affad0445 Merge pull request #795 from zeux/nextver
Release 0.22
2025-09-18_11_14_06/gitcode.com/prod-sig/third_party_meshoptimizer/v0.22
2024-10-24 16:53:43 -07:00
Arseny Kapoulkine f29c5e87e3 Update README.md
Fix duplicate documentation for generateShadowIndexBuffer after a failed
rewording attempt.
2024-10-24 16:32:45 -07:00
Arseny Kapoulkine 57ccdb834e Merge pull request #796 from zeux/js-lockfix
js: Fix vertex_lock support for simplifyWithAttributes
2024-10-24 08:12:31 -07:00
Arseny Kapoulkine e22776ccd4 js: Fix vertex_lock support for simplifyWithAttributes
This code never worked if an actual array was passed in as it required
an element per float instead of an element per vertex.

Since we need to change this anyway, change the interface to accept
Uint8Array instead of a boolean array. This is more consistent with
other parameters and allows an upgrade path if the C interface changes
from "lock flags" to just "flags".
2024-10-23 22:31:38 -07:00
Arseny Kapoulkine 42998fd502 Update version to 0.22 everywhere 2024-10-23 16:36:37 -07:00
Arseny Kapoulkine c297d0898a Mark meshopt_decodeFilter* and meshopt_encodeFilter* as stable
These functions have existed for several years now, with stable
implementation and interface. They are exposed via JS interface and used
by gltfpack, and thus are unlikely to change dramatically.

A recent change added meshopt_EncodeExpClamped, which also had a
possible alternative of adding more fine-grained exponent clamping
control to meshopt_encodeFilterExp. Instead of marking the entire
function as experimental, let's mark just the enum entry as
experimental. If more control is necessary in the future, we can remove
this enum entry and add a meshopt_encodeFilterExpClamped instead.
2024-10-23 16:36:37 -07:00
Arseny Kapoulkine 41f9483efd Merge pull request #794 from zeux/clusterz
clusterizer: Refactor and improve triangle prioritization
2024-10-23 13:09:25 -07:00
Arseny Kapoulkine 39660d363d js: Update Wasm binaries for clusterizer
Incorporates tweaks to priority heuristics
2024-10-23 09:31:58 -07:00
Arseny Kapoulkine 2c7e4feadd clusterizer: Prioritize triangles with valence 2 edges less
Our initial heuristic adjustment is a little too aggressive wrt global
flow: it is very happy to leave the last vertex of a meshlet unused
(when a triangle with extra=2 and a valence-2 edge exists it will always
be selected over a triangle with extra=1), and that increases the
not-full meshlet count more than optimal.

Using 1+extra instead fixes this by using priority 3 for these triangles
so that they can be weighted against extra=1 triangles. This is a
compromise, as fully separating the priorities results in worse global
outcome.
2024-10-22 15:56:57 -07:00
Arseny Kapoulkine 234daba517 clusterizer: Prioritize triangles with valence 2 edges
When a triangle has two vertices with valence 2, it's typically
advantageous to prioritize it above others even if that may require an
extra vertex; after removing this triangle, we'll have between one and
two isolated triangles with valence=1 vertex which we'll pick up
immediately.

Avoiding this triangle risks leaving the small triangle cluster alone
and going in a different direction only to collect it later.

This significantly reduces the number of disconnected clusters due to a
better global flow; note that it's important to check for the edge, not
just a single valence=2 vertex, as that results in a worse local
decision that doesn't sufficiently improve global traversal.
2024-10-22 08:12:15 -07:00
Arseny Kapoulkine 0dc038de11 clusterizer: Rename extra to priority
To avoid future confusion, we now use extra only to mean "extra vertex
count" and the adjustments are done to priority.
2024-10-22 08:21:59 -07:00
Arseny Kapoulkine b04ac5a752 demo: Adjust "not full" calculation for uniform meshlets
This might be a little misleading in the future, but uniform meshlets
can almost never reach full vertex utilization as the triangle count
should be reached first on regular meshes. So for now it would be more
useful to count meshlets that don't exhaust the triangle limit even
though this makes the metric differ between two types.
2024-10-21 19:26:26 -07:00
Arseny Kapoulkine f73bc02f00 clusterizer: Fix rescoring to only affect new meshlets
When getNeighborTriangle's best selection can't fit into the current
meshlet, we redo the search process using an adjusted criteria that
ignores position/normal as that is irrelevant. However, internally
getNeighborTriangle adjusted best_extra to act as a topology score
instead of just the extra count. This would lead to the last triangle of
the meshlet being reselected in addition to the first one in some cases.

Also change _extra variables to int as these are small.

Note: by itself, this change actually slightly reduces the
clusterization quality due to non-local effects of the rescoring.
2024-10-21 19:18:03 -07:00
Arseny Kapoulkine eae4996507 demo: Refactor meshlets() output for conciseness
It's difficult to work with meshlet demo right now due to the amount of
output; when multiple meshes are specified and multiple algorithms are
tested it becomes distracting.

Additionally, we only test 64/126 configuration right now, which is a
different mode from 64/64: 64/126 almost always terminates meshlets by
running out of vertices, whereas 64/64 almost always runs out of
triangles first. This means some algoritmic changes need to ideally be
tested for both.

Since 8-bit cutoff as well as the alternative culling formula have been
extensively tested, we no longer compute those and consolidate the cone
culling stats into the Bounds row.
2024-10-21 12:47:24 -07:00
Arseny Kapoulkine b0cc223e1a demo: Add average strip length to demo output
This is a similar efficiency measure to strip index count and can be
used to compare the results to other published algorithms. For
simplicity, we only measure the strip length when restart indices are
used; the results should not depend on whether that's the case (compared
to strip index percentage which does).
2024-10-18 11:49:19 -07:00
Arseny Kapoulkine 7bb503fdee js: Update README.md
Document ErrorAbsolute and Sparse options for simplification. Sparse is
probably less useful in JS as the cost of copying the vertex data is
paid in full but would still be useful to reduce memory consumption and
improve performance; Prune is only available as an experimental option
and we currently don't document those.
2024-10-18 08:53:16 -07:00
Arseny Kapoulkine 212e9af49d Merge pull request #791 from zeux/gltf-fref
gltfpack: Refactor stream encoding using meshopt_encodeFilter
2024-10-18 08:52:51 -07:00
Arseny Kapoulkine 14dad04e71 Update README.md
Document clamped exponent mode in main documentation and lightly
document the `mode` parameter for JS.
2024-10-17 15:03:37 -07:00
Arseny Kapoulkine 3399d153c1 gltfpack: Use SharedComponent encoding for normal deltas
We previously used Clamped in -c mode for normal deltas; but normal
deltas may be fairly small. Normally preserving these requires more bits
but if the user already opted into floating point normals it would be
more reasonable to use SharedComponent to dynamically adjust to the
delta range. This also fixes the odd corner case where the deltas may be
erased at -c but kept at -cc.
2024-10-18 08:17:12 -07:00
Arseny Kapoulkine 53dbbf4f08 js: Update meshopt_encoder.js to incorporate clamped exponents
This just rebuilds the JS code with an extra constant exposed, and adds
a test to make sure it works.
2024-10-17 14:59:21 -07:00
Arseny Kapoulkine b6a3e46dcb vertexfilter: Equalize encodeExp behavior for positive and negative zero
When we switched from frexp to optlog2, the behavior for negative zero
changed: instead of being encoded as if it had exponent 0, it was
mistakenly encoded as if it had exponent min_exp.

Both encodings are equivalent; in fact, there is some leeway in encoding
zeroes that we are not exploiting as they could repeat the last non-zero
exponent - but this is an unexpected change and should be corrected for
consistency.
2024-10-17 17:02:15 -07:00
Arseny Kapoulkine 3dee1a8d2d gltfpack: Switch from custom encodeExp* functions to meshopt_encodeFilterExp
Unlike previous changes, this is not *exactly* equivalent in terms of
binary output. It should be the same when using `-c`, but when using
`-cc` there may be cases where the shared component encoding selects an
exponent that is smaller than 0 for normals or texture coordinates. This
should not negatively affect compression ratio though, just produce
slightly different files.
2024-10-17 15:12:04 -07:00
Arseny Kapoulkine d00f7d52cb vertexfilter: Add meshopt_EncodeExpClamped mode for exponent encoding
When using SharedComponent or SharedVector, exponents compress fairly
well on their own because their range is normalized in a more or less
optimal way; when using Separate mode, the reduced bit count truncates
mantissa which fixes some issues with input entropy, but if the values
are clustered around zero then the exponent will also see a lot of
variance that is generally unwarranted for precision, when the input
range is known to be further away from zero.

While there are ways to solve this in a more general fashion, eg by
exposing min_exp as well as mode, this is probably too involved and it's
simple and mostly sufficient to add a clamped mode.

This is helpful when encoding values like texture coordinates, where
SharedVector or SharedComponent may not have enough precision in case
where a component is tiled with a high repeat value, but we know we need
a limited precision around 0 so clamping the exponent works well.

This API is still experimental so it's easy to rework it later if we
discover a more general solution is warranted.
2024-10-17 14:54:09 -07:00
Arseny Kapoulkine 80c80f8d8f gltfpack: Extract snorm encoding into a separate function
meshopt doesn't provide an encode function for snorm encoding as it's a
trivial extension of scalar encoding, but here we need this in a few
places so our own function simplifies the data flow.
2024-10-17 11:19:11 -07:00
Arseny Kapoulkine bb02b2f54b demo: Add tests for encodeFilterExp with aliased source & destination
This is a useful mode of operation since exp encoding shares source &
destination stride, but it's valuable to make sure it works as
implementation changes may accidentally break it if they read data after
writing destination.
2024-10-17 11:00:50 -07:00
Arseny Kapoulkine c05ada1845 gltfpack: Switch from manual encodeExpShared to meshopt_encodeFilterExp
This simplifies the code and keeps the output identical since the
encoding logic is the same.

Note that since the stride here is 12 bytes, we can't encode directly
from the source attribute data (we need to skip W), but we can encode
using aliased destination & source.
2024-10-17 10:57:53 -07:00
Arseny Kapoulkine 6cf44db53a gltfpack: Switch from manual encodeQuat to meshopt_encodeFilterQuat
This simplifies the code and keeps the output binary identical since the
encoding logic is the same.
2024-10-17 10:57:17 -07:00
Arseny Kapoulkine 2afc22c3c7 gltfpack: Switch from manual encodeOct to meshopt_encodeFilterOct
This streamlines the code and preserves the output exactly as
meshopt_encodeFilterOct does the same transformations.
2024-10-17 10:35:01 -07:00
Arseny Kapoulkine 13317f4fdb Expand gltfpack coverage further
Add coverage for floating point stream encoding, keep_nodes and mtllib
parsing (as well as error image handling as the jpeg doesn't exist)
2024-10-17 07:55:13 -07:00
Arseny Kapoulkine 8c866849a6 Merge pull request #790 from zeux/gltf-ddperf
gltfpack: Accelerate deduplication pass for scenes with a lot of primitives
2024-10-16 13:24:29 -07:00
Arseny Kapoulkine 7a88aff0ca gltfpack: Work around clang-tidy report
clang-tidy complains that we're dividing an integer by 3 before a float
cast; this is correct as the division is exact, and a cast silences it.
2024-10-16 08:44:48 -07:00
Arseny Kapoulkine 288bd2e86e gltfpack: Filter duplicate nodes after merging node lists
This almost never comes up in practice, but occasionally scenes might
have the same geometry attached to the same nodes. This results in
counterintuitive results because we create node lists with duplicate
nodes for this, which never happened before, and end up producing more
quantization sub-nodes than necessary.

For now we can just filter these attachments out to avoid redundancy.
2024-10-16 08:43:25 -07:00
Arseny Kapoulkine 98c9b1abac gltfpack: Switch primitive cache to std::unordered_map
Neither std::map nor std::unordered_map are particularly good
containers, but since we're now using unordered_map for deduplication
filtering we might as well use it for the primitive cache. This requires
a custom hash function for pair<uint64, uint64>, but our hash halves are
sufficiently decorellated that a xor suffices.
2024-10-16 08:42:09 -07:00