This repository was archived by the owner on Aug 21, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
rewrite reactive UVOL #8848
Merged
Merged
rewrite reactive UVOL #8848
Changes from 39 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
8accee5
rewrite reactive UVOL1
CITIZENDOT 3454e57
Merge branch 'dev' into uvol-rewrite
CITIZENDOT df8197e
Move worker to engine scope, refactor to use hooks, improve playlist …
CITIZENDOT f0ccaea
Autoplay/paused fixes
CITIZENDOT 1bfb929
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 98e14a6
wip: init UniformUVOL
CITIZENDOT daaf6c9
fetch geometry segments and textures
CITIZENDOT 8e69338
Merge branch 'dev' into uvol-rewrite
CITIZENDOT c5e8ece
unifying non-uniform and uniform component
CITIZENDOT 4252daa
Merge branch 'dev' into uvol-rewrite
CITIZENDOT c41455b
Dispose attributes on GPU, track management
CITIZENDOT 615af1f
clean up
CITIZENDOT 2001af8
Merge branch 'dev' into uvol-rewrite
CITIZENDOT c713bce
Merge branch 'dev' into uvol-rewrite
CITIZENDOT cbc1e17
Update meshopt decoder module
CITIZENDOT 33a3c90
UVOL1 readability
CITIZENDOT a3f9ec4
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 10e2a41
Loading effect for UVOL1
CITIZENDOT be057a7
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 1052746
Mirror media element paused
CITIZENDOT a1c55d8
Add explicit `autoplay` property
CITIZENDOT ce18329
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 324c5be
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 4cf57d1
Cleaned up pause/autoplay logic
CITIZENDOT 18813d9
Merge branch 'dev' into uvol-rewrite
CITIZENDOT c5de937
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 9eef15e
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 45f02e2
minor correction to buffering logic
CITIZENDOT d3532cb
Implement consistent and reliable loading effect
CITIZENDOT 1d6a1ef
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 18365de
revert AvatarDissolveComponent's changes
CITIZENDOT 7135656
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 4d15342
Autotune targets
CITIZENDOT 2d20d6d
Merge branch 'dev' into uvol-rewrite
CITIZENDOT d7ac919
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 18b17a0
disable shadows for uniform solve
CITIZENDOT 90d9b9e
improve initial loading logic
CITIZENDOT 9ed0122
Merge branch 'dev' into uvol-rewrite
CITIZENDOT e25c4e4
improve blending keyframes
CITIZENDOT 7445769
Improve setAttribute
CITIZENDOT 4dba4e9
Dont play when sufficient buffers not loaded yet
CITIZENDOT 5bbd604
Improve performance
CITIZENDOT 61106ee
Move CORTOLoader to AssetLoaderState
CITIZENDOT d96a7f4
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 6a10e36
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 55f7868
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 5641523
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 8615dcc
Update shader to r157
CITIZENDOT 055f4ca
Merge branch 'dev' into uvol-rewrite
CITIZENDOT b3df1ff
Merge branch 'dev' into uvol-rewrite
CITIZENDOT 36afec5
Merge branch 'dev' into uvol-rewrite
speigg 36efe6b
Merge branch 'uvol-rewrite' of github.com:EtherealEngine/etherealengi…
CITIZENDOT b126b6c
Merge branch 'dev' into uvol-rewrite
CITIZENDOT bd6d7af
Start UVOL2 at non-zero time
CITIZENDOT 894404f
Support different segment sizes across targets
CITIZENDOT b7e7cfd
Merge branch 'dev' into uvol-rewrite
CITIZENDOT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
|
|
||
| /* | ||
| CPAL-1.0 License | ||
|
|
||
| The contents of this file are subject to the Common Public Attribution License | ||
| Version 1.0. (the "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
| https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. | ||
| The License is based on the Mozilla Public License Version 1.1, but Sections 14 | ||
| and 15 have been added to cover use of software over a computer network and | ||
| provide for limited attribution for the Original Developer. In addition, | ||
| Exhibit A has been modified to be consistent with Exhibit B. | ||
|
|
||
| Software distributed under the License is distributed on an "AS IS" basis, | ||
| WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the | ||
| specific language governing rights and limitations under the License. | ||
|
|
||
| The Original Code is Ethereal Engine. | ||
|
|
||
| The Original Developer is the Initial Developer. The Initial Developer of the | ||
| Original Code is the Ethereal Engine team. | ||
|
|
||
| All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 | ||
| Ethereal Engine. All Rights Reserved. | ||
| */ | ||
|
|
||
|
|
||
| import { BufferGeometry, Loader, LoadingManager } from 'three' | ||
|
|
||
| export class CORTOLoader { | ||
| constructor() | ||
| setDecoderPath(path: string): CORTOLoader | ||
| load( | ||
| url: string, | ||
| byteStart: number, | ||
| byteEnd: number, | ||
| onLoad: (geometry: BufferGeometry | null) => void, | ||
| ): void | ||
| preload(): Promise<void> | ||
| dispose(): CORTOLoader | ||
| } |
130 changes: 130 additions & 0 deletions
130
packages/engine/src/assets/loaders/corto/CORTOLoader.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
|
|
||
| /* | ||
| CPAL-1.0 License | ||
|
|
||
| The contents of this file are subject to the Common Public Attribution License | ||
| Version 1.0. (the "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
| https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. | ||
| The License is based on the Mozilla Public License Version 1.1, but Sections 14 | ||
| and 15 have been added to cover use of software over a computer network and | ||
| provide for limited attribution for the Original Developer. In addition, | ||
| Exhibit A has been modified to be consistent with Exhibit B. | ||
|
|
||
| Software distributed under the License is distributed on an "AS IS" basis, | ||
| WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the | ||
| specific language governing rights and limitations under the License. | ||
|
|
||
| The Original Code is Ethereal Engine. | ||
|
|
||
| The Original Developer is the Initial Developer. The Initial Developer of the | ||
| Original Code is the Ethereal Engine team. | ||
|
|
||
| All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 | ||
| Ethereal Engine. All Rights Reserved. | ||
| */ | ||
|
|
||
|
|
||
| import { BufferAttribute, BufferGeometry, FileLoader } from 'three' | ||
|
|
||
| class CORTOLoader { | ||
| constructor() { | ||
| this.decoderPath = '' | ||
| this.decoderPending = null | ||
|
|
||
| this.worker = null | ||
| this.lastRequest = 0 | ||
| this.callbacks = {} | ||
|
|
||
| this.defaultAttributes = [ | ||
| { name: 'position', numComponents: '3' }, | ||
| { name: 'normal', numComponents: '3' }, | ||
| { name: 'color', numComponents: '4' }, | ||
| { name: 'uv', numComponents: '2' } | ||
| ] | ||
| } | ||
|
|
||
| setDecoderPath(path) { | ||
| this.decoderPath = path | ||
| return this | ||
| } | ||
|
|
||
| load(url, byteStart, byteEnd, onLoad) { | ||
| if (!this.decoderPending) { | ||
| this.preload() | ||
| } | ||
|
|
||
| this.decoderPending.then(() => { | ||
| const request = this.lastRequest++ | ||
| this.worker.postMessage({ | ||
| request: request, | ||
| url: url, | ||
| byteStart: byteStart, | ||
| byteEnd: byteEnd | ||
| }) | ||
| this.callbacks[request] = { onLoad: onLoad } | ||
| }) | ||
| } | ||
|
|
||
| preload() { | ||
| if (this.decoderPending) return this.decoderPending | ||
|
|
||
| let that = this | ||
| let callbacks = this.callbacks | ||
| let lib = 'corto.js' | ||
|
|
||
| this.decoderPending = this._loadLibrary(lib, 'text').then((text) => { | ||
| text = URL.createObjectURL(new Blob([text])) | ||
| this.worker = new Worker(text) | ||
|
|
||
| this.worker.onmessage = function (e) { | ||
| var message = e.data | ||
| if (!callbacks[message.request]) return | ||
|
|
||
| const callback = callbacks[message.request] | ||
| const geometry = that._createGeometry(message.geometry) | ||
| callback.onLoad(geometry) | ||
| delete callbacks[message.request] | ||
| } | ||
| }) | ||
|
|
||
| return this.decoderPending | ||
| } | ||
|
|
||
| dispose() { | ||
| if (this.worker) { | ||
| this.worker.terminate() | ||
| this.worker = null | ||
| } | ||
| return this | ||
| } | ||
|
|
||
| _createGeometry(geometry) { | ||
| if (!geometry) { | ||
| return null | ||
| } | ||
| var bufferGeometry = new BufferGeometry() | ||
|
|
||
| if (geometry.index) bufferGeometry.setIndex(new BufferAttribute(geometry.index, 1)) | ||
|
|
||
| for (let i = 0; i < this.defaultAttributes.length; i++) { | ||
| let attr = this.defaultAttributes[i] | ||
| if (!geometry[attr.name]) continue | ||
| let buffer = geometry[attr.name] | ||
| bufferGeometry.setAttribute(attr.name, new BufferAttribute(buffer, attr.numComponents)) | ||
| } | ||
| return bufferGeometry | ||
| } | ||
|
|
||
| _loadLibrary(url, responseType) { | ||
| var loader = new FileLoader(this.manager) | ||
| loader.setPath(this.decoderPath) | ||
| loader.setResponseType(responseType) | ||
|
|
||
| return new Promise((resolve, reject) => { | ||
| loader.load(url, resolve, undefined, reject) | ||
| }) | ||
| } | ||
| } | ||
|
|
||
| export { CORTOLoader } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
330 changes: 205 additions & 125 deletions
330
packages/engine/src/assets/loaders/gltf/meshopt_decoder.module.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.