@ignifx/core 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/decoders/babylon.ktx2Decoder.js +1 -0
- package/decoders/babylonjs-ktx2decoder.LICENSE.md +71 -0
- package/decoders/meshopt_decoder.js +199 -0
- package/decoders/meshoptimizer.LICENSE.md +21 -0
- package/decoders/msc_basis_transcoder.js +22 -0
- package/decoders/msc_basis_transcoder.wasm +0 -0
- package/decoders/scoped-babylonjs-ktx2decoder.LICENSE.md +396 -0
- package/decoders/scoped-babylonjs-ktx2decoder.NOTICE.md +15 -0
- package/decoders/uastc_astc.wasm +0 -0
- package/decoders/uastc_bc7.wasm +0 -0
- package/decoders/uastc_r8_unorm.wasm +0 -0
- package/decoders/uastc_rg8_unorm.wasm +0 -0
- package/decoders/uastc_rgba8_srgb_v2.wasm +0 -0
- package/decoders/uastc_rgba8_unorm_v2.wasm +0 -0
- package/decoders/vendored.json +96 -0
- package/decoders/zstddec.wasm +0 -0
- package/dist/decoders-CHJ7vduE.js +82 -0
- package/dist/decoders-CHJ7vduE.js.map +1 -0
- package/dist/{environment-BCjfp1jB.js → environment-C9AjYJgV.js} +2 -2
- package/dist/{environment-BCjfp1jB.js.map → environment-C9AjYJgV.js.map} +1 -1
- package/dist/{ignifx-error-RpK-lWwE.js → ignifx-error-Dq2qJMkZ.js} +10 -3
- package/dist/ignifx-error-Dq2qJMkZ.js.map +1 -0
- package/dist/index.d.ts +191 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +665 -86
- package/dist/index.js.map +1 -1
- package/dist/json-CzZZ6K4x.js +24 -0
- package/dist/json-CzZZ6K4x.js.map +1 -0
- package/dist/{material-plugin-CWtV7DkH.js → material-plugin-BOCB7Stt.js} +2 -2
- package/dist/{material-plugin-CWtV7DkH.js.map → material-plugin-BOCB7Stt.js.map} +1 -1
- package/dist/{post-effect-C42XJFmo.js → post-effect-BHl7U56q.js} +5 -4
- package/dist/post-effect-BHl7U56q.js.map +1 -0
- package/dist/{post-effect-compiler-pOvXae-i.js → post-effect-compiler-Dw6zW2cG.js} +3 -3
- package/dist/{post-effect-compiler-pOvXae-i.js.map → post-effect-compiler-Dw6zW2cG.js.map} +1 -1
- package/dist/{shader-material-B6wwFCKB.js → shader-material-BxQn9FT4.js} +2 -2
- package/dist/{shader-material-B6wwFCKB.js.map → shader-material-BxQn9FT4.js.map} +1 -1
- package/dist/{shader-material-C4VjLTfV.js → shader-material-DRZmqA_S.js} +10 -6
- package/dist/shader-material-DRZmqA_S.js.map +1 -0
- package/dist/{shader-pragma-qO9_6sTd.js → shader-pragma-DrFm5f5m.js} +2 -2
- package/dist/{shader-pragma-qO9_6sTd.js.map → shader-pragma-DrFm5f5m.js.map} +1 -1
- package/dist/{surface-shader-BaR7Kg-F.js → surface-shader-BgZchRBe.js} +4 -4
- package/dist/{surface-shader-BaR7Kg-F.js.map → surface-shader-BgZchRBe.js.map} +1 -1
- package/package.json +20 -2
- package/LICENSE +0 -201
- package/dist/ignifx-error-RpK-lWwE.js.map +0 -1
- package/dist/post-effect-C42XJFmo.js.map +0 -1
- package/dist/shader-material-C4VjLTfV.js.map +0 -1
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
# Apache License 2.0 (Apache)
|
|
2
|
+
|
|
3
|
+
Apache License
|
|
4
|
+
Version 2.0, January 2004
|
|
5
|
+
<http://www.apache.org/licenses/>
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
## Definitions
|
|
10
|
+
|
|
11
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
16
|
+
|
|
17
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
18
|
+
|
|
19
|
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
20
|
+
|
|
21
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
22
|
+
|
|
23
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
24
|
+
|
|
25
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
26
|
+
|
|
27
|
+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
28
|
+
|
|
29
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
30
|
+
|
|
31
|
+
## Grant of Copyright License
|
|
32
|
+
|
|
33
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
34
|
+
|
|
35
|
+
## Grant of Patent License
|
|
36
|
+
|
|
37
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
38
|
+
|
|
39
|
+
## Redistribution
|
|
40
|
+
|
|
41
|
+
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
42
|
+
|
|
43
|
+
1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
44
|
+
|
|
45
|
+
2. You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
46
|
+
|
|
47
|
+
3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
|
48
|
+
|
|
49
|
+
4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
|
50
|
+
|
|
51
|
+
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
52
|
+
|
|
53
|
+
## Submission of Contributions
|
|
54
|
+
|
|
55
|
+
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
56
|
+
|
|
57
|
+
## Trademarks
|
|
58
|
+
|
|
59
|
+
This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
60
|
+
|
|
61
|
+
## Disclaimer of Warranty
|
|
62
|
+
|
|
63
|
+
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
64
|
+
|
|
65
|
+
## Limitation of Liability
|
|
66
|
+
|
|
67
|
+
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
68
|
+
|
|
69
|
+
## Accepting Warranty or Additional Liability
|
|
70
|
+
|
|
71
|
+
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
72
|
+
|
|
73
|
+
=============
|
|
74
|
+
|
|
75
|
+
This package contains compiled binaries created by The Khronos Group (https://github.com/KhronosGroup/KTX-Software/), licensed under the apache 2.0 license.
|
|
76
|
+
|
|
77
|
+
The compiled binaries are using the following licenses:
|
|
78
|
+
|
|
79
|
+
### Copyright: 2020-2021 Arm Limited
|
|
80
|
+
|
|
81
|
+
License: Apache-2.0
|
|
82
|
+
|
|
83
|
+
### Copyright: 2021 Mark Callow
|
|
84
|
+
|
|
85
|
+
License: Apache-2.0
|
|
86
|
+
|
|
87
|
+
### Copyright: 2017 Sean Barrett
|
|
88
|
+
|
|
89
|
+
License: MIT
|
|
90
|
+
|
|
91
|
+
MIT License Copyright (c) 2017 Sean Barrett
|
|
92
|
+
|
|
93
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
94
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
95
|
+
in the Software without restriction, including without limitation the rights
|
|
96
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
97
|
+
copies of the Software, and to permit persons to whom the Software is furnished
|
|
98
|
+
to do so, subject to the following conditions:
|
|
99
|
+
|
|
100
|
+
The above copyright notice and this permission notice (including the next
|
|
101
|
+
paragraph) shall be included in all copies or substantial portions of the
|
|
102
|
+
Software.
|
|
103
|
+
|
|
104
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
105
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
106
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
|
107
|
+
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
108
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
|
109
|
+
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
110
|
+
|
|
111
|
+
### Copyright: 2014-2019 Syoyo Fujita and many contributors
|
|
112
|
+
|
|
113
|
+
License: BSD-3-Clause
|
|
114
|
+
|
|
115
|
+
Copyright (c) 2014-2019 Syoyo Fujita and many contributors. All rights reserved.
|
|
116
|
+
|
|
117
|
+
Redistribution and use in source and binary forms, with or without
|
|
118
|
+
modification, are permitted provided that the following conditions are met:
|
|
119
|
+
|
|
120
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
121
|
+
this list of conditions and the following disclaimer.
|
|
122
|
+
|
|
123
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
124
|
+
this list of conditions and the following disclaimer in the documentation
|
|
125
|
+
and/or other materials provided with the distribution.
|
|
126
|
+
|
|
127
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
128
|
+
contributors may be used to endorse or promote products derived from this
|
|
129
|
+
software without specific prior written permission.
|
|
130
|
+
|
|
131
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
132
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
133
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
134
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
135
|
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
136
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
137
|
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
138
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
139
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
140
|
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
141
|
+
POSSIBILITY OF SUCH DAMAGE.
|
|
142
|
+
|
|
143
|
+
### Copyright: 2022 The Wuffs Authors.
|
|
144
|
+
|
|
145
|
+
License: Apache-2.0
|
|
146
|
+
|
|
147
|
+
### Copyright: 2019-2020 Binomial LLC
|
|
148
|
+
|
|
149
|
+
License: Apache-2.0
|
|
150
|
+
|
|
151
|
+
### Copyright: 2019 Anton Gerdelan
|
|
152
|
+
|
|
153
|
+
License: Apache-2.0
|
|
154
|
+
|
|
155
|
+
### Copyright: 2016 The Android Open Source Project
|
|
156
|
+
|
|
157
|
+
License: Apache-2.0
|
|
158
|
+
|
|
159
|
+
### Copyright: 2015-2020 The Khronos Group Inc.
|
|
160
|
+
|
|
161
|
+
License: Apache-2.0
|
|
162
|
+
|
|
163
|
+
### Copyright: 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
|
164
|
+
|
|
165
|
+
License: Zlib
|
|
166
|
+
|
|
167
|
+
Copyright (c) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
|
168
|
+
|
|
169
|
+
This software is provided 'as-is', without any express or implied
|
|
170
|
+
warranty. In no event will the authors be held liable for any damages
|
|
171
|
+
arising from the use of this software.
|
|
172
|
+
|
|
173
|
+
Permission is granted to anyone to use this software for any purpose,
|
|
174
|
+
including commercial applications, and to alter it and redistribute it
|
|
175
|
+
freely, subject to the following restrictions:
|
|
176
|
+
|
|
177
|
+
1. The origin of this software must not be misrepresented; you must not
|
|
178
|
+
claim that you wrote the original software. If you use this software
|
|
179
|
+
in a product, an acknowledgment in the product documentation would be
|
|
180
|
+
appreciated but is not required.
|
|
181
|
+
|
|
182
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
|
183
|
+
misrepresented as being the original software.
|
|
184
|
+
|
|
185
|
+
3. This notice may not be removed or altered from any source
|
|
186
|
+
distribution.
|
|
187
|
+
|
|
188
|
+
### Copyright: 2016-present Facebook, Inc.
|
|
189
|
+
|
|
190
|
+
License: BSD-3-Clause
|
|
191
|
+
|
|
192
|
+
Copyright (c) 2016-present Facebook, Inc.
|
|
193
|
+
|
|
194
|
+
Redistribution and use in source and binary forms, with or without
|
|
195
|
+
modification, are permitted provided that the following conditions are met:
|
|
196
|
+
|
|
197
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
198
|
+
this list of conditions and the following disclaimer.
|
|
199
|
+
|
|
200
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
201
|
+
this list of conditions and the following disclaimer in the documentation
|
|
202
|
+
and/or other materials provided with the distribution.
|
|
203
|
+
|
|
204
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
205
|
+
contributors may be used to endorse or promote products derived from this
|
|
206
|
+
software without specific prior written permission.
|
|
207
|
+
|
|
208
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
209
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
210
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
211
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
212
|
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
213
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
214
|
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
215
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
216
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
217
|
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
218
|
+
POSSIBILITY OF SUCH DAMAGE.
|
|
219
|
+
|
|
220
|
+
### Copyright: 1995-2017 Jean-loup Gailly and Mark Adler
|
|
221
|
+
|
|
222
|
+
License: Zlib
|
|
223
|
+
|
|
224
|
+
Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler
|
|
225
|
+
|
|
226
|
+
This software is provided 'as-is', without any express or implied
|
|
227
|
+
warranty. In no event will the authors be held liable for any damages
|
|
228
|
+
arising from the use of this software.
|
|
229
|
+
|
|
230
|
+
Permission is granted to anyone to use this software for any purpose,
|
|
231
|
+
including commercial applications, and to alter it and redistribute it
|
|
232
|
+
freely, subject to the following restrictions:
|
|
233
|
+
|
|
234
|
+
1. The origin of this software must not be misrepresented; you must not
|
|
235
|
+
claim that you wrote the original software. If you use this software
|
|
236
|
+
in a product, an acknowledgment in the product documentation would be
|
|
237
|
+
appreciated but is not required.
|
|
238
|
+
|
|
239
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
|
240
|
+
misrepresented as being the original software.
|
|
241
|
+
|
|
242
|
+
3. This notice may not be removed or altered from any source
|
|
243
|
+
distribution.
|
|
244
|
+
|
|
245
|
+
### Copyright: 2020 Andreas Atteneder
|
|
246
|
+
|
|
247
|
+
License: Apache-2.0
|
|
248
|
+
|
|
249
|
+
### Copyright: 2013 Ericsson AB 2013. All Rights Reserved.
|
|
250
|
+
|
|
251
|
+
License: LicenseRef-ETCSLA
|
|
252
|
+
|
|
253
|
+
(C) Ericsson AB 2013. All Rights Reserved.
|
|
254
|
+
|
|
255
|
+
Software License Agreement
|
|
256
|
+
|
|
257
|
+
PLEASE REVIEW THE FOLLOWING TERMS AND CONDITIONS PRIOR TO USING THE
|
|
258
|
+
ERICSSON TEXTURE COMPRESSION CODEC SOFTWARE (THE "SOFTWARE"). THE USE
|
|
259
|
+
OF THE SOFTWARE IS SUBJECT TO THE TERMS AND CONDITIONS OF THE
|
|
260
|
+
FOLLOWING SOFTWARE LICENSE AGREEMENT (THE "SLA"). IF YOU DO NOT ACCEPT
|
|
261
|
+
SUCH TERMS AND CONDITIONS YOU MAY NOT USE THE SOFTWARE.
|
|
262
|
+
|
|
263
|
+
Subject to the terms and conditions of the SLA, the licensee of the
|
|
264
|
+
Software (the "Licensee") hereby, receives a non-exclusive,
|
|
265
|
+
non-transferable, limited, free-of-charge, perpetual and worldwide
|
|
266
|
+
license, to copy, use, distribute and modify the Software, but only
|
|
267
|
+
for the purpose of developing, manufacturing, selling, using and
|
|
268
|
+
distributing products including the Software in binary form, which
|
|
269
|
+
products are used for compression and/or decompression according to
|
|
270
|
+
the Khronos standard specifications OpenGL, OpenGL ES and
|
|
271
|
+
WebGL. Notwithstanding anything of the above, Licensee may distribute
|
|
272
|
+
[etcdec.cxx] in source code form provided (i) it is in unmodified
|
|
273
|
+
form; and (ii) it is included in software owned by Licensee.
|
|
274
|
+
|
|
275
|
+
If Licensee institutes, or threatens to institute, patent litigation
|
|
276
|
+
against Ericsson or Ericsson's affiliates for using the Software for
|
|
277
|
+
developing, having developed, manufacturing, having manufactured,
|
|
278
|
+
selling, offer for sale, importing, using, leasing, operating,
|
|
279
|
+
repairing and/or distributing products (i) within the scope of the
|
|
280
|
+
Khronos framework; or (ii) using software or other intellectual
|
|
281
|
+
property rights owned by Ericsson or its affiliates and provided under
|
|
282
|
+
the Khronos framework, Ericsson shall have the right to terminate this
|
|
283
|
+
SLA with immediate effect. Moreover, if Licensee institutes, or
|
|
284
|
+
threatens to institute, patent litigation against any other licensee
|
|
285
|
+
of the Software for using the Software in products within the scope of
|
|
286
|
+
the Khronos framework, Ericsson shall have the right to terminate this
|
|
287
|
+
SLA with immediate effect. However, should Licensee institute, or
|
|
288
|
+
threaten to institute, patent litigation against any other licensee of
|
|
289
|
+
the Software based on such other licensee's use of any other software
|
|
290
|
+
together with the Software, then Ericsson shall have no right to
|
|
291
|
+
terminate this SLA.
|
|
292
|
+
|
|
293
|
+
This SLA does not transfer to Licensee any ownership to any Ericsson
|
|
294
|
+
or third party intellectual property rights. All rights not expressly
|
|
295
|
+
granted by Ericsson under this SLA are hereby expressly
|
|
296
|
+
reserved. Furthermore, nothing in this SLA shall be construed as a
|
|
297
|
+
right to use or sell products in a manner which conveys or purports to
|
|
298
|
+
convey whether explicitly, by principles of implied license, or
|
|
299
|
+
otherwise, any rights to any third party, under any patent of Ericsson
|
|
300
|
+
or of Ericsson's affiliates covering or relating to any combination of
|
|
301
|
+
the Software with any other software or product (not licensed
|
|
302
|
+
hereunder) where the right applies specifically to the combination and
|
|
303
|
+
not to the software or product itself.
|
|
304
|
+
|
|
305
|
+
THE SOFTWARE IS PROVIDED "AS IS". ERICSSON MAKES NO REPRESENTATIONS OF
|
|
306
|
+
ANY KIND, EXTENDS NO WARRANTIES OR CONDITIONS OF ANY KIND, EITHER
|
|
307
|
+
EXPRESS, IMPLIED OR STATUTORY; INCLUDING, BUT NOT LIMITED TO, EXPRESS,
|
|
308
|
+
IMPLIED OR STATUTORY WARRANTIES OR CONDITIONS OF TITLE,
|
|
309
|
+
MERCHANTABILITY, SATISFACTORY QUALITY, SUITABILITY, AND FITNESS FOR A
|
|
310
|
+
PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
|
|
311
|
+
OF THE SOFTWARE IS WITH THE LICENSEE. SHOULD THE SOFTWARE PROVE
|
|
312
|
+
DEFECTIVE, THE LICENSEE ASSUMES THE COST OF ALL NECESSARY SERVICING,
|
|
313
|
+
REPAIR OR CORRECTION. ERICSSON MAKES NO WARRANTY THAT THE MANUFACTURE,
|
|
314
|
+
SALE, OFFERING FOR SALE, DISTRIBUTION, LEASE, USE OR IMPORTATION UNDER
|
|
315
|
+
THE SLA WILL BE FREE FROM INFRINGEMENT OF PATENTS, COPYRIGHTS OR OTHER
|
|
316
|
+
INTELLECTUAL PROPERTY RIGHTS OF OTHERS, AND THE VALIDITY OF THE
|
|
317
|
+
LICENSE AND THE SLA ARE SUBJECT TO LICENSEE'S SOLE RESPONSIBILITY TO
|
|
318
|
+
MAKE SUCH DETERMINATION AND ACQUIRE SUCH LICENSES AS MAY BE NECESSARY
|
|
319
|
+
WITH RESPECT TO PATENTS, COPYRIGHT AND OTHER INTELLECTUAL PROPERTY OF
|
|
320
|
+
THIRD PARTIES.
|
|
321
|
+
|
|
322
|
+
THE LICENSEE ACKNOWLEDGES AND ACCEPTS THAT THE SOFTWARE (I) IS NOT
|
|
323
|
+
LICENSED FOR; (II) IS NOT DESIGNED FOR OR INTENDED FOR; AND (III) MAY
|
|
324
|
+
NOT BE USED FOR; ANY MISSION CRITICAL APPLICATIONS SUCH AS, BUT NOT
|
|
325
|
+
LIMITED TO OPERATION OF NUCLEAR OR HEALTHCARE COMPUTER SYSTEMS AND/OR
|
|
326
|
+
NETWORKS, AIRCRAFT OR TRAIN CONTROL AND/OR COMMUNICATION SYSTEMS OR
|
|
327
|
+
ANY OTHER COMPUTER SYSTEMS AND/OR NETWORKS OR CONTROL AND/OR
|
|
328
|
+
COMMUNICATION SYSTEMS ALL IN WHICH CASE THE FAILURE OF THE SOFTWARE
|
|
329
|
+
COULD LEAD TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL, MATERIAL OR
|
|
330
|
+
ENVIRONMENTAL DAMAGE. LICENSEE'S RIGHTS UNDER THIS LICENSE WILL
|
|
331
|
+
TERMINATE AUTOMATICALLY AND IMMEDIATELY WITHOUT NOTICE IF LICENSEE
|
|
332
|
+
FAILS TO COMPLY WITH THIS PARAGRAPH.
|
|
333
|
+
|
|
334
|
+
IN NO EVENT SHALL ERICSSON BE LIABLE FOR ANY DAMAGES WHATSOEVER,
|
|
335
|
+
INCLUDING BUT NOT LIMITED TO PERSONAL INJURY, ANY GENERAL, SPECIAL,
|
|
336
|
+
INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN
|
|
337
|
+
CONNECTION WITH THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING
|
|
338
|
+
BUT NOT LIMITED TO LOSS OF PROFITS, BUSINESS INTERUPTIONS, OR ANY
|
|
339
|
+
OTHER COMMERCIAL DAMAGES OR LOSSES, LOSS OF DATA OR DATA BEING
|
|
340
|
+
RENDERED INACCURATE OR LOSSES SUSTAINED BY THE LICENSEE OR THIRD
|
|
341
|
+
PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER
|
|
342
|
+
SOFTWARE) REGARDLESS OF THE THEORY OF LIABILITY (CONTRACT, TORT, OR
|
|
343
|
+
OTHERWISE), EVEN IF THE LICENSEE OR ANY OTHER PARTY HAS BEEN ADVISED
|
|
344
|
+
OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
345
|
+
|
|
346
|
+
Licensee acknowledges that "ERICSSON ///" is the corporate trademark
|
|
347
|
+
of Telefonaktiebolaget LM Ericsson and that both "Ericsson" and the
|
|
348
|
+
figure "///" are important features of the trade names of
|
|
349
|
+
Telefonaktiebolaget LM Ericsson. Nothing contained in these terms and
|
|
350
|
+
conditions shall be deemed to grant Licensee any right, title or
|
|
351
|
+
interest in the word "Ericsson" or the figure "///". No delay or
|
|
352
|
+
omission by Ericsson to exercise any right or power shall impair any
|
|
353
|
+
such right or power to be construed to be a waiver thereof. Consent by
|
|
354
|
+
Ericsson to, or waiver of, a breach by the Licensee shall not
|
|
355
|
+
constitute consent to, waiver of, or excuse for any other different or
|
|
356
|
+
subsequent breach.
|
|
357
|
+
|
|
358
|
+
This SLA shall be governed by the substantive law of Sweden. Any
|
|
359
|
+
dispute, controversy or claim arising out of or in connection with
|
|
360
|
+
this SLA, or the breach, termination or invalidity thereof, shall be
|
|
361
|
+
submitted to the exclusive jurisdiction of the Swedish Courts.
|
|
362
|
+
|
|
363
|
+
=============
|
|
364
|
+
|
|
365
|
+
This package contains a compiled binary (zstddec.wasm) from https://github.com/donmccurdy/zstddec by Don McCurdy, which contains the Zstandard decompression library.
|
|
366
|
+
|
|
367
|
+
### Copyright: 2016-present, Yann Collet, Facebook, Inc.
|
|
368
|
+
|
|
369
|
+
License: BSD-3-Clause
|
|
370
|
+
|
|
371
|
+
Copyright (c) 2016-present, Yann Collet, Facebook, Inc. All rights reserved.
|
|
372
|
+
|
|
373
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
374
|
+
are permitted provided that the following conditions are met:
|
|
375
|
+
|
|
376
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
377
|
+
list of conditions and the following disclaimer.
|
|
378
|
+
|
|
379
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
380
|
+
this list of conditions and the following disclaimer in the documentation
|
|
381
|
+
and/or other materials provided with the distribution.
|
|
382
|
+
|
|
383
|
+
* Neither the name Facebook nor the names of its contributors may be used to
|
|
384
|
+
endorse or promote products derived from this software without specific
|
|
385
|
+
prior written permission.
|
|
386
|
+
|
|
387
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
388
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
389
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
390
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
391
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
392
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
393
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
394
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
395
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
396
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Babylon.js KTX2 Decoder
|
|
2
|
+
Copyright 2024 The Babylon.js team
|
|
3
|
+
|
|
4
|
+
This package contains compiled js andd binary wasm files developed by The Khronos Group (https://github.com/KhronosGroup/KTX-Software/)
|
|
5
|
+
Copyright 2024 The Khronos Group (https://www.khronos.org/),
|
|
6
|
+
Licensed under the Apache 2.0 license.
|
|
7
|
+
|
|
8
|
+
This package contains compiled js andd binary wasm files developed by The Khronos Group (https://github.com/KhronosGroup/Basis-Universal-Transcoders)
|
|
9
|
+
Copyright 2024 The Khronos Group (https://www.khronos.org/),
|
|
10
|
+
Licensed under the Apache 2.0 license.
|
|
11
|
+
|
|
12
|
+
This package contains a compiled binary wasm file (zstddec.wasm) from https://github.com/donmccurdy/zstddec by Don McCurdy,
|
|
13
|
+
which contains the Zstandard decompression library.
|
|
14
|
+
Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
|
|
15
|
+
Licensed under the BSD 3-Clause license.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"components": [
|
|
3
|
+
{
|
|
4
|
+
"name": "babylonjs-ktx2decoder",
|
|
5
|
+
"version": "9.30.0",
|
|
6
|
+
"integrity": "sha512-fmD4vcq9CIpM0bLhMQqe7jybz1RM+S3UDW3/A98d0Xb2uLB5OnCfo6Ie+xVO3y4ItP2NjIpa7/9UnjAW3nmUUg==",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"repository": "https://github.com/BabylonJS/Babylon.js",
|
|
9
|
+
"copyright": "Copyright 2024 The Babylon.js team",
|
|
10
|
+
"licenseFile": "babylonjs-ktx2decoder.LICENSE.md",
|
|
11
|
+
"noticeFile": null,
|
|
12
|
+
"files": [
|
|
13
|
+
{
|
|
14
|
+
"file": "babylon.ktx2Decoder.js",
|
|
15
|
+
"from": "babylon.ktx2Decoder.js",
|
|
16
|
+
"sha256": "cf3d851f01d3e333368f1e0d5cdcbe9b346037ab1859287f5368a11163018942"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "@babylonjs/ktx2decoder",
|
|
22
|
+
"version": "9.30.0",
|
|
23
|
+
"integrity": "sha512-5G8vZ7vpA7l7UkoHz2wuSmQp6zILu8V2z30l8HAOOUi9PfVEdY+nN55ZZhzYXI9IqLNwHa0BcZRGpgEOdob8tg==",
|
|
24
|
+
"license": "Apache-2.0",
|
|
25
|
+
"repository": "https://github.com/BabylonJS/Babylon.js",
|
|
26
|
+
"copyright": "Copyright 2024 The Babylon.js team",
|
|
27
|
+
"licenseFile": "scoped-babylonjs-ktx2decoder.LICENSE.md",
|
|
28
|
+
"noticeFile": "scoped-babylonjs-ktx2decoder.NOTICE.md",
|
|
29
|
+
"files": [
|
|
30
|
+
{
|
|
31
|
+
"file": "msc_basis_transcoder.js",
|
|
32
|
+
"from": "wasm/msc_basis_transcoder.js",
|
|
33
|
+
"sha256": "5be8235b0d33936d2a6bf35f3854771ca3da1f04603bbe756577fc79990249af",
|
|
34
|
+
"note": "patched: 4 embind code generators replaced with closures"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"file": "msc_basis_transcoder.wasm",
|
|
38
|
+
"from": "wasm/msc_basis_transcoder.wasm",
|
|
39
|
+
"sha256": "29becbf0eef2ce9f6d72109ad217704ec3799c432da0c26e3893b793ecab6bdc"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"file": "uastc_astc.wasm",
|
|
43
|
+
"from": "wasm/uastc_astc.wasm",
|
|
44
|
+
"sha256": "6846c972b4a52d938866f43896fd2b2450052da807cdd1285e898be80614d612"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"file": "uastc_bc7.wasm",
|
|
48
|
+
"from": "wasm/uastc_bc7.wasm",
|
|
49
|
+
"sha256": "be442ab8c0cbf734ded98e6ad38112aaba23c83bfeecac4213ded54631fc4eef"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"file": "uastc_r8_unorm.wasm",
|
|
53
|
+
"from": "wasm/uastc_r8_unorm.wasm",
|
|
54
|
+
"sha256": "0467c98b150a630e5a51f7810843e8b7fd9aad22e3888baf70aad255c55d02bc"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"file": "uastc_rg8_unorm.wasm",
|
|
58
|
+
"from": "wasm/uastc_rg8_unorm.wasm",
|
|
59
|
+
"sha256": "fb45a2c103c59cec21c3708a6534d43cd4381669f66d3292dd8a6e4e1956d773"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"file": "uastc_rgba8_srgb_v2.wasm",
|
|
63
|
+
"from": "wasm/uastc_rgba8_srgb_v2.wasm",
|
|
64
|
+
"sha256": "1f4d2e8bfef4e31679b23d473e1c410c29f7e485a739e76c5b357628f4190874"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"file": "uastc_rgba8_unorm_v2.wasm",
|
|
68
|
+
"from": "wasm/uastc_rgba8_unorm_v2.wasm",
|
|
69
|
+
"sha256": "b7470b26a847994cdeb9226eeba1e3711688e378ee438b7dd941e83cb598b694"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"file": "zstddec.wasm",
|
|
73
|
+
"from": "wasm/zstddec.wasm",
|
|
74
|
+
"sha256": "67d12d34f82ef700ec3a3795a77590252858c70330908a87ed1e73efc268cb4b"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "meshoptimizer",
|
|
80
|
+
"version": "1.3.0",
|
|
81
|
+
"integrity": "sha512-2oZqMAcEEiCtXWUjIGtZ71oPx1B0ZxYGTqIKsXB1wzWFhleNsCFxQuUJzgCV706bRcwPWtMGf1odmQvAcqKkIw==",
|
|
82
|
+
"license": "MIT",
|
|
83
|
+
"repository": "https://github.com/zeux/meshoptimizer",
|
|
84
|
+
"copyright": "Copyright (c) 2016-2026 Arseny Kapoulkine",
|
|
85
|
+
"licenseFile": "meshoptimizer.LICENSE.md",
|
|
86
|
+
"noticeFile": null,
|
|
87
|
+
"files": [
|
|
88
|
+
{
|
|
89
|
+
"file": "meshopt_decoder.js",
|
|
90
|
+
"from": "meshopt_decoder.cjs",
|
|
91
|
+
"sha256": "fabafaaa29cbb1cfa367f20e896d7f6e95b86e575e2ea86ddb6f8cca1a87152d"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { getOrCreateSampler, loadBasisTexture2D, loadKtx2Texture2D, setKtx2DecoderUrl, setMeshoptBaseUrl } from "@babylonjs/lite";
|
|
2
|
+
//#region src/lite/gpu/decoders.ts
|
|
3
|
+
/**
|
|
4
|
+
* Points Lite at the given decoder locations.
|
|
5
|
+
*
|
|
6
|
+
* @param urls - The locations; `null` fields are left as they are.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
function applyLiteDecoderUrls(urls) {
|
|
11
|
+
if (urls.ktx2Decoder !== null) {
|
|
12
|
+
const transcoders = {};
|
|
13
|
+
for (const [name, properties] of Object.entries(urls.ktx2Transcoders)) transcoders[name] = { ...properties };
|
|
14
|
+
setKtx2DecoderUrl(urls.ktx2Decoder, transcoders);
|
|
15
|
+
}
|
|
16
|
+
if (urls.meshoptBaseUrl !== null) setMeshoptBaseUrl(urls.meshoptBaseUrl);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Loads a `.ktx2` texture through Lite's KTX2 decoder and gives it the requested sampler.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* `loadKtx2Texture2D` takes only the URL and the sRGB flag. It uploads the file's own mip chain as
|
|
23
|
+
* stored, with a fixed repeat/linear sampler; the sampler is rebuilt here from `options`.
|
|
24
|
+
*
|
|
25
|
+
* ## Orientation: rows as stored
|
|
26
|
+
*
|
|
27
|
+
* Compressed blocks cannot be flipped at upload, so `invertY` has no effect: the file's first row
|
|
28
|
+
* lands at the top of the GPU texture, which is what a PNG gets with `invertY: false`. Lite marks
|
|
29
|
+
* the handle `invertY` and documents that materials flip V for it (`index.d.ts` 14966), but in
|
|
30
|
+
* 1.34 no material reads the flag, and a props-built PBR material ignores `setTextureTransform`
|
|
31
|
+
* too (its UV-transform variant is enabled only by the glTF builder). Measured in
|
|
32
|
+
* `test/assets/ktx2.browser.test.ts`: a top-row-first `.ktx2` draws upside down next to the same
|
|
33
|
+
* PNG loaded with the default `invertY: true`, and a `.ktx2` encoded from the vertically flipped
|
|
34
|
+
* image draws the same. So a `.ktx2` meant to replace a PNG under the default sidecar is encoded
|
|
35
|
+
* flipped (Basis `setYFlip(true)`); `mipMaps` and `premultiplyAlpha` do not apply either.
|
|
36
|
+
*
|
|
37
|
+
* @param engine - The engine that owns the GPU texture.
|
|
38
|
+
* @param url - Where to fetch the file from.
|
|
39
|
+
* @param options - Colour space and sampler.
|
|
40
|
+
* @returns The texture, transcoded to the device's best compressed format. Its reference count
|
|
41
|
+
* starts at one, like `loadTexture2D`'s.
|
|
42
|
+
*
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
async function loadKtx2TextureWithOptions(engine, url, options) {
|
|
46
|
+
const texture = await loadKtx2Texture2D(engine, url, options.srgb ?? false);
|
|
47
|
+
const hasMips = texture.texture.mipLevelCount > 1;
|
|
48
|
+
const minFilter = options.minFilter ?? "linear";
|
|
49
|
+
const magFilter = options.magFilter ?? "linear";
|
|
50
|
+
const mipmapFilter = hasMips ? "linear" : "nearest";
|
|
51
|
+
const allLinear = minFilter === "linear" && magFilter === "linear" && mipmapFilter === "linear";
|
|
52
|
+
texture.sampler = getOrCreateSampler(engine, {
|
|
53
|
+
addressModeU: options.addressModeU ?? "repeat",
|
|
54
|
+
addressModeV: options.addressModeV ?? "repeat",
|
|
55
|
+
minFilter,
|
|
56
|
+
magFilter,
|
|
57
|
+
mipmapFilter,
|
|
58
|
+
maxAnisotropy: allLinear ? 4 : 1
|
|
59
|
+
});
|
|
60
|
+
return texture;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Loads a `.basis` texture through Lite's Basis Universal loader.
|
|
64
|
+
*
|
|
65
|
+
* @remarks
|
|
66
|
+
* Sampler and sRGB options apply; `mipMaps` and `invertY` are ignored by Lite. The transcoder always
|
|
67
|
+
* comes from the Babylon CDN (see the module comment).
|
|
68
|
+
*
|
|
69
|
+
* @param engine - The engine that owns the GPU texture.
|
|
70
|
+
* @param url - Where to fetch the file from.
|
|
71
|
+
* @param options - Colour space and sampler.
|
|
72
|
+
* @returns The texture.
|
|
73
|
+
*
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
function loadBasisTextureWithOptions(engine, url, options) {
|
|
77
|
+
return loadBasisTexture2D(engine, url, options);
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { applyLiteDecoderUrls, loadBasisTextureWithOptions, loadKtx2TextureWithOptions };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=decoders-CHJ7vduE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoders-CHJ7vduE.js","names":[],"sources":["../src/lite/gpu/decoders.ts"],"sourcesContent":["import {\n getOrCreateSampler,\n loadBasisTexture2D,\n loadKtx2Texture2D,\n setKtx2DecoderUrl,\n setMeshoptBaseUrl,\n} from \"@babylonjs/lite\";\nimport type { EngineContext, Texture2D, Texture2DOptions } from \"@babylonjs/lite\";\n\n/**\n * The compressed-texture and decoder half of the Babylon Lite adapter\n * (`docs/architecture/07-rendering.md` §7). Imported only dynamically, from `./texture.ts` and\n * `../../render/decoder-urls.ts`, so a game that loads no KTX2 texture and no glTF carries none of\n * Lite's KTX2, Basis or meshopt glue.\n *\n * Everything here is `@internal`.\n *\n * ## The decoders (verified against `@babylonjs/lite@1.34.0`)\n *\n * `loadKtx2Texture2D` (`index.d.ts` 7892) and the glTF `KHR_texture_basisu` path inject\n * `babylon.ktx2Decoder.js` as a `<script>` and read the `KTX2DECODER` global it defines; that\n * script then fetches its transcoders (`msc_basis_transcoder.js` and `.wasm` for ETC1S,\n * `uastc_*.wasm` for UASTC, `zstddec.wasm` for Zstandard supercompression). glTF\n * `EXT_meshopt_compression` injects `meshopt_decoder.js`. Every one of them comes from\n * `https://cdn.babylonjs.com/` unless `setKtx2DecoderUrl` (12484) and `setMeshoptBaseUrl` (12538)\n * say otherwise (`lib/texture/ktx2-loader.js`, `lib/loader-gltf/meshopt-decode.js`). Both setters\n * write process-wide state, and the KTX2 decoder is loaded once: a URL set after the first KTX2\n * load is ignored until a failed load clears Lite's cached promise.\n *\n * `loadBasisTexture2D` (7771) has no such setter. It always fetches `basis_transcoder.js` and its\n * WASM from `https://cdn.babylonjs.com/basisTranscoder/1/` (`lib/texture/basis-loader.js`), so a\n * `.basis` file cannot load under a `script-src 'self'` policy until Lite adds one.\n *\n * ## Transcode targets\n *\n * Lite picks them; the public API has no override. Its caps come from the device features\n * `texture-compression-{astc,bc,etc2}`, which `createEngine` requests whenever the adapter has\n * them (`lib/engine/engine.js`). The decoder's decision tree (`@babylonjs/ktx2decoder`\n * `transcodeDecisionTree.js`) then gives:\n *\n * - ETC1S: ETC2 (RGB, or RGBA with alpha) when `etc2` is present, else BC7 when `bc` is, else RGBA8.\n * - UASTC: ASTC 4×4 when `astc` is present, else BC7 when `bc` is, else ETC2 when `etc2` is, else\n * RGBA8.\n *\n * So a Windows or Linux desktop GPU gets BC7, Apple silicon gets ETC2 (ETC1S) or ASTC (UASTC),\n * and a device with no compression feature gets uncompressed RGBA8. `.basis` uses Lite's own\n * order: BC7, ASTC 4×4, ETC2, BC3, BC1, RGBA8.\n */\n\n/**\n * Where Lite should load its decoders from. A `null` field leaves Lite's default for that decoder.\n *\n * @internal\n */\nexport interface LiteDecoderUrls {\n /** The URL of `babylon.ktx2Decoder.js`, or `null` for Lite's CDN default. */\n readonly ktx2Decoder: string | null;\n /**\n * Overrides for the decoder's transcoder modules: class name in the `KTX2DECODER` namespace →\n * static property → URL, the second argument of `setKtx2DecoderUrl`. Ignored when\n * {@link LiteDecoderUrls.ktx2Decoder} is `null`.\n */\n readonly ktx2Transcoders: Readonly<Record<string, Readonly<Record<string, string>>>>;\n /** The directory `meshopt_decoder.js` is served from, or `null` for Lite's CDN default. */\n readonly meshoptBaseUrl: string | null;\n}\n\n/**\n * Points Lite at the given decoder locations.\n *\n * @param urls - The locations; `null` fields are left as they are.\n *\n * @internal\n */\nexport function applyLiteDecoderUrls(urls: LiteDecoderUrls): void {\n if (urls.ktx2Decoder !== null) {\n // `setKtx2DecoderUrl` keeps its own reference; a copy keeps the caller's object frozen-safe.\n const transcoders: Record<string, Record<string, string>> = {};\n for (const [name, properties] of Object.entries(urls.ktx2Transcoders)) {\n transcoders[name] = { ...properties };\n }\n setKtx2DecoderUrl(urls.ktx2Decoder, transcoders);\n }\n if (urls.meshoptBaseUrl !== null) {\n setMeshoptBaseUrl(urls.meshoptBaseUrl);\n }\n}\n\n/**\n * Loads a `.ktx2` texture through Lite's KTX2 decoder and gives it the requested sampler.\n *\n * @remarks\n * `loadKtx2Texture2D` takes only the URL and the sRGB flag. It uploads the file's own mip chain as\n * stored, with a fixed repeat/linear sampler; the sampler is rebuilt here from `options`.\n *\n * ## Orientation: rows as stored\n *\n * Compressed blocks cannot be flipped at upload, so `invertY` has no effect: the file's first row\n * lands at the top of the GPU texture, which is what a PNG gets with `invertY: false`. Lite marks\n * the handle `invertY` and documents that materials flip V for it (`index.d.ts` 14966), but in\n * 1.34 no material reads the flag, and a props-built PBR material ignores `setTextureTransform`\n * too (its UV-transform variant is enabled only by the glTF builder). Measured in\n * `test/assets/ktx2.browser.test.ts`: a top-row-first `.ktx2` draws upside down next to the same\n * PNG loaded with the default `invertY: true`, and a `.ktx2` encoded from the vertically flipped\n * image draws the same. So a `.ktx2` meant to replace a PNG under the default sidecar is encoded\n * flipped (Basis `setYFlip(true)`); `mipMaps` and `premultiplyAlpha` do not apply either.\n *\n * @param engine - The engine that owns the GPU texture.\n * @param url - Where to fetch the file from.\n * @param options - Colour space and sampler.\n * @returns The texture, transcoded to the device's best compressed format. Its reference count\n * starts at one, like `loadTexture2D`'s.\n *\n * @internal\n */\nexport async function loadKtx2TextureWithOptions(\n engine: EngineContext,\n url: string,\n options: Texture2DOptions,\n): Promise<Texture2D> {\n const texture = await loadKtx2Texture2D(engine, url, options.srgb ?? false);\n const hasMips = texture.texture.mipLevelCount > 1;\n const minFilter = options.minFilter ?? \"linear\";\n const magFilter = options.magFilter ?? \"linear\";\n const mipmapFilter: GPUMipmapFilterMode = hasMips ? \"linear\" : \"nearest\";\n // WebGPU accepts anisotropy only when every filter is linear; this is Lite's own rule for\n // `loadTexture2D`.\n const allLinear = minFilter === \"linear\" && magFilter === \"linear\" && mipmapFilter === \"linear\";\n texture.sampler = getOrCreateSampler(engine, {\n addressModeU: options.addressModeU ?? \"repeat\",\n addressModeV: options.addressModeV ?? \"repeat\",\n minFilter,\n magFilter,\n mipmapFilter,\n maxAnisotropy: allLinear ? 4 : 1,\n });\n return texture;\n}\n\n/**\n * Loads a `.basis` texture through Lite's Basis Universal loader.\n *\n * @remarks\n * Sampler and sRGB options apply; `mipMaps` and `invertY` are ignored by Lite. The transcoder always\n * comes from the Babylon CDN (see the module comment).\n *\n * @param engine - The engine that owns the GPU texture.\n * @param url - Where to fetch the file from.\n * @param options - Colour space and sampler.\n * @returns The texture.\n *\n * @internal\n */\nexport function loadBasisTextureWithOptions(\n engine: EngineContext,\n url: string,\n options: Texture2DOptions,\n): Promise<Texture2D> {\n return loadBasisTexture2D(engine, url, options);\n}\n"],"mappings":";;;;;;;;;AA0EA,SAAgB,qBAAqB,MAA6B;CAChE,IAAI,KAAK,gBAAgB,MAAM;EAE7B,MAAM,cAAsD,CAAC;EAC7D,KAAK,MAAM,CAAC,MAAM,eAAe,OAAO,QAAQ,KAAK,eAAe,GAClE,YAAY,QAAQ,EAAE,GAAG,WAAW;EAEtC,kBAAkB,KAAK,aAAa,WAAW;CACjD;CACA,IAAI,KAAK,mBAAmB,MAC1B,kBAAkB,KAAK,cAAc;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,eAAsB,2BACpB,QACA,KACA,SACoB;CACpB,MAAM,UAAU,MAAM,kBAAkB,QAAQ,KAAK,QAAQ,QAAQ,KAAK;CAC1E,MAAM,UAAU,QAAQ,QAAQ,gBAAgB;CAChD,MAAM,YAAY,QAAQ,aAAa;CACvC,MAAM,YAAY,QAAQ,aAAa;CACvC,MAAM,eAAoC,UAAU,WAAW;CAG/D,MAAM,YAAY,cAAc,YAAY,cAAc,YAAY,iBAAiB;CACvF,QAAQ,UAAU,mBAAmB,QAAQ;EAC3C,cAAc,QAAQ,gBAAgB;EACtC,cAAc,QAAQ,gBAAgB;EACtC;EACA;EACA;EACA,eAAe,YAAY,IAAI;CACjC,CAAC;CACD,OAAO;AACT;;;;;;;;;;;;;;;AAgBA,SAAgB,4BACd,QACA,KACA,SACoB;CACpB,OAAO,mBAAmB,QAAQ,KAAK,OAAO;AAChD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as assertNever } from "./ignifx-error-
|
|
1
|
+
import { n as assertNever } from "./ignifx-error-Dq2qJMkZ.js";
|
|
2
2
|
import { s as degToRad } from "./math-utils-BcDnL-gi.js";
|
|
3
3
|
import { t as Color } from "./color-DrR6GFTd.js";
|
|
4
4
|
import { AcesToneMapping, NeutralToneMapping, StandardToneMapping, loadEnvironment, setEnvironmentBlur, setEnvironmentRotation, setFog, setSceneImageProcessing } from "@babylonjs/lite";
|
|
@@ -280,4 +280,4 @@ function toneMappingCurve(name) {
|
|
|
280
280
|
//#endregion
|
|
281
281
|
export { readSceneImageProcessing as a, setSceneEnvironmentRotation as c, readSceneEnvironment as i, setSceneFog as l, installSceneEnvironment as n, setSceneClearColor as o, loadSceneEnvironment as r, setSceneEnvironmentBlur as s, TONE_MAPPING_NAMES as t, setSceneImageProcessingOptions as u };
|
|
282
282
|
|
|
283
|
-
//# sourceMappingURL=environment-
|
|
283
|
+
//# sourceMappingURL=environment-C9AjYJgV.js.map
|