Commit 7627150
[Native] Load single-file .dds/.ktx/.ktx2 cubemaps on the native engine
The native createCubeTexture override only handled a single .env file or six
face files; a single self-contained cubemap container (.dds/.ktx/.ktx2, as
produced by CubeTexture.CreateFromPrefilteredData) threw "Cannot load cubemap
because 6 files were not defined". The generic WebGL loader route is unusable on
native (its texture-upload and cube-readback entry points are unimplemented).
Route a single-URL container cubemap to engine.loadCubeTexture with the raw
buffer; the native engine decodes it (bimg) and, when polynomials are requested,
returns spherical-harmonics coefficients computed from the top mip, which are set
as the texture's spherical polynomial. loadCubeTexture's onSuccess now optionally
carries those coefficients. The .env and six-file paths are unchanged.
Pairs with a Babylon Native NativeEngine change implementing the single-buffer
cube decode and spherical-harmonics computation.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent a736e85 commit 7627150
2 files changed
Lines changed: 119 additions & 26 deletions
File tree
- packages/dev/core/src/Engines/Native
- Extensions
Lines changed: 86 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
129 | 125 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
141 | 145 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
146 | 185 | | |
147 | | - | |
148 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
149 | 210 | | |
150 | 211 | | |
151 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
78 | 86 | | |
79 | 87 | | |
80 | 88 | | |
| |||
433 | 441 | | |
434 | 442 | | |
435 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
436 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
437 | 451 | | |
438 | 452 | | |
439 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
440 | 457 | | |
441 | 458 | | |
442 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
443 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
444 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
445 | 471 | | |
446 | 472 | | |
447 | 473 | | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
448 | 477 | | |
449 | 478 | | |
450 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
451 | 483 | | |
452 | 484 | | |
453 | 485 | | |
| |||
0 commit comments