Commit Graph

83 Commits

Author SHA1 Message Date
keyboardspecialist 849de499da use existing properties to check content state 2025-06-12 13:35:03 -05:00
keyboardspecialist 8dd2bbc81e Added two new functions to Cesium3DTilesTester: waitForTileContent and waitForTileContentReady
These are for cases like Gaussian Splats where extra async processing is needed.
2025-06-09 10:45:23 -05:00
jerome.fayot 62e0b4945e fix: changed DefaultValues namespace to Frozen 2025-03-11 22:59:03 +01:00
jerome.fayot 402fe6b579 fix: replaced defaultValue with ?? 2025-03-11 22:58:00 +01:00
ggetz 3bb4c37f55 Prettier 2024-10-03 10:04:23 -04:00
ggetz 298de97c78 Draft 2024-09-03 09:09:38 -04:00
ggetz 3f8c1b10f8 Spec updates for environment maps 2024-08-29 12:53:55 -04:00
Gabby Getz 0a498caa36 Deprecate Cesium3DTileset ready and readyPromise 2023-03-20 11:57:06 -04:00
Gabby Getz d02e73908a Refactor loading promises 2023-03-17 14:20:46 -04:00
Sanjeet Suhag aaf6bd8a5c Adds engine and widgets workspaces 2022-11-01 15:39:57 -04:00
Peter Gagliardi 5f50db1970 PR feedback 2022-08-04 11:27:50 -04:00
Peter Gagliardi 1de3507b1d Fix composite content tests 2022-08-04 10:44:11 -04:00
Sanjeet Suhag cf266ae4af Fixes duplicate imports in specs 2022-07-21 17:32:08 -04:00
Jeshurun Hembd a4f5bc2a3a Remove remaining calls to arraySlice and arrayFill polyfills 2022-06-28 09:45:06 -04:00
Gabby Getz b4ecc9de7b Merge branch 'main' into defer-b-gone 2022-05-06 11:03:45 -04:00
Gabby Getz 261de00416 Remove defer from 3D tiles, point cloud, and glTF loading 2022-05-05 16:40:22 -04:00
Janine Liu 6c5c3467d7 Merge with main 2022-03-23 14:31:56 -04:00
Janine Liu 4522b69e8d Add imageBasedLighting to tilesets and models 2022-03-23 14:20:57 -04:00
Eli Bogomolny 80b1642617 First pass removing unused matchers 2022-03-21 18:05:52 -04:00
Gabby Getz 31c154a299 Remove when.js and replace with native promises
There were a few areas in Source where a function was assumed to be executed synchronously when a function was resolved. Native Promises however, by spec, will resolve at the end of a frame. There were also some strange handling of promise rejection in imagery providers that I cleaned up a bit in order to make them testable.

- In LabelCollection and EntityCluster, order of execution adjustment where made.
- Added TextureAtlas.addImageSync to support the order of execution fix in LabelCollection
- ArcGisMapServerImageryProvider.readyPromise will not reject if there is a failure unless the request cannot be retried.
- SingleTileImageryProvider.readyPromise will not reject if there is a failure unless the request cannot be retried.

The majority of the changes lie in the Specs, where unresolved promises weren’t being awaited before finishing executions, and where resolved promises are assumed to be synchronous all over the place and needed a good amount of fixes. Another issue which came up was calling Promise.reject in the body of a spec can cause node to halt execution when running via the command line.
2022-03-16 09:38:39 -04:00
Gabby Getz 48732487c6 Merge branch 'main' into let-const 2022-01-26 13:41:29 -05:00
bbbbx 73aef854d8 Fixed tests for Instanced3DModel3DTileContent 2022-01-24 21:59:21 +08:00
Gabby Getz 8143df4436 var -> const/let 2022-01-21 11:26:25 -05:00
Sean Lilley 2c486cff79 Added more tests for I3dmParser 2022-01-03 11:15:04 -05:00
Sean Lilley 099c4a3816 Added glTF loaders 2021-04-11 22:17:52 -04:00
Peter Gagliardi c0b972d52f Add more unit tests 2021-03-10 13:16:37 -05:00
Matthew Amato 2fd0e8f7e4 Format all code with prettier 2020-04-16 20:31:36 -04:00
Matthew Amato aabd27a760 Migrate Cesium to ES6 Modules
See https://github.com/AnalyticalGraphicsInc/cesium/pull/8224 for details.

eslint
There are a handful of new .eslintrc.json files, mostly to identify the files that are still AMD modules (Sandcastle/Workers). These are needed because you can't change the parser type with a comment directive (since the parser is the thing reading the file). We can finally detect unusued modules! So those have all been cleaned up as well.

requirejs -> rollup & clean-css
requirejs, almond, and karma-requirejs have all been removed. We now use rollup for building and minifying (via uglify) JS code and clean-css for css. These changes are fairly straight-forward and just involve calling rollup instead of requirejs in the build process.

Overall build time is significantly faster. CI is ~11 minutes compared to ~17 in master. Running makeZipFile on my machine takes 69 seconds compared to 112 seconds in master. There's probably plenty of room for additional optimization here too.

We wrote an published a small npm module, rollup-plugin-strip-pragma, for stripping the requirejs pragmas we use out of the release builds. This is maintained in the Tools/rollup-plugin-strip-pragma directory.

As for what we produce. The built version of Cesium is now a UMD module. So it should work anywhere that hasn't made the jump to ES6 yet. For users that were already using the "legacy" combined/minified approach, nothing changes.

One awesome thing about roll-up is that it compiles all of the workers at once and automatically detects shared codes and generates separate bundles under the hood. This means the size of our worker modules shrink dramatically and Cesium itself will load them much faster. The total minified/gzipped size of all workers in master is 2.6 MB compared to 225 KB in this branch! This should be most noticeable on demos like Geometry & Appearances which load lots of workers for the various geometry typs.

roll-up is also used to build Cesium Viewer, which is now an ES6 app.

We use clean-css via gulp and it is also a straightforward change from requirejs that requires no special mention.

Workers
While the spec allows for ES6 Web Workers, no browser actually supports them yet. That means we needed a way to get our workers into non-ES6 form. Thankfully, roll-up can generate AMD modules, which means we now have a build step to compile our Worker source code back into AMD and use the existing TaskProcessor to load and execute them. This build step is part of the standard build task and is called createWorkers. During development, these "built" workers are un-optimized so you can still debug them and read the code.

Since there is a build step, that means if you are changing code that affects a worker, you need to re-run build, or you can use the build-watch task to do it automatically.

The ES6 versions of Worker code has moved into Source/WorkersES6 and we build the workers into their "old home" of Source/Workers. cesiumWorkerBootstrapper and transferTypedArrayTest which were already non-AMD ES5 scripts remain living in the Workers directory.

Surprisingly little was changed about TaskProcessor or the worker system in general, especially considering that I thought this would be one of the major hurdles.

ThirdParty
A lot of our ThirdParty either already had a hand-written wrapper for AMD (which I updated to ES6) or had UMD which created problems when importing the same code in both Node and the browser. I basically had to update the wrapper of every third-party library to fix these problems. In some cases I updated the library version itself (Autolinker, topojson). Nothing to be too concerned about, but future clean-up would be using npm versions of these libraries and auto-generating the wrappers as needed so we don't hand-edit things.

Sandcastle
Sandcastle is eternal and manages to live another day in it's ancient requirejs/dojo 1.x form. Sandcastle now automatically uses the ES6 version of Cesium if it is available and fallsback to the ES5 unminified version if it is now. The built version of Sandcastle always uses CesiumUnminified, just like master. This means Sandcastle still works in IE11 if you run the combine step first (or use the relase zip)

Removed Cesium usage from Sandcastle proper, since it wasn't really needed
Generate a VERSION propertyin the gallery index since Cesium is no longer being included.
Remove requirejs from Sandcastle bucket
Update bucket to use the built version of Cesium if it is available by fallbackto the ES6 version during development.
Standalone.html was also updated
There's a bit of room for further clean-up here, but I think this gets us into master. I did not rename bucket-requirejs.html because I'm pretty sure it would break previously shared demos. We can put in some backwards compatible code later on if we want. (But I'd rather just see a full Sandcastle rewrite).

Specs
Specs are now all ES6, except for TestWorkers, which remain standard JS worker modules. This means you can no longer run the unbuilt unit tests in IE11. No changes for Chrome and Firefox.

Since the specs use ES6 modules and built Cesium is an ES5 UMD, I added a build-specs build step which generates a combined ES5 version of the specs which rely on Cesium as a global variable. We then inject these files into jasmine instead of the standard specs and everything works exactly as it did before. SpecRunner.html has been updated to inject the correct version of the script depending on the build/release query parameters.

The Specs must always use Cesium by importing Source/Cesium.js, this is so we can replace it with the built Cesium as describe above.

There's a bunch of room for clean-up here, such as unifying our two copies of jasmine into a single helper file, but I didn't want to start doing that clean-up as part of this already overly big PR. The important thing is that we can still test the built version and still test on IE/Edge as needed.

I also found and fixed two bugs that were causing failing unit tests, one in BingMapsImageryProviderSpec.js (which was overwriting createImage andnot setting it back) and ShadowVolumeAppearance.js (which had a module level caching bug). I think these may have been the cause of random CI failures in master as well, but only time will tell.

For coverage, we had to switch to karma-coverage-istanbul-instrumenter for native ES6 support, but that's it.

Finally, I updated appveryor to build Cesium and run the built tests under IE. We still don't fail the build for IE, but we should probably fix that if we want to keep it going.

NodeJS
When NODE_ENV is production, we now require in the minified CesiumJS directly, which works great because it's now a UMD module. Otherwise, we use the excellant esmpackage to load individual modules, it was a fairly straightforward swap from our old requirejs usage. We could probably drop esm too if we don't care about debugging or if we provie source maps at some point.
2019-10-03 11:51:23 -04:00
Sean Lilley 675b47e3a3 Render 3D Tiles at fixed time of day 2019-05-01 12:24:42 -04:00
loshjawrence 7542625d8a adding cullrequestswhilemoving default to loadTileset in tilestester 2019-02-08 13:37:17 -05:00
loshjawrence 23e63227bc adding spec fixes 2019-02-05 14:19:03 -05:00
Omar Shehata 7d5bb573f6 Fix point cloud tests 2018-09-18 15:50:54 -04:00
Sean Lilley e8546dbef8 Merge branch 'master' into root-public 2018-08-20 21:30:46 -04:00
Sean Lilley c83dd970cd Make tileset.root public 2018-08-03 14:05:13 -04:00
Sean Lilley ac0cf768e9 Merge branch 'master' into traversal-cleanup 2018-06-12 21:41:37 -04:00
Sean Lilley b5c71e22ad Typos 2018-05-10 18:25:05 -04:00
Dan Bagnell 05e83d2fa9 Fix more tests. Remove pick id declaration and use the original fragment shader so alpha == 0.0 can be discarded. 2018-05-08 18:48:27 -04:00
Dan Bagnell 15d796ed52 Fix some tests. 2018-05-03 16:42:01 -04:00
Sean Lilley a6aad571e2 Fixing tests 2018-03-29 15:12:21 -04:00
Tom Fili 194d522e88 Merged in master. 2018-01-13 16:34:13 -05:00
Tom Fili e4bf6dd256 Got all tests passing. Added some doc. 2018-01-12 13:57:15 -05:00
Dan Bagnell 09a8fd2167 Align with revisions to spec. Update parsing and test tiles. 2018-01-04 15:04:54 -05:00
Dan Bagnell bf9572db1a Add exception tests for vector and geometry tiles. 2018-01-02 17:03:20 -05:00
hpinkos dc3a84f6c9 no dangling commas, no unused requires 2017-11-20 16:05:08 -05:00
Ottavio Hartman 337ad9d7eb Remove global define and global defineSuite 2017-06-28 17:10:51 -04:00
Sean Lilley 374c5e0196 Improve test coverage in some files 2017-06-12 20:20:53 -04:00
Sean Lilley a011d36d09 More cleanup 2017-06-12 17:55:24 -04:00
Sean Lilley de6ba12846 Cleanup 2017-06-09 18:07:00 -04:00
Sean Lilley 75789979cc Doc fixes 2017-05-24 12:01:31 -04:00
Sean Lilley 2c78cc99ed Tests 2017-04-18 17:41:24 -04:00