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

Support glTF progress #1835

Merged
merged 23 commits into from
Nov 22, 2023
Merged

Conversation

zhuxudong
Copy link
Member

Please check if the PR fulfills these requirements

support #1651

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Other information:

@zhuxudong zhuxudong added the enhancement New feature or request label Oct 24, 2023
@zhuxudong zhuxudong added this to the 1.2 milestone Oct 24, 2023
@zhuxudong zhuxudong self-assigned this Oct 24, 2023
@zhuxudong zhuxudong changed the base branch from main to dev/1.2 October 24, 2023 10:44
@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Attention: 38 lines in your changes are missing coverage. Please review.

Comparison is base (8484abb) 66.92% compared to head (d1d5d7b) 66.93%.

❗ Current head d1d5d7b differs from pull request most recent head 198b6f7. Consider uploading reports for the commit 198b6f7 to get more accurate results

Files Patch % Lines
packages/core/src/asset/request.ts 22.72% 14 Missing and 3 partials ⚠️
packages/loader/src/ktx2/KTX2Loader.ts 0.00% 5 Missing ⚠️
...ackages/loader/src/gltf/parser/GLTFBufferParser.ts 0.00% 4 Missing ⚠️
...er/src/gltf/extensions/GALACEAN_materials_remap.ts 0.00% 3 Missing ⚠️
...s/loader/src/gltf/extensions/KHR_texture_basisu.ts 0.00% 3 Missing ⚠️
packages/loader/src/Texture2DLoader.ts 0.00% 2 Missing ⚠️
...ckages/loader/src/gltf/parser/GLTFTextureParser.ts 0.00% 2 Missing ⚠️
packages/core/src/asset/ResourceManager.ts 0.00% 1 Missing ⚠️
...ackages/loader/src/gltf/parser/GLTFSchemaParser.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           dev/1.2    #1835      +/-   ##
===========================================
+ Coverage    66.92%   66.93%   +0.01%     
===========================================
  Files          471      471              
  Lines        23834    23860      +26     
  Branches      3399     3403       +4     
===========================================
+ Hits         15950    15971      +21     
- Misses        6694     6696       +2     
- Partials      1190     1193       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

* dev/1.2: (31 commits)
  Add sunSource (galacean#1823)
  Fix(ShaderLab): make `UsePass` directive compatible with all builtin shader names (galacean#1855)
  feat: ParticleGenerator support simulationSpeed (galacean#1854)
  fix: sprite destroy (galacean#1852)
  "v1.1.0-beta.18"
  Fix quaternion to euler bug (galacean#1851)
  Fix ColorOverLifetimeModule mode invalid bug (galacean#1850)
  fix: no autoplay when set animatorController after enable (galacean#1843)
  Refactor `glTFResource` (galacean#1831)
  Fix material destoroy bug (galacean#1847)
  Fix Sprite can't batch bug caused by material instance (galacean#1830)
  "v1.1.0-beta.17"
  fix: glTF animation parse bug (galacean#1845)
  fix: mesh decoder (galacean#1844)
  "v1.1.0-beta.16"
  Fix blendShape crossFade bug (galacean#1841)
  fix: ignore ambient in 2d template (galacean#1836)
  "v1.1.0-beta.15"
  Fix blendShapeAnimation crossFade bug (galacean#1840)
  fix: ignore case of asset url (galacean#1809)
  ...

# Conflicts:
#	packages/loader/src/gltf/parser/GLTFParserContext.ts
Copy link
Member

@GuoLei1990 GuoLei1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example crash

@GuoLei1990
Copy link
Member

GuoLei1990 commented Nov 8, 2023

First,You can ignore synchronized things, such as entity
Also you didn’t consider schema(You should never miss any HTTP request)

@GuoLei1990
Copy link
Member

glTF: progress = (json[D]+buffer[D]+texture[D+L]+animation[L]+skin[L]+scene[L])/ totalCount
glb: progress = (buffer[D]+texture[L]+animation[L]+skin[L]+scene[L])/ totalCount

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@@ -71,29 +74,44 @@ export class AssetPromise<T> implements PromiseLike<T> {
if (this._state === PromiseState.Pending) {
resolve(value);
this._state = PromiseState.Fulfilled;
this._onProgressCallback = undefined;
this._onProgressItemsCallback = undefined;
this._onProgressDetailsCallback = undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To prevent memory leaks?

packages/core/src/asset/AssetPromise.ts Outdated Show resolved Hide resolved
@GuoLei1990 GuoLei1990 merged commit ff73e6d into galacean:dev/1.2 Nov 22, 2023
5 checks passed
@GuoLei1990 GuoLei1990 linked an issue Nov 22, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request glTF
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

glTF loader return more detailed progress
3 participants