@cesium/engine 0.1.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/Build/ThirdParty/Workers/basis_transcoder.js +2233 -0
- package/Build/ThirdParty/Workers/draco_decoder_nodejs.js +1872 -0
- package/Build/ThirdParty/Workers/package.json +1 -0
- package/Build/ThirdParty/Workers/pako_deflate.min.js +589 -0
- package/Build/ThirdParty/Workers/pako_inflate.min.js +798 -0
- package/Build/ThirdParty/Workers/z-worker-pako.js +503 -0
- package/Build/ThirdParty/basis_transcoder.wasm +0 -0
- package/Build/ThirdParty/draco_decoder.wasm +0 -0
- package/Build/ThirdParty/google-earth-dbroot-parser.js +8019 -0
- package/Build/Widget/CesiumWidget.css +120 -0
- package/Build/Widget/lighter.css +13 -0
- package/Build/Workers/ArcType-ce2e50ab.js +37 -0
- package/Build/Workers/AttributeCompression-4589338a.js +716 -0
- package/Build/Workers/AxisAlignedBoundingBox-bfb1234f.js +258 -0
- package/Build/Workers/BoundingRectangle-7ffc2153.js +369 -0
- package/Build/Workers/BoxGeometry-93f344a3.js +884 -0
- package/Build/Workers/Check-666ab1a0.js +290 -0
- package/Build/Workers/Color-0c5aaf47.js +2262 -0
- package/Build/Workers/ComponentDatatype-f7b11d02.js +341 -0
- package/Build/Workers/CoplanarPolygonGeometryLibrary-6597982a.js +132 -0
- package/Build/Workers/CorridorGeometryLibrary-2119580e.js +498 -0
- package/Build/Workers/CylinderGeometry-f9503c6d.js +467 -0
- package/Build/Workers/CylinderGeometryLibrary-372c07d8.js +63 -0
- package/Build/Workers/EllipseGeometry-fedf72d5.js +1304 -0
- package/Build/Workers/EllipseGeometryLibrary-4ea68687.js +366 -0
- package/Build/Workers/EllipseOutlineGeometry-e2ae6a35.js +443 -0
- package/Build/Workers/EllipsoidGeodesic-16de63ea.js +520 -0
- package/Build/Workers/EllipsoidGeometry-95c0330e.js +637 -0
- package/Build/Workers/EllipsoidOutlineGeometry-d6d2ceec.js +454 -0
- package/Build/Workers/EllipsoidRhumbLine-ae5e65e0.js +741 -0
- package/Build/Workers/EllipsoidTangentPlane-bfc674bf.js +373 -0
- package/Build/Workers/EncodedCartesian3-f473ea18.js +171 -0
- package/Build/Workers/FrustumGeometry-3bf2e4eb.js +2512 -0
- package/Build/Workers/GeometryAttribute-df5f473e.js +619 -0
- package/Build/Workers/GeometryAttributes-f06a2792.js +91 -0
- package/Build/Workers/GeometryInstance-aa75b4cf.js +121 -0
- package/Build/Workers/GeometryOffsetAttribute-04332ce7.js +16 -0
- package/Build/Workers/GeometryPipeline-f0e46c42.js +3690 -0
- package/Build/Workers/IndexDatatype-a55ceaa1.js +200 -0
- package/Build/Workers/IntersectionTests-9de29d51.js +1836 -0
- package/Build/Workers/Math-2dbd6b93.js +1330 -0
- package/Build/Workers/Matrix2-ce637455.js +7084 -0
- package/Build/Workers/Matrix3-4f4df527.js +4282 -0
- package/Build/Workers/OrientedBoundingBox-d3ff3d4d.js +1257 -0
- package/Build/Workers/Plane-b81241c2.js +309 -0
- package/Build/Workers/PolygonGeometryLibrary-6f4937bb.js +1074 -0
- package/Build/Workers/PolygonPipeline-774a8aaf.js +1341 -0
- package/Build/Workers/PolylinePipeline-2e2b015c.js +573 -0
- package/Build/Workers/PolylineVolumeGeometryLibrary-7ee1d449.js +781 -0
- package/Build/Workers/PrimitivePipeline-a9b7aae0.js +966 -0
- package/Build/Workers/RectangleGeometryLibrary-9aa6c8f6.js +280 -0
- package/Build/Workers/RuntimeError-06c93819.js +68 -0
- package/Build/Workers/TerrainEncoding-b52dcfc5.js +1227 -0
- package/Build/Workers/Transforms-2f755df8.js +14683 -0
- package/Build/Workers/VertexFormat-6b480673.js +312 -0
- package/Build/Workers/WallGeometryLibrary-ab19a93d.js +211 -0
- package/Build/Workers/WebGLConstants-a8cc3e8c.js +620 -0
- package/Build/Workers/WebMercatorProjection-9f25de49.js +151 -0
- package/Build/Workers/arrayRemoveDuplicates-c2038105.js +129 -0
- package/Build/Workers/cesiumWorkerBootstrapper.js +1273 -0
- package/Build/Workers/combine-ca22a614.js +82 -0
- package/Build/Workers/combineGeometry.js +17 -0
- package/Build/Workers/createBoxGeometry.js +12 -0
- package/Build/Workers/createBoxOutlineGeometry.js +313 -0
- package/Build/Workers/createCircleGeometry.js +213 -0
- package/Build/Workers/createCircleOutlineGeometry.js +160 -0
- package/Build/Workers/createCoplanarPolygonGeometry.js +586 -0
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +236 -0
- package/Build/Workers/createCorridorGeometry.js +1407 -0
- package/Build/Workers/createCorridorOutlineGeometry.js +603 -0
- package/Build/Workers/createCylinderGeometry.js +12 -0
- package/Build/Workers/createCylinderOutlineGeometry.js +265 -0
- package/Build/Workers/createEllipseGeometry.js +14 -0
- package/Build/Workers/createEllipseOutlineGeometry.js +14 -0
- package/Build/Workers/createEllipsoidGeometry.js +12 -0
- package/Build/Workers/createEllipsoidOutlineGeometry.js +15 -0
- package/Build/Workers/createFrustumGeometry.js +12 -0
- package/Build/Workers/createFrustumOutlineGeometry.js +251 -0
- package/Build/Workers/createGeometry.js +55 -0
- package/Build/Workers/createGroundPolylineGeometry.js +2134 -0
- package/Build/Workers/createPlaneGeometry.js +250 -0
- package/Build/Workers/createPlaneOutlineGeometry.js +115 -0
- package/Build/Workers/createPolygonGeometry.js +1420 -0
- package/Build/Workers/createPolygonOutlineGeometry.js +683 -0
- package/Build/Workers/createPolylineGeometry.js +571 -0
- package/Build/Workers/createPolylineVolumeGeometry.js +411 -0
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +301 -0
- package/Build/Workers/createRectangleGeometry.js +1476 -0
- package/Build/Workers/createRectangleOutlineGeometry.js +535 -0
- package/Build/Workers/createSimplePolylineGeometry.js +458 -0
- package/Build/Workers/createSphereGeometry.js +123 -0
- package/Build/Workers/createSphereOutlineGeometry.js +126 -0
- package/Build/Workers/createTaskProcessorWorker.js +127 -0
- package/Build/Workers/createVectorTileClampedPolylines.js +535 -0
- package/Build/Workers/createVectorTileGeometries.js +445 -0
- package/Build/Workers/createVectorTilePoints.js +79 -0
- package/Build/Workers/createVectorTilePolygons.js +406 -0
- package/Build/Workers/createVectorTilePolylines.js +254 -0
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +640 -0
- package/Build/Workers/createVerticesFromHeightmap.js +2707 -0
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +994 -0
- package/Build/Workers/createWallGeometry.js +623 -0
- package/Build/Workers/createWallOutlineGeometry.js +432 -0
- package/Build/Workers/decodeDraco.js +381 -0
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +3668 -0
- package/Build/Workers/decodeI3S.js +1040 -0
- package/Build/Workers/defaultValue-0a909f67.js +51 -0
- package/Build/Workers/package.js +2 -0
- package/Build/Workers/transcodeKTX2.js +1516 -0
- package/Build/Workers/transferTypedArrayTest.js +18 -0
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +1023 -0
- package/LICENSE.md +933 -0
- package/README.md +58 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- package/Source/Assets/Images/bing_maps_credit.png +0 -0
- package/Source/Assets/Images/cesium_credit.png +0 -0
- package/Source/Assets/Images/google_earth_credit.png +0 -0
- package/Source/Assets/Images/ion-credit.png +0 -0
- package/Source/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/Source/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/Source/Assets/Textures/maki/airfield.png +0 -0
- package/Source/Assets/Textures/maki/airport.png +0 -0
- package/Source/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/Source/Assets/Textures/maki/america-football.png +0 -0
- package/Source/Assets/Textures/maki/art-gallery.png +0 -0
- package/Source/Assets/Textures/maki/bakery.png +0 -0
- package/Source/Assets/Textures/maki/bank.png +0 -0
- package/Source/Assets/Textures/maki/bar.png +0 -0
- package/Source/Assets/Textures/maki/baseball.png +0 -0
- package/Source/Assets/Textures/maki/basketball.png +0 -0
- package/Source/Assets/Textures/maki/beer.png +0 -0
- package/Source/Assets/Textures/maki/bicycle.png +0 -0
- package/Source/Assets/Textures/maki/building.png +0 -0
- package/Source/Assets/Textures/maki/bus.png +0 -0
- package/Source/Assets/Textures/maki/cafe.png +0 -0
- package/Source/Assets/Textures/maki/camera.png +0 -0
- package/Source/Assets/Textures/maki/campsite.png +0 -0
- package/Source/Assets/Textures/maki/car.png +0 -0
- package/Source/Assets/Textures/maki/cemetery.png +0 -0
- package/Source/Assets/Textures/maki/cesium.png +0 -0
- package/Source/Assets/Textures/maki/chemist.png +0 -0
- package/Source/Assets/Textures/maki/cinema.png +0 -0
- package/Source/Assets/Textures/maki/circle-stroked.png +0 -0
- package/Source/Assets/Textures/maki/circle.png +0 -0
- package/Source/Assets/Textures/maki/city.png +0 -0
- package/Source/Assets/Textures/maki/clothing-store.png +0 -0
- package/Source/Assets/Textures/maki/college.png +0 -0
- package/Source/Assets/Textures/maki/commercial.png +0 -0
- package/Source/Assets/Textures/maki/cricket.png +0 -0
- package/Source/Assets/Textures/maki/cross.png +0 -0
- package/Source/Assets/Textures/maki/dam.png +0 -0
- package/Source/Assets/Textures/maki/danger.png +0 -0
- package/Source/Assets/Textures/maki/disability.png +0 -0
- package/Source/Assets/Textures/maki/dog-park.png +0 -0
- package/Source/Assets/Textures/maki/embassy.png +0 -0
- package/Source/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/Source/Assets/Textures/maki/entrance.png +0 -0
- package/Source/Assets/Textures/maki/farm.png +0 -0
- package/Source/Assets/Textures/maki/fast-food.png +0 -0
- package/Source/Assets/Textures/maki/ferry.png +0 -0
- package/Source/Assets/Textures/maki/fire-station.png +0 -0
- package/Source/Assets/Textures/maki/fuel.png +0 -0
- package/Source/Assets/Textures/maki/garden.png +0 -0
- package/Source/Assets/Textures/maki/gift.png +0 -0
- package/Source/Assets/Textures/maki/golf.png +0 -0
- package/Source/Assets/Textures/maki/grocery.png +0 -0
- package/Source/Assets/Textures/maki/hairdresser.png +0 -0
- package/Source/Assets/Textures/maki/harbor.png +0 -0
- package/Source/Assets/Textures/maki/heart.png +0 -0
- package/Source/Assets/Textures/maki/heliport.png +0 -0
- package/Source/Assets/Textures/maki/hospital.png +0 -0
- package/Source/Assets/Textures/maki/ice-cream.png +0 -0
- package/Source/Assets/Textures/maki/industrial.png +0 -0
- package/Source/Assets/Textures/maki/land-use.png +0 -0
- package/Source/Assets/Textures/maki/laundry.png +0 -0
- package/Source/Assets/Textures/maki/library.png +0 -0
- package/Source/Assets/Textures/maki/lighthouse.png +0 -0
- package/Source/Assets/Textures/maki/lodging.png +0 -0
- package/Source/Assets/Textures/maki/logging.png +0 -0
- package/Source/Assets/Textures/maki/london-underground.png +0 -0
- package/Source/Assets/Textures/maki/marker-stroked.png +0 -0
- package/Source/Assets/Textures/maki/marker.png +0 -0
- package/Source/Assets/Textures/maki/minefield.png +0 -0
- package/Source/Assets/Textures/maki/mobilephone.png +0 -0
- package/Source/Assets/Textures/maki/monument.png +0 -0
- package/Source/Assets/Textures/maki/museum.png +0 -0
- package/Source/Assets/Textures/maki/music.png +0 -0
- package/Source/Assets/Textures/maki/oil-well.png +0 -0
- package/Source/Assets/Textures/maki/park.png +0 -0
- package/Source/Assets/Textures/maki/park2.png +0 -0
- package/Source/Assets/Textures/maki/parking-garage.png +0 -0
- package/Source/Assets/Textures/maki/parking.png +0 -0
- package/Source/Assets/Textures/maki/pharmacy.png +0 -0
- package/Source/Assets/Textures/maki/pitch.png +0 -0
- package/Source/Assets/Textures/maki/place-of-worship.png +0 -0
- package/Source/Assets/Textures/maki/playground.png +0 -0
- package/Source/Assets/Textures/maki/police.png +0 -0
- package/Source/Assets/Textures/maki/polling-place.png +0 -0
- package/Source/Assets/Textures/maki/post.png +0 -0
- package/Source/Assets/Textures/maki/prison.png +0 -0
- package/Source/Assets/Textures/maki/rail-above.png +0 -0
- package/Source/Assets/Textures/maki/rail-light.png +0 -0
- package/Source/Assets/Textures/maki/rail-metro.png +0 -0
- package/Source/Assets/Textures/maki/rail-underground.png +0 -0
- package/Source/Assets/Textures/maki/rail.png +0 -0
- package/Source/Assets/Textures/maki/religious-christian.png +0 -0
- package/Source/Assets/Textures/maki/religious-jewish.png +0 -0
- package/Source/Assets/Textures/maki/religious-muslim.png +0 -0
- package/Source/Assets/Textures/maki/restaurant.png +0 -0
- package/Source/Assets/Textures/maki/roadblock.png +0 -0
- package/Source/Assets/Textures/maki/rocket.png +0 -0
- package/Source/Assets/Textures/maki/school.png +0 -0
- package/Source/Assets/Textures/maki/scooter.png +0 -0
- package/Source/Assets/Textures/maki/shop.png +0 -0
- package/Source/Assets/Textures/maki/skiing.png +0 -0
- package/Source/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/Source/Assets/Textures/maki/soccer.png +0 -0
- package/Source/Assets/Textures/maki/square-stroked.png +0 -0
- package/Source/Assets/Textures/maki/square.png +0 -0
- package/Source/Assets/Textures/maki/star-stroked.png +0 -0
- package/Source/Assets/Textures/maki/star.png +0 -0
- package/Source/Assets/Textures/maki/suitcase.png +0 -0
- package/Source/Assets/Textures/maki/swimming.png +0 -0
- package/Source/Assets/Textures/maki/telephone.png +0 -0
- package/Source/Assets/Textures/maki/tennis.png +0 -0
- package/Source/Assets/Textures/maki/theatre.png +0 -0
- package/Source/Assets/Textures/maki/toilets.png +0 -0
- package/Source/Assets/Textures/maki/town-hall.png +0 -0
- package/Source/Assets/Textures/maki/town.png +0 -0
- package/Source/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/Source/Assets/Textures/maki/triangle.png +0 -0
- package/Source/Assets/Textures/maki/village.png +0 -0
- package/Source/Assets/Textures/maki/warehouse.png +0 -0
- package/Source/Assets/Textures/maki/waste-basket.png +0 -0
- package/Source/Assets/Textures/maki/water.png +0 -0
- package/Source/Assets/Textures/maki/wetland.png +0 -0
- package/Source/Assets/Textures/maki/zoo.png +0 -0
- package/Source/Assets/Textures/moonSmall.jpg +0 -0
- package/Source/Assets/Textures/pin.svg +1 -0
- package/Source/Assets/Textures/waterNormals.jpg +0 -0
- package/Source/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/Source/Assets/approximateTerrainHeights.json +1 -0
- package/Source/Core/ApproximateTerrainHeights.js +256 -0
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +728 -0
- package/Source/Core/ArcType.js +31 -0
- package/Source/Core/ArticulationStageType.js +23 -0
- package/Source/Core/AssociativeArray.js +127 -0
- package/Source/Core/AttributeCompression.js +527 -0
- package/Source/Core/AxisAlignedBoundingBox.js +259 -0
- package/Source/Core/BingMapsGeocoderService.js +107 -0
- package/Source/Core/BoundingRectangle.js +373 -0
- package/Source/Core/BoundingSphere.js +1505 -0
- package/Source/Core/BoxGeometry.js +893 -0
- package/Source/Core/BoxOutlineGeometry.js +314 -0
- package/Source/Core/Cartesian2.js +824 -0
- package/Source/Core/Cartesian3.js +1218 -0
- package/Source/Core/Cartesian4.js +980 -0
- package/Source/Core/Cartographic.js +302 -0
- package/Source/Core/CartographicGeocoderService.js +58 -0
- package/Source/Core/CatmullRomSpline.js +324 -0
- package/Source/Core/CesiumTerrainProvider.js +1318 -0
- package/Source/Core/Check.js +213 -0
- package/Source/Core/CircleGeometry.js +203 -0
- package/Source/Core/CircleOutlineGeometry.js +149 -0
- package/Source/Core/Clock.js +319 -0
- package/Source/Core/ClockRange.js +39 -0
- package/Source/Core/ClockStep.js +38 -0
- package/Source/Core/Color.js +2263 -0
- package/Source/Core/ColorGeometryInstanceAttribute.js +182 -0
- package/Source/Core/ComponentDatatype.js +340 -0
- package/Source/Core/CompressedTextureBuffer.js +114 -0
- package/Source/Core/ConstantSpline.js +119 -0
- package/Source/Core/CoplanarPolygonGeometry.js +599 -0
- package/Source/Core/CoplanarPolygonGeometryLibrary.js +132 -0
- package/Source/Core/CoplanarPolygonOutlineGeometry.js +237 -0
- package/Source/Core/CornerType.js +37 -0
- package/Source/Core/CorridorGeometry.js +1416 -0
- package/Source/Core/CorridorGeometryLibrary.js +501 -0
- package/Source/Core/CorridorOutlineGeometry.js +604 -0
- package/Source/Core/Credit.js +166 -0
- package/Source/Core/CubicRealPolynomial.js +238 -0
- package/Source/Core/CullingVolume.js +217 -0
- package/Source/Core/CustomHeightmapTerrainProvider.js +299 -0
- package/Source/Core/CylinderGeometry.js +479 -0
- package/Source/Core/CylinderGeometryLibrary.js +59 -0
- package/Source/Core/CylinderOutlineGeometry.js +269 -0
- package/Source/Core/DefaultProxy.js +26 -0
- package/Source/Core/DeveloperError.js +75 -0
- package/Source/Core/DistanceDisplayCondition.js +172 -0
- package/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js +181 -0
- package/Source/Core/DoubleEndedPriorityQueue.js +405 -0
- package/Source/Core/DoublyLinkedList.js +112 -0
- package/Source/Core/EarthOrientationParameters.js +431 -0
- package/Source/Core/EarthOrientationParametersSample.js +52 -0
- package/Source/Core/EasingFunction.js +257 -0
- package/Source/Core/EllipseGeometry.js +1325 -0
- package/Source/Core/EllipseGeometryLibrary.js +365 -0
- package/Source/Core/EllipseOutlineGeometry.js +454 -0
- package/Source/Core/Ellipsoid.js +804 -0
- package/Source/Core/EllipsoidGeodesic.js +523 -0
- package/Source/Core/EllipsoidGeometry.js +649 -0
- package/Source/Core/EllipsoidOutlineGeometry.js +464 -0
- package/Source/Core/EllipsoidRhumbLine.js +745 -0
- package/Source/Core/EllipsoidTangentPlane.js +383 -0
- package/Source/Core/EllipsoidTerrainProvider.js +230 -0
- package/Source/Core/EllipsoidalOccluder.js +559 -0
- package/Source/Core/EncodedCartesian3.js +170 -0
- package/Source/Core/Event.js +164 -0
- package/Source/Core/EventHelper.js +74 -0
- package/Source/Core/ExtrapolationType.js +34 -0
- package/Source/Core/FeatureDetection.js +411 -0
- package/Source/Core/FrustumGeometry.js +583 -0
- package/Source/Core/FrustumOutlineGeometry.js +254 -0
- package/Source/Core/Fullscreen.js +249 -0
- package/Source/Core/GeocodeType.js +24 -0
- package/Source/Core/GeocoderService.js +29 -0
- package/Source/Core/GeographicProjection.js +105 -0
- package/Source/Core/GeographicTilingScheme.js +251 -0
- package/Source/Core/Geometry.js +376 -0
- package/Source/Core/GeometryAttribute.js +138 -0
- package/Source/Core/GeometryAttributes.js +88 -0
- package/Source/Core/GeometryFactory.js +25 -0
- package/Source/Core/GeometryInstance.js +121 -0
- package/Source/Core/GeometryInstanceAttribute.js +138 -0
- package/Source/Core/GeometryOffsetAttribute.js +10 -0
- package/Source/Core/GeometryPipeline.js +3296 -0
- package/Source/Core/GeometryType.js +10 -0
- package/Source/Core/GoogleEarthEnterpriseMetadata.js +597 -0
- package/Source/Core/GoogleEarthEnterpriseTerrainData.js +607 -0
- package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +641 -0
- package/Source/Core/GoogleEarthEnterpriseTileInformation.js +136 -0
- package/Source/Core/GregorianDate.js +69 -0
- package/Source/Core/GroundPolylineGeometry.js +1658 -0
- package/Source/Core/HeadingPitchRange.js +60 -0
- package/Source/Core/HeadingPitchRoll.js +236 -0
- package/Source/Core/Heap.js +234 -0
- package/Source/Core/HeightmapEncoding.js +25 -0
- package/Source/Core/HeightmapTerrainData.js +925 -0
- package/Source/Core/HeightmapTessellator.js +535 -0
- package/Source/Core/HermitePolynomialApproximation.js +342 -0
- package/Source/Core/HermiteSpline.js +620 -0
- package/Source/Core/HilbertOrder.js +118 -0
- package/Source/Core/Iau2000Orientation.js +167 -0
- package/Source/Core/Iau2006XysData.js +277 -0
- package/Source/Core/Iau2006XysSample.js +32 -0
- package/Source/Core/IauOrientationAxes.js +105 -0
- package/Source/Core/IauOrientationParameters.js +54 -0
- package/Source/Core/IndexDatatype.js +199 -0
- package/Source/Core/InterpolationAlgorithm.js +65 -0
- package/Source/Core/InterpolationType.js +14 -0
- package/Source/Core/Intersect.js +34 -0
- package/Source/Core/IntersectionTests.js +1047 -0
- package/Source/Core/Intersections2D.js +358 -0
- package/Source/Core/Interval.js +25 -0
- package/Source/Core/Ion.js +57 -0
- package/Source/Core/IonGeocoderService.js +64 -0
- package/Source/Core/IonResource.js +270 -0
- package/Source/Core/Iso8601.js +54 -0
- package/Source/Core/JulianDate.js +1233 -0
- package/Source/Core/KTX2Transcoder.js +95 -0
- package/Source/Core/KeyboardEventModifier.js +32 -0
- package/Source/Core/LagrangePolynomialApproximation.js +71 -0
- package/Source/Core/LeapSecond.js +24 -0
- package/Source/Core/LinearApproximation.js +83 -0
- package/Source/Core/LinearSpline.js +166 -0
- package/Source/Core/ManagedArray.js +163 -0
- package/Source/Core/MapProjection.js +62 -0
- package/Source/Core/Math.js +1119 -0
- package/Source/Core/Matrix2.js +1092 -0
- package/Source/Core/Matrix3.js +1838 -0
- package/Source/Core/Matrix4.js +3232 -0
- package/Source/Core/MorphWeightSpline.js +161 -0
- package/Source/Core/MortonOrder.js +214 -0
- package/Source/Core/NearFarScalar.js +174 -0
- package/Source/Core/Occluder.js +732 -0
- package/Source/Core/OffsetGeometryInstanceAttribute.js +126 -0
- package/Source/Core/OpenCageGeocoderService.js +118 -0
- package/Source/Core/OrientedBoundingBox.js +1270 -0
- package/Source/Core/OrthographicFrustum.js +338 -0
- package/Source/Core/OrthographicOffCenterFrustum.js +463 -0
- package/Source/Core/Packable.js +40 -0
- package/Source/Core/PackableForInterpolation.js +43 -0
- package/Source/Core/PeliasGeocoderService.js +93 -0
- package/Source/Core/PerspectiveFrustum.js +439 -0
- package/Source/Core/PerspectiveOffCenterFrustum.js +523 -0
- package/Source/Core/PinBuilder.js +234 -0
- package/Source/Core/PixelFormat.js +493 -0
- package/Source/Core/Plane.js +312 -0
- package/Source/Core/PlaneGeometry.js +250 -0
- package/Source/Core/PlaneOutlineGeometry.js +113 -0
- package/Source/Core/PolygonGeometry.js +1436 -0
- package/Source/Core/PolygonGeometryLibrary.js +981 -0
- package/Source/Core/PolygonHierarchy.js +25 -0
- package/Source/Core/PolygonOutlineGeometry.js +692 -0
- package/Source/Core/PolygonPipeline.js +633 -0
- package/Source/Core/PolylineGeometry.js +578 -0
- package/Source/Core/PolylinePipeline.js +580 -0
- package/Source/Core/PolylineVolumeGeometry.js +417 -0
- package/Source/Core/PolylineVolumeGeometryLibrary.js +701 -0
- package/Source/Core/PolylineVolumeOutlineGeometry.js +299 -0
- package/Source/Core/PrimitiveType.js +107 -0
- package/Source/Core/Proxy.js +24 -0
- package/Source/Core/QuadraticRealPolynomial.js +147 -0
- package/Source/Core/QuantizedMeshTerrainData.js +772 -0
- package/Source/Core/QuarticRealPolynomial.js +342 -0
- package/Source/Core/Quaternion.js +1142 -0
- package/Source/Core/QuaternionSpline.js +155 -0
- package/Source/Core/Queue.js +126 -0
- package/Source/Core/Ray.js +80 -0
- package/Source/Core/Rectangle.js +982 -0
- package/Source/Core/RectangleCollisionChecker.js +95 -0
- package/Source/Core/RectangleGeometry.js +1489 -0
- package/Source/Core/RectangleGeometryLibrary.js +283 -0
- package/Source/Core/RectangleOutlineGeometry.js +537 -0
- package/Source/Core/ReferenceFrame.js +23 -0
- package/Source/Core/Request.js +192 -0
- package/Source/Core/RequestErrorEvent.js +58 -0
- package/Source/Core/RequestScheduler.js +520 -0
- package/Source/Core/RequestState.js +55 -0
- package/Source/Core/RequestType.js +39 -0
- package/Source/Core/Resource.js +2307 -0
- package/Source/Core/RuntimeError.js +65 -0
- package/Source/Core/S2Cell.js +811 -0
- package/Source/Core/ScreenSpaceEventHandler.js +1140 -0
- package/Source/Core/ScreenSpaceEventType.js +127 -0
- package/Source/Core/ShowGeometryInstanceAttribute.js +123 -0
- package/Source/Core/Simon1994PlanetaryPositions.js +682 -0
- package/Source/Core/SimplePolylineGeometry.js +457 -0
- package/Source/Core/SphereGeometry.js +118 -0
- package/Source/Core/SphereOutlineGeometry.js +120 -0
- package/Source/Core/Spherical.js +184 -0
- package/Source/Core/Spline.js +189 -0
- package/Source/Core/SteppedSpline.js +160 -0
- package/Source/Core/TaskProcessor.js +377 -0
- package/Source/Core/TerrainData.js +125 -0
- package/Source/Core/TerrainEncoding.js +607 -0
- package/Source/Core/TerrainExaggeration.js +49 -0
- package/Source/Core/TerrainMesh.js +156 -0
- package/Source/Core/TerrainProvider.js +461 -0
- package/Source/Core/TerrainQuantization.js +25 -0
- package/Source/Core/TileAvailability.js +564 -0
- package/Source/Core/TileEdge.js +14 -0
- package/Source/Core/TileProviderError.js +171 -0
- package/Source/Core/TilingScheme.js +132 -0
- package/Source/Core/TimeConstants.js +83 -0
- package/Source/Core/TimeInterval.js +438 -0
- package/Source/Core/TimeIntervalCollection.js +1136 -0
- package/Source/Core/TimeStandard.js +30 -0
- package/Source/Core/Tipsify.js +314 -0
- package/Source/Core/Transforms.js +1132 -0
- package/Source/Core/TranslationRotationScale.js +60 -0
- package/Source/Core/TridiagonalSystemSolver.js +113 -0
- package/Source/Core/TrustedServers.js +146 -0
- package/Source/Core/VRTheWorldTerrainProvider.js +450 -0
- package/Source/Core/VertexFormat.js +311 -0
- package/Source/Core/VideoSynchronizer.js +222 -0
- package/Source/Core/Visibility.js +34 -0
- package/Source/Core/VulkanConstants.js +286 -0
- package/Source/Core/WallGeometry.js +626 -0
- package/Source/Core/WallGeometryLibrary.js +212 -0
- package/Source/Core/WallOutlineGeometry.js +434 -0
- package/Source/Core/WebGLConstants.js +614 -0
- package/Source/Core/WebMercatorProjection.js +154 -0
- package/Source/Core/WebMercatorTilingScheme.js +297 -0
- package/Source/Core/WindingOrder.js +36 -0
- package/Source/Core/WireframeIndexGenerator.js +238 -0
- package/Source/Core/appendForwardSlash.js +10 -0
- package/Source/Core/arrayRemoveDuplicates.js +130 -0
- package/Source/Core/barycentricCoordinates.js +109 -0
- package/Source/Core/binarySearch.js +67 -0
- package/Source/Core/buildModuleUrl.js +151 -0
- package/Source/Core/cancelAnimationFrame.js +53 -0
- package/Source/Core/clone.js +32 -0
- package/Source/Core/combine.js +80 -0
- package/Source/Core/createGuid.js +22 -0
- package/Source/Core/createWorldTerrain.js +42 -0
- package/Source/Core/decodeGoogleEarthEnterpriseData.js +93 -0
- package/Source/Core/decodeVectorPolylinePositions.js +51 -0
- package/Source/Core/defaultValue.js +29 -0
- package/Source/Core/defer.js +44 -0
- package/Source/Core/defined.js +17 -0
- package/Source/Core/deprecationWarning.js +53 -0
- package/Source/Core/destroyObject.js +57 -0
- package/Source/Core/formatError.js +30 -0
- package/Source/Core/getAbsoluteUri.js +47 -0
- package/Source/Core/getBaseUri.js +47 -0
- package/Source/Core/getExtensionFromUri.js +38 -0
- package/Source/Core/getFilenameFromUri.js +32 -0
- package/Source/Core/getImageFromTypedArray.js +24 -0
- package/Source/Core/getImagePixels.js +43 -0
- package/Source/Core/getJsonFromTypedArray.js +21 -0
- package/Source/Core/getMagic.js +15 -0
- package/Source/Core/getStringFromTypedArray.js +166 -0
- package/Source/Core/getTimestamp.js +26 -0
- package/Source/Core/isBitSet.js +7 -0
- package/Source/Core/isBlobUri.js +22 -0
- package/Source/Core/isCrossOriginUrl.js +30 -0
- package/Source/Core/isDataUri.js +22 -0
- package/Source/Core/isLeapYear.js +23 -0
- package/Source/Core/loadAndExecuteScript.js +27 -0
- package/Source/Core/loadImageFromTypedArray.js +64 -0
- package/Source/Core/loadKTX2.js +104 -0
- package/Source/Core/mergeSort.js +111 -0
- package/Source/Core/objectToQuery.js +57 -0
- package/Source/Core/oneTimeWarning.js +52 -0
- package/Source/Core/parseResponseHeaders.js +37 -0
- package/Source/Core/pointInsideTriangle.js +39 -0
- package/Source/Core/queryToObject.js +60 -0
- package/Source/Core/requestAnimationFrame.js +83 -0
- package/Source/Core/resizeImageToNextPowerOfTwo.js +31 -0
- package/Source/Core/sampleTerrain.js +257 -0
- package/Source/Core/sampleTerrainMostDetailed.js +117 -0
- package/Source/Core/scaleToGeodeticSurface.js +147 -0
- package/Source/Core/subdivideArray.js +35 -0
- package/Source/Core/webGLConstantToGlslType.js +25 -0
- package/Source/Core/wrapFunction.js +26 -0
- package/Source/Core/writeTextToCanvas.js +222 -0
- package/Source/DataSources/BillboardGraphics.js +429 -0
- package/Source/DataSources/BillboardVisualizer.js +341 -0
- package/Source/DataSources/BoundingSphereState.js +26 -0
- package/Source/DataSources/BoxGeometryUpdater.js +325 -0
- package/Source/DataSources/BoxGraphics.js +213 -0
- package/Source/DataSources/CallbackProperty.js +111 -0
- package/Source/DataSources/Cesium3DTilesetGraphics.js +113 -0
- package/Source/DataSources/Cesium3DTilesetVisualizer.js +249 -0
- package/Source/DataSources/CheckerboardMaterialProperty.js +151 -0
- package/Source/DataSources/ColorMaterialProperty.js +106 -0
- package/Source/DataSources/CompositeEntityCollection.js +592 -0
- package/Source/DataSources/CompositeMaterialProperty.js +129 -0
- package/Source/DataSources/CompositePositionProperty.js +149 -0
- package/Source/DataSources/CompositeProperty.js +154 -0
- package/Source/DataSources/ConstantPositionProperty.js +146 -0
- package/Source/DataSources/ConstantProperty.js +116 -0
- package/Source/DataSources/CorridorGeometryUpdater.js +404 -0
- package/Source/DataSources/CorridorGraphics.js +328 -0
- package/Source/DataSources/CustomDataSource.js +173 -0
- package/Source/DataSources/CylinderGeometryUpdater.js +373 -0
- package/Source/DataSources/CylinderGraphics.js +265 -0
- package/Source/DataSources/CzmlDataSource.js +5141 -0
- package/Source/DataSources/DataSource.js +121 -0
- package/Source/DataSources/DataSourceClock.js +165 -0
- package/Source/DataSources/DataSourceCollection.js +336 -0
- package/Source/DataSources/DataSourceDisplay.js +510 -0
- package/Source/DataSources/DynamicGeometryBatch.js +56 -0
- package/Source/DataSources/DynamicGeometryUpdater.js +274 -0
- package/Source/DataSources/EllipseGeometryUpdater.js +430 -0
- package/Source/DataSources/EllipseGraphics.js +357 -0
- package/Source/DataSources/EllipsoidGeometryUpdater.js +710 -0
- package/Source/DataSources/EllipsoidGraphics.js +323 -0
- package/Source/DataSources/Entity.js +752 -0
- package/Source/DataSources/EntityCluster.js +997 -0
- package/Source/DataSources/EntityCollection.js +440 -0
- package/Source/DataSources/EntityView.js +426 -0
- package/Source/DataSources/GeoJsonDataSource.js +1064 -0
- package/Source/DataSources/GeometryUpdater.js +545 -0
- package/Source/DataSources/GeometryVisualizer.js +620 -0
- package/Source/DataSources/GpxDataSource.js +1023 -0
- package/Source/DataSources/GridMaterialProperty.js +198 -0
- package/Source/DataSources/GroundGeometryUpdater.js +232 -0
- package/Source/DataSources/ImageMaterialProperty.js +166 -0
- package/Source/DataSources/KmlCamera.js +13 -0
- package/Source/DataSources/KmlDataSource.js +4326 -0
- package/Source/DataSources/KmlLookAt.js +12 -0
- package/Source/DataSources/KmlTour.js +176 -0
- package/Source/DataSources/KmlTourFlyTo.js +109 -0
- package/Source/DataSources/KmlTourWait.js +52 -0
- package/Source/DataSources/LabelGraphics.js +430 -0
- package/Source/DataSources/LabelVisualizer.js +360 -0
- package/Source/DataSources/MaterialProperty.js +105 -0
- package/Source/DataSources/ModelGraphics.js +447 -0
- package/Source/DataSources/ModelVisualizer.js +548 -0
- package/Source/DataSources/NodeTransformationProperty.js +144 -0
- package/Source/DataSources/PathGraphics.js +163 -0
- package/Source/DataSources/PathVisualizer.js +759 -0
- package/Source/DataSources/PlaneGeometryUpdater.js +384 -0
- package/Source/DataSources/PlaneGraphics.js +210 -0
- package/Source/DataSources/PointGraphics.js +221 -0
- package/Source/DataSources/PointVisualizer.js +426 -0
- package/Source/DataSources/PolygonGeometryUpdater.js +575 -0
- package/Source/DataSources/PolygonGraphics.js +400 -0
- package/Source/DataSources/PolylineArrowMaterialProperty.js +104 -0
- package/Source/DataSources/PolylineDashMaterialProperty.js +168 -0
- package/Source/DataSources/PolylineGeometryUpdater.js +886 -0
- package/Source/DataSources/PolylineGlowMaterialProperty.js +146 -0
- package/Source/DataSources/PolylineGraphics.js +248 -0
- package/Source/DataSources/PolylineOutlineMaterialProperty.js +152 -0
- package/Source/DataSources/PolylineVisualizer.js +414 -0
- package/Source/DataSources/PolylineVolumeGeometryUpdater.js +304 -0
- package/Source/DataSources/PolylineVolumeGraphics.js +237 -0
- package/Source/DataSources/PositionProperty.js +133 -0
- package/Source/DataSources/PositionPropertyArray.js +187 -0
- package/Source/DataSources/Property.js +138 -0
- package/Source/DataSources/PropertyArray.js +147 -0
- package/Source/DataSources/PropertyBag.js +275 -0
- package/Source/DataSources/RectangleGeometryUpdater.js +422 -0
- package/Source/DataSources/RectangleGraphics.js +329 -0
- package/Source/DataSources/ReferenceProperty.js +365 -0
- package/Source/DataSources/Rotation.js +156 -0
- package/Source/DataSources/SampledPositionProperty.js +325 -0
- package/Source/DataSources/SampledProperty.js +834 -0
- package/Source/DataSources/ScaledPositionProperty.js +97 -0
- package/Source/DataSources/StaticGeometryColorBatch.js +570 -0
- package/Source/DataSources/StaticGeometryPerMaterialBatch.js +488 -0
- package/Source/DataSources/StaticGroundGeometryColorBatch.js +395 -0
- package/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js +426 -0
- package/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js +434 -0
- package/Source/DataSources/StaticOutlineGeometryBatch.js +466 -0
- package/Source/DataSources/StripeMaterialProperty.js +187 -0
- package/Source/DataSources/StripeOrientation.js +19 -0
- package/Source/DataSources/TerrainOffsetProperty.js +246 -0
- package/Source/DataSources/TimeIntervalCollectionPositionProperty.js +152 -0
- package/Source/DataSources/TimeIntervalCollectionProperty.js +136 -0
- package/Source/DataSources/VelocityOrientationProperty.js +154 -0
- package/Source/DataSources/VelocityVectorProperty.js +216 -0
- package/Source/DataSources/Visualizer.js +61 -0
- package/Source/DataSources/WallGeometryUpdater.js +275 -0
- package/Source/DataSources/WallGraphics.js +244 -0
- package/Source/DataSources/createMaterialPropertyDescriptor.js +35 -0
- package/Source/DataSources/createPropertyDescriptor.js +72 -0
- package/Source/DataSources/createRawPropertyDescriptor.js +13 -0
- package/Source/DataSources/exportKml.js +1519 -0
- package/Source/DataSources/getElement.js +26 -0
- package/Source/DataSources/heightReferenceOnEntityPropertyChanged.js +47 -0
- package/Source/Renderer/AutomaticUniforms.js +1625 -0
- package/Source/Renderer/Buffer.js +420 -0
- package/Source/Renderer/BufferUsage.js +19 -0
- package/Source/Renderer/ClearCommand.js +102 -0
- package/Source/Renderer/ComputeCommand.js +119 -0
- package/Source/Renderer/ComputeEngine.js +135 -0
- package/Source/Renderer/Context.js +1601 -0
- package/Source/Renderer/ContextLimits.js +297 -0
- package/Source/Renderer/CubeMap.js +631 -0
- package/Source/Renderer/CubeMapFace.js +361 -0
- package/Source/Renderer/DrawCommand.js +610 -0
- package/Source/Renderer/Framebuffer.js +448 -0
- package/Source/Renderer/FramebufferManager.js +497 -0
- package/Source/Renderer/MipmapHint.js +19 -0
- package/Source/Renderer/MultisampleFramebuffer.js +115 -0
- package/Source/Renderer/Pass.js +26 -0
- package/Source/Renderer/PassState.js +57 -0
- package/Source/Renderer/PixelDatatype.js +98 -0
- package/Source/Renderer/RenderState.js +996 -0
- package/Source/Renderer/Renderbuffer.js +103 -0
- package/Source/Renderer/RenderbufferFormat.js +42 -0
- package/Source/Renderer/Sampler.js +109 -0
- package/Source/Renderer/ShaderBuilder.js +593 -0
- package/Source/Renderer/ShaderCache.js +291 -0
- package/Source/Renderer/ShaderDestination.js +51 -0
- package/Source/Renderer/ShaderFunction.js +66 -0
- package/Source/Renderer/ShaderProgram.js +612 -0
- package/Source/Renderer/ShaderSource.js +519 -0
- package/Source/Renderer/ShaderStruct.js +55 -0
- package/Source/Renderer/Texture.js +1035 -0
- package/Source/Renderer/TextureCache.js +81 -0
- package/Source/Renderer/TextureMagnificationFilter.js +41 -0
- package/Source/Renderer/TextureMinificationFilter.js +94 -0
- package/Source/Renderer/TextureWrap.js +19 -0
- package/Source/Renderer/UniformState.js +1710 -0
- package/Source/Renderer/VertexArray.js +853 -0
- package/Source/Renderer/VertexArrayFacade.js +514 -0
- package/Source/Renderer/createUniform.js +419 -0
- package/Source/Renderer/createUniformArray.js +637 -0
- package/Source/Renderer/freezeRenderState.js +30 -0
- package/Source/Renderer/loadCubeMap.js +93 -0
- package/Source/Renderer/modernizeShader.js +242 -0
- package/Source/Scene/AlphaMode.js +33 -0
- package/Source/Scene/Appearance.js +204 -0
- package/Source/Scene/ArcGisMapServerImageryProvider.js +905 -0
- package/Source/Scene/AttributeType.js +200 -0
- package/Source/Scene/AutoExposure.js +387 -0
- package/Source/Scene/Axis.js +111 -0
- package/Source/Scene/B3dmParser.js +174 -0
- package/Source/Scene/BatchTable.js +636 -0
- package/Source/Scene/BatchTableHierarchy.js +556 -0
- package/Source/Scene/BatchTexture.js +574 -0
- package/Source/Scene/Billboard.js +1552 -0
- package/Source/Scene/BillboardCollection.js +2417 -0
- package/Source/Scene/BingMapsImageryProvider.js +855 -0
- package/Source/Scene/BingMapsStyle.js +93 -0
- package/Source/Scene/BlendEquation.js +53 -0
- package/Source/Scene/BlendFunction.js +129 -0
- package/Source/Scene/BlendOption.js +28 -0
- package/Source/Scene/BlendingState.js +73 -0
- package/Source/Scene/BoxEmitter.js +75 -0
- package/Source/Scene/BrdfLutGenerator.js +75 -0
- package/Source/Scene/BufferLoader.js +146 -0
- package/Source/Scene/Camera.js +3951 -0
- package/Source/Scene/CameraEventAggregator.js +565 -0
- package/Source/Scene/CameraEventType.js +47 -0
- package/Source/Scene/CameraFlightPath.js +576 -0
- package/Source/Scene/Cesium3DContentGroup.js +44 -0
- package/Source/Scene/Cesium3DTile.js +2115 -0
- package/Source/Scene/Cesium3DTileBatchTable.js +1176 -0
- package/Source/Scene/Cesium3DTileColorBlendMode.js +52 -0
- package/Source/Scene/Cesium3DTileContent.js +397 -0
- package/Source/Scene/Cesium3DTileContentFactory.js +104 -0
- package/Source/Scene/Cesium3DTileContentState.js +12 -0
- package/Source/Scene/Cesium3DTileContentType.js +160 -0
- package/Source/Scene/Cesium3DTileFeature.js +444 -0
- package/Source/Scene/Cesium3DTileFeatureTable.js +132 -0
- package/Source/Scene/Cesium3DTileOptimizationHint.js +13 -0
- package/Source/Scene/Cesium3DTileOptimizations.js +115 -0
- package/Source/Scene/Cesium3DTilePass.js +82 -0
- package/Source/Scene/Cesium3DTilePassState.js +52 -0
- package/Source/Scene/Cesium3DTilePointFeature.js +864 -0
- package/Source/Scene/Cesium3DTileRefine.js +29 -0
- package/Source/Scene/Cesium3DTileStyle.js +1475 -0
- package/Source/Scene/Cesium3DTileStyleEngine.js +78 -0
- package/Source/Scene/Cesium3DTileset.js +3158 -0
- package/Source/Scene/Cesium3DTilesetCache.js +82 -0
- package/Source/Scene/Cesium3DTilesetHeatmap.js +165 -0
- package/Source/Scene/Cesium3DTilesetMetadata.js +199 -0
- package/Source/Scene/Cesium3DTilesetMostDetailedTraversal.js +144 -0
- package/Source/Scene/Cesium3DTilesetStatistics.js +129 -0
- package/Source/Scene/Cesium3DTilesetTraversal.js +773 -0
- package/Source/Scene/CircleEmitter.js +62 -0
- package/Source/Scene/ClassificationPrimitive.js +1433 -0
- package/Source/Scene/ClassificationType.js +35 -0
- package/Source/Scene/ClippingPlane.js +184 -0
- package/Source/Scene/ClippingPlaneCollection.js +771 -0
- package/Source/Scene/CloudCollection.js +1050 -0
- package/Source/Scene/CloudType.js +33 -0
- package/Source/Scene/ColorBlendMode.js +33 -0
- package/Source/Scene/Composite3DTileContent.js +346 -0
- package/Source/Scene/ConditionsExpression.js +218 -0
- package/Source/Scene/ConeEmitter.js +62 -0
- package/Source/Scene/ContentMetadata.js +184 -0
- package/Source/Scene/CreditDisplay.js +610 -0
- package/Source/Scene/CullFace.js +33 -0
- package/Source/Scene/CumulusCloud.js +353 -0
- package/Source/Scene/DebugAppearance.js +268 -0
- package/Source/Scene/DebugCameraPrimitive.js +257 -0
- package/Source/Scene/DebugInspector.js +151 -0
- package/Source/Scene/DebugModelMatrixPrimitive.js +222 -0
- package/Source/Scene/DepthFunction.js +73 -0
- package/Source/Scene/DepthPlane.js +245 -0
- package/Source/Scene/DerivedCommand.js +433 -0
- package/Source/Scene/DeviceOrientationCameraController.js +120 -0
- package/Source/Scene/DirectionalLight.js +50 -0
- package/Source/Scene/DiscardEmptyTileImagePolicy.js +54 -0
- package/Source/Scene/DiscardMissingTileImagePolicy.js +148 -0
- package/Source/Scene/DracoLoader.js +76 -0
- package/Source/Scene/EllipsoidPrimitive.js +511 -0
- package/Source/Scene/EllipsoidSurfaceAppearance.js +282 -0
- package/Source/Scene/Empty3DTileContent.js +151 -0
- package/Source/Scene/Expression.js +2232 -0
- package/Source/Scene/ExpressionNodeType.js +25 -0
- package/Source/Scene/Fog.js +205 -0
- package/Source/Scene/FrameRateMonitor.js +384 -0
- package/Source/Scene/FrameState.js +419 -0
- package/Source/Scene/FrustumCommands.js +30 -0
- package/Source/Scene/Geometry3DTileContent.js +526 -0
- package/Source/Scene/GetFeatureInfoFormat.js +395 -0
- package/Source/Scene/Globe.js +1121 -0
- package/Source/Scene/GlobeDepth.js +378 -0
- package/Source/Scene/GlobeSurfaceShaderSet.js +413 -0
- package/Source/Scene/GlobeSurfaceTile.js +997 -0
- package/Source/Scene/GlobeSurfaceTileProvider.js +2818 -0
- package/Source/Scene/GlobeTranslucency.js +239 -0
- package/Source/Scene/GlobeTranslucencyFramebuffer.js +201 -0
- package/Source/Scene/GlobeTranslucencyState.js +1117 -0
- package/Source/Scene/GltfBufferViewLoader.js +268 -0
- package/Source/Scene/GltfDracoLoader.js +250 -0
- package/Source/Scene/GltfImageLoader.js +327 -0
- package/Source/Scene/GltfIndexBufferLoader.js +429 -0
- package/Source/Scene/GltfJsonLoader.js +301 -0
- package/Source/Scene/GltfLoader.js +2663 -0
- package/Source/Scene/GltfLoaderUtil.js +201 -0
- package/Source/Scene/GltfPipeline/ForEach.js +424 -0
- package/Source/Scene/GltfPipeline/addBuffer.js +30 -0
- package/Source/Scene/GltfPipeline/addDefaults.js +236 -0
- package/Source/Scene/GltfPipeline/addExtensionsRequired.js +24 -0
- package/Source/Scene/GltfPipeline/addExtensionsUsed.js +22 -0
- package/Source/Scene/GltfPipeline/addPipelineExtras.js +36 -0
- package/Source/Scene/GltfPipeline/addToArray.js +25 -0
- package/Source/Scene/GltfPipeline/findAccessorMinMax.js +71 -0
- package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +139 -0
- package/Source/Scene/GltfPipeline/getAccessorByteStride.js +29 -0
- package/Source/Scene/GltfPipeline/getComponentReader.js +147 -0
- package/Source/Scene/GltfPipeline/moveTechniqueRenderStates.js +138 -0
- package/Source/Scene/GltfPipeline/moveTechniquesToExtension.js +145 -0
- package/Source/Scene/GltfPipeline/numberOfComponentsForType.js +29 -0
- package/Source/Scene/GltfPipeline/parseGlb.js +122 -0
- package/Source/Scene/GltfPipeline/readAccessorPacked.js +54 -0
- package/Source/Scene/GltfPipeline/removeExtension.js +64 -0
- package/Source/Scene/GltfPipeline/removeExtensionsRequired.js +24 -0
- package/Source/Scene/GltfPipeline/removeExtensionsUsed.js +26 -0
- package/Source/Scene/GltfPipeline/removePipelineExtras.js +42 -0
- package/Source/Scene/GltfPipeline/removeUnusedElements.js +881 -0
- package/Source/Scene/GltfPipeline/updateAccessorComponentTypes.js +53 -0
- package/Source/Scene/GltfPipeline/updateVersion.js +1151 -0
- package/Source/Scene/GltfPipeline/usesExtension.js +18 -0
- package/Source/Scene/GltfStructuralMetadataLoader.js +504 -0
- package/Source/Scene/GltfTextureLoader.js +383 -0
- package/Source/Scene/GltfVertexBufferLoader.js +470 -0
- package/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +758 -0
- package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +756 -0
- package/Source/Scene/GridImageryProvider.js +436 -0
- package/Source/Scene/GroundPolylinePrimitive.js +926 -0
- package/Source/Scene/GroundPrimitive.js +1040 -0
- package/Source/Scene/GroupMetadata.js +203 -0
- package/Source/Scene/HeightReference.js +28 -0
- package/Source/Scene/HorizontalOrigin.js +41 -0
- package/Source/Scene/I3SDataProvider.js +668 -0
- package/Source/Scene/I3SFeature.js +63 -0
- package/Source/Scene/I3SField.js +255 -0
- package/Source/Scene/I3SGeometry.js +409 -0
- package/Source/Scene/I3SLayer.js +365 -0
- package/Source/Scene/I3SNode.js +816 -0
- package/Source/Scene/I3dmParser.js +141 -0
- package/Source/Scene/ImageBasedLighting.js +510 -0
- package/Source/Scene/Imagery.js +120 -0
- package/Source/Scene/ImageryLayer.js +1541 -0
- package/Source/Scene/ImageryLayerCollection.js +621 -0
- package/Source/Scene/ImageryLayerFeatureInfo.js +112 -0
- package/Source/Scene/ImageryProvider.js +387 -0
- package/Source/Scene/ImageryState.js +14 -0
- package/Source/Scene/Implicit3DTileContent.js +1154 -0
- package/Source/Scene/ImplicitAvailabilityBitstream.js +137 -0
- package/Source/Scene/ImplicitMetadataView.js +178 -0
- package/Source/Scene/ImplicitSubdivisionScheme.js +48 -0
- package/Source/Scene/ImplicitSubtree.js +1146 -0
- package/Source/Scene/ImplicitSubtreeMetadata.js +191 -0
- package/Source/Scene/ImplicitTileCoordinates.js +647 -0
- package/Source/Scene/ImplicitTileset.js +263 -0
- package/Source/Scene/InstanceAttributeSemantic.js +79 -0
- package/Source/Scene/InvertClassification.js +382 -0
- package/Source/Scene/IonImageryProvider.js +555 -0
- package/Source/Scene/IonWorldImageryStyle.js +33 -0
- package/Source/Scene/JobScheduler.js +199 -0
- package/Source/Scene/JobType.js +10 -0
- package/Source/Scene/JsonMetadataTable.js +114 -0
- package/Source/Scene/Label.js +1588 -0
- package/Source/Scene/LabelCollection.js +994 -0
- package/Source/Scene/LabelStyle.js +33 -0
- package/Source/Scene/Light.js +34 -0
- package/Source/Scene/MapMode2D.js +23 -0
- package/Source/Scene/MapboxImageryProvider.js +448 -0
- package/Source/Scene/MapboxStyleImageryProvider.js +457 -0
- package/Source/Scene/Material.js +1742 -0
- package/Source/Scene/MaterialAppearance.js +334 -0
- package/Source/Scene/MetadataClass.js +167 -0
- package/Source/Scene/MetadataClassProperty.js +1104 -0
- package/Source/Scene/MetadataComponentType.js +448 -0
- package/Source/Scene/MetadataEntity.js +425 -0
- package/Source/Scene/MetadataEnum.js +186 -0
- package/Source/Scene/MetadataEnumValue.js +97 -0
- package/Source/Scene/MetadataSchema.js +173 -0
- package/Source/Scene/MetadataSchemaLoader.js +145 -0
- package/Source/Scene/MetadataSemantic.js +145 -0
- package/Source/Scene/MetadataTable.js +357 -0
- package/Source/Scene/MetadataTableProperty.js +859 -0
- package/Source/Scene/MetadataType.js +208 -0
- package/Source/Scene/Model/AlphaPipelineStage.js +52 -0
- package/Source/Scene/Model/B3dmLoader.js +379 -0
- package/Source/Scene/Model/BatchTexturePipelineStage.js +72 -0
- package/Source/Scene/Model/CPUStylingPipelineStage.js +77 -0
- package/Source/Scene/Model/ClassificationModelDrawCommand.js +533 -0
- package/Source/Scene/Model/ClassificationPipelineStage.js +132 -0
- package/Source/Scene/Model/CustomShader.js +473 -0
- package/Source/Scene/Model/CustomShaderMode.js +40 -0
- package/Source/Scene/Model/CustomShaderPipelineStage.js +654 -0
- package/Source/Scene/Model/CustomShaderTranslucencyMode.js +35 -0
- package/Source/Scene/Model/DequantizationPipelineStage.js +178 -0
- package/Source/Scene/Model/FeatureIdPipelineStage.js +504 -0
- package/Source/Scene/Model/GeoJsonLoader.js +722 -0
- package/Source/Scene/Model/GeometryPipelineStage.js +558 -0
- package/Source/Scene/Model/I3dmLoader.js +909 -0
- package/Source/Scene/Model/ImageBasedLightingPipelineStage.js +147 -0
- package/Source/Scene/Model/InstancingPipelineStage.js +1043 -0
- package/Source/Scene/Model/LightingModel.js +30 -0
- package/Source/Scene/Model/LightingPipelineStage.js +75 -0
- package/Source/Scene/Model/MaterialPipelineStage.js +510 -0
- package/Source/Scene/Model/MetadataPipelineStage.js +638 -0
- package/Source/Scene/Model/Model.js +2847 -0
- package/Source/Scene/Model/Model3DTileContent.js +451 -0
- package/Source/Scene/Model/ModelAlphaOptions.js +26 -0
- package/Source/Scene/Model/ModelAnimation.js +422 -0
- package/Source/Scene/Model/ModelAnimationChannel.js +293 -0
- package/Source/Scene/Model/ModelAnimationCollection.js +553 -0
- package/Source/Scene/Model/ModelArticulation.js +214 -0
- package/Source/Scene/Model/ModelArticulationStage.js +261 -0
- package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +126 -0
- package/Source/Scene/Model/ModelColorPipelineStage.js +99 -0
- package/Source/Scene/Model/ModelDrawCommand.js +864 -0
- package/Source/Scene/Model/ModelFeature.js +229 -0
- package/Source/Scene/Model/ModelFeatureTable.js +322 -0
- package/Source/Scene/Model/ModelLightingOptions.js +29 -0
- package/Source/Scene/Model/ModelMatrixUpdateStage.js +108 -0
- package/Source/Scene/Model/ModelNode.js +125 -0
- package/Source/Scene/Model/ModelRenderResources.js +106 -0
- package/Source/Scene/Model/ModelRuntimeNode.js +648 -0
- package/Source/Scene/Model/ModelRuntimePrimitive.js +340 -0
- package/Source/Scene/Model/ModelSceneGraph.js +968 -0
- package/Source/Scene/Model/ModelSilhouettePipelineStage.js +109 -0
- package/Source/Scene/Model/ModelSkin.js +180 -0
- package/Source/Scene/Model/ModelSplitterPipelineStage.js +66 -0
- package/Source/Scene/Model/ModelStatistics.js +197 -0
- package/Source/Scene/Model/ModelType.js +94 -0
- package/Source/Scene/Model/ModelUtility.js +386 -0
- package/Source/Scene/Model/MorphTargetsPipelineStage.js +249 -0
- package/Source/Scene/Model/NodeRenderResources.js +160 -0
- package/Source/Scene/Model/NodeStatisticsPipelineStage.js +75 -0
- package/Source/Scene/Model/PickingPipelineStage.js +219 -0
- package/Source/Scene/Model/PntsLoader.js +717 -0
- package/Source/Scene/Model/PointCloudStylingPipelineStage.js +396 -0
- package/Source/Scene/Model/PrimitiveOutlineGenerator.js +689 -0
- package/Source/Scene/Model/PrimitiveOutlinePipelineStage.js +99 -0
- package/Source/Scene/Model/PrimitiveRenderResources.js +297 -0
- package/Source/Scene/Model/PrimitiveStatisticsPipelineStage.js +253 -0
- package/Source/Scene/Model/SceneMode2DPipelineStage.js +301 -0
- package/Source/Scene/Model/SelectedFeatureIdPipelineStage.js +185 -0
- package/Source/Scene/Model/SkinningPipelineStage.js +118 -0
- package/Source/Scene/Model/StyleCommandsNeeded.js +29 -0
- package/Source/Scene/Model/TextureManager.js +244 -0
- package/Source/Scene/Model/TextureUniform.js +74 -0
- package/Source/Scene/Model/TilesetPipelineStage.js +73 -0
- package/Source/Scene/Model/UniformType.js +124 -0
- package/Source/Scene/Model/VaryingType.js +61 -0
- package/Source/Scene/Model/WireframePipelineStage.js +118 -0
- package/Source/Scene/Model/buildDrawCommand.js +153 -0
- package/Source/Scene/ModelAnimationLoop.js +33 -0
- package/Source/Scene/ModelAnimationState.js +9 -0
- package/Source/Scene/ModelComponents.js +1466 -0
- package/Source/Scene/Moon.js +174 -0
- package/Source/Scene/Multiple3DTileContent.js +674 -0
- package/Source/Scene/NeverTileDiscardPolicy.js +28 -0
- package/Source/Scene/OIT.js +893 -0
- package/Source/Scene/OctahedralProjectedCubeMap.js +456 -0
- package/Source/Scene/OpenStreetMapImageryProvider.js +124 -0
- package/Source/Scene/OrderedGroundPrimitiveCollection.js +219 -0
- package/Source/Scene/Particle.js +155 -0
- package/Source/Scene/ParticleBurst.js +51 -0
- package/Source/Scene/ParticleEmitter.js +36 -0
- package/Source/Scene/ParticleSystem.js +910 -0
- package/Source/Scene/PerInstanceColorAppearance.js +296 -0
- package/Source/Scene/PerformanceDisplay.js +120 -0
- package/Source/Scene/PickDepth.js +105 -0
- package/Source/Scene/PickDepthFramebuffer.js +79 -0
- package/Source/Scene/PickFramebuffer.js +125 -0
- package/Source/Scene/Picking.js +1316 -0
- package/Source/Scene/PntsParser.js +480 -0
- package/Source/Scene/PointCloud.js +1425 -0
- package/Source/Scene/PointCloudEyeDomeLighting.js +279 -0
- package/Source/Scene/PointCloudShading.js +113 -0
- package/Source/Scene/PointPrimitive.js +668 -0
- package/Source/Scene/PointPrimitiveCollection.js +1217 -0
- package/Source/Scene/Polyline.js +431 -0
- package/Source/Scene/PolylineCollection.js +1962 -0
- package/Source/Scene/PolylineColorAppearance.js +224 -0
- package/Source/Scene/PolylineMaterialAppearance.js +236 -0
- package/Source/Scene/PostProcessStage.js +1023 -0
- package/Source/Scene/PostProcessStageCollection.js +888 -0
- package/Source/Scene/PostProcessStageComposite.js +362 -0
- package/Source/Scene/PostProcessStageLibrary.js +838 -0
- package/Source/Scene/PostProcessStageSampleMode.js +22 -0
- package/Source/Scene/PostProcessStageTextureCache.js +454 -0
- package/Source/Scene/Primitive.js +2536 -0
- package/Source/Scene/PrimitiveCollection.js +467 -0
- package/Source/Scene/PrimitiveLoadPlan.js +280 -0
- package/Source/Scene/PrimitivePipeline.js +855 -0
- package/Source/Scene/PrimitiveState.js +13 -0
- package/Source/Scene/PropertyAttribute.js +160 -0
- package/Source/Scene/PropertyAttributeProperty.js +165 -0
- package/Source/Scene/PropertyTable.js +541 -0
- package/Source/Scene/PropertyTexture.js +162 -0
- package/Source/Scene/PropertyTextureProperty.js +263 -0
- package/Source/Scene/QuadtreeOccluders.js +30 -0
- package/Source/Scene/QuadtreePrimitive.js +1546 -0
- package/Source/Scene/QuadtreeTile.js +539 -0
- package/Source/Scene/QuadtreeTileLoadState.js +39 -0
- package/Source/Scene/QuadtreeTileProvider.js +226 -0
- package/Source/Scene/ResourceCache.js +810 -0
- package/Source/Scene/ResourceCacheKey.js +567 -0
- package/Source/Scene/ResourceCacheStatistics.js +183 -0
- package/Source/Scene/ResourceLoader.js +139 -0
- package/Source/Scene/ResourceLoaderState.js +48 -0
- package/Source/Scene/SDFSettings.js +39 -0
- package/Source/Scene/Scene.js +4498 -0
- package/Source/Scene/SceneFramebuffer.js +106 -0
- package/Source/Scene/SceneMode.js +56 -0
- package/Source/Scene/SceneTransforms.js +466 -0
- package/Source/Scene/SceneTransitioner.js +1111 -0
- package/Source/Scene/ScreenSpaceCameraController.js +2933 -0
- package/Source/Scene/ShadowMap.js +1958 -0
- package/Source/Scene/ShadowMapShader.js +395 -0
- package/Source/Scene/ShadowMode.js +78 -0
- package/Source/Scene/ShadowVolumeAppearance.js +937 -0
- package/Source/Scene/SingleTileImageryProvider.js +501 -0
- package/Source/Scene/SkyAtmosphere.js +402 -0
- package/Source/Scene/SkyBox.js +252 -0
- package/Source/Scene/SphereEmitter.js +66 -0
- package/Source/Scene/SplitDirection.js +34 -0
- package/Source/Scene/Splitter.js +49 -0
- package/Source/Scene/StencilConstants.js +37 -0
- package/Source/Scene/StencilFunction.js +73 -0
- package/Source/Scene/StencilOperation.js +73 -0
- package/Source/Scene/StructuralMetadata.js +243 -0
- package/Source/Scene/StyleExpression.js +86 -0
- package/Source/Scene/Sun.js +359 -0
- package/Source/Scene/SunLight.js +31 -0
- package/Source/Scene/SunPostProcess.js +288 -0
- package/Source/Scene/SupportedImageFormats.js +18 -0
- package/Source/Scene/TerrainFillMesh.js +2220 -0
- package/Source/Scene/TerrainState.js +13 -0
- package/Source/Scene/TextureAtlas.js +556 -0
- package/Source/Scene/TileBoundingRegion.js +490 -0
- package/Source/Scene/TileBoundingS2Cell.js +703 -0
- package/Source/Scene/TileBoundingSphere.js +167 -0
- package/Source/Scene/TileBoundingVolume.js +68 -0
- package/Source/Scene/TileCoordinatesImageryProvider.js +379 -0
- package/Source/Scene/TileDiscardPolicy.js +34 -0
- package/Source/Scene/TileImagery.js +130 -0
- package/Source/Scene/TileMapServiceImageryProvider.js +403 -0
- package/Source/Scene/TileMetadata.js +184 -0
- package/Source/Scene/TileOrientedBoundingBox.js +219 -0
- package/Source/Scene/TileReplacementQueue.js +119 -0
- package/Source/Scene/TileSelectionResult.js +80 -0
- package/Source/Scene/TileState.js +10 -0
- package/Source/Scene/Tileset3DTileContent.js +158 -0
- package/Source/Scene/TilesetMetadata.js +186 -0
- package/Source/Scene/TimeDynamicImagery.js +308 -0
- package/Source/Scene/TimeDynamicPointCloud.js +819 -0
- package/Source/Scene/Tonemapper.js +52 -0
- package/Source/Scene/TranslucentTileClassification.js +524 -0
- package/Source/Scene/TweenCollection.js +588 -0
- package/Source/Scene/UrlTemplateImageryProvider.js +1240 -0
- package/Source/Scene/Vector3DTileBatch.js +37 -0
- package/Source/Scene/Vector3DTileClampedPolylines.js +772 -0
- package/Source/Scene/Vector3DTileContent.js +774 -0
- package/Source/Scene/Vector3DTileGeometry.js +490 -0
- package/Source/Scene/Vector3DTilePoints.js +529 -0
- package/Source/Scene/Vector3DTilePolygons.js +479 -0
- package/Source/Scene/Vector3DTilePolylines.js +676 -0
- package/Source/Scene/Vector3DTilePrimitive.js +1282 -0
- package/Source/Scene/VertexAttributeSemantic.js +273 -0
- package/Source/Scene/VerticalOrigin.js +49 -0
- package/Source/Scene/View.js +431 -0
- package/Source/Scene/ViewportQuad.js +182 -0
- package/Source/Scene/WebMapServiceImageryProvider.js +768 -0
- package/Source/Scene/WebMapTileServiceImageryProvider.js +711 -0
- package/Source/Scene/computeFlyToLocationForRectangle.js +69 -0
- package/Source/Scene/createBillboardPointCallback.js +70 -0
- package/Source/Scene/createElevationBandMaterial.js +585 -0
- package/Source/Scene/createOsmBuildings.js +75 -0
- package/Source/Scene/createTangentSpaceDebugPrimitive.js +116 -0
- package/Source/Scene/createWorldImagery.js +38 -0
- package/Source/Scene/findContentMetadata.js +54 -0
- package/Source/Scene/findGroupMetadata.js +39 -0
- package/Source/Scene/findTileMetadata.js +56 -0
- package/Source/Scene/getBinaryAccessor.js +56 -0
- package/Source/Scene/getClipAndStyleCode.js +34 -0
- package/Source/Scene/getClippingFunction.js +163 -0
- package/Source/Scene/hasExtension.js +19 -0
- package/Source/Scene/parseBatchTable.js +439 -0
- package/Source/Scene/parseBoundingVolumeSemantics.js +121 -0
- package/Source/Scene/parseFeatureMetadataLegacy.js +139 -0
- package/Source/Scene/parseStructuralMetadata.js +102 -0
- package/Source/Scene/preprocess3DTileContent.js +94 -0
- package/Source/Shaders/AdjustTranslucentFS.glsl +24 -0
- package/Source/Shaders/AdjustTranslucentFS.js +26 -0
- package/Source/Shaders/Appearances/AllMaterialAppearanceFS.glsl +29 -0
- package/Source/Shaders/Appearances/AllMaterialAppearanceFS.js +31 -0
- package/Source/Shaders/Appearances/AllMaterialAppearanceVS.glsl +26 -0
- package/Source/Shaders/Appearances/AllMaterialAppearanceVS.js +28 -0
- package/Source/Shaders/Appearances/BasicMaterialAppearanceFS.glsl +23 -0
- package/Source/Shaders/Appearances/BasicMaterialAppearanceFS.js +25 -0
- package/Source/Shaders/Appearances/BasicMaterialAppearanceVS.glsl +17 -0
- package/Source/Shaders/Appearances/BasicMaterialAppearanceVS.js +19 -0
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.glsl +33 -0
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.js +35 -0
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.glsl +19 -0
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.js +21 -0
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceFS.glsl +24 -0
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceFS.js +26 -0
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceVS.glsl +20 -0
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceVS.js +22 -0
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.glsl +6 -0
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js +8 -0
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.glsl +15 -0
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.js +17 -0
- package/Source/Shaders/Appearances/PolylineColorAppearanceVS.glsl +28 -0
- package/Source/Shaders/Appearances/PolylineColorAppearanceVS.js +30 -0
- package/Source/Shaders/Appearances/PolylineMaterialAppearanceVS.glsl +33 -0
- package/Source/Shaders/Appearances/PolylineMaterialAppearanceVS.js +35 -0
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceFS.glsl +25 -0
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceFS.js +27 -0
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceVS.glsl +20 -0
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceVS.js +22 -0
- package/Source/Shaders/AtmosphereCommon.glsl +152 -0
- package/Source/Shaders/AtmosphereCommon.js +154 -0
- package/Source/Shaders/BillboardCollectionFS.glsl +208 -0
- package/Source/Shaders/BillboardCollectionFS.js +210 -0
- package/Source/Shaders/BillboardCollectionVS.glsl +434 -0
- package/Source/Shaders/BillboardCollectionVS.js +436 -0
- package/Source/Shaders/BrdfLutGeneratorFS.glsl +83 -0
- package/Source/Shaders/BrdfLutGeneratorFS.js +85 -0
- package/Source/Shaders/Builtin/Constants/degreesPerRadian.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/degreesPerRadian.js +18 -0
- package/Source/Shaders/Builtin/Constants/depthRange.glsl +14 -0
- package/Source/Shaders/Builtin/Constants/depthRange.js +16 -0
- package/Source/Shaders/Builtin/Constants/epsilon1.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon1.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon2.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon2.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon3.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon3.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon4.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon4.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon5.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon5.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon6.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon6.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon7.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon7.js +9 -0
- package/Source/Shaders/Builtin/Constants/infinity.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/infinity.js +9 -0
- package/Source/Shaders/Builtin/Constants/oneOverPi.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/oneOverPi.js +18 -0
- package/Source/Shaders/Builtin/Constants/oneOverTwoPi.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/oneOverTwoPi.js +18 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +11 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +11 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +11 -0
- package/Source/Shaders/Builtin/Constants/passClassification.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passClassification.js +11 -0
- package/Source/Shaders/Builtin/Constants/passCompute.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCompute.js +11 -0
- package/Source/Shaders/Builtin/Constants/passEnvironment.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passEnvironment.js +11 -0
- package/Source/Shaders/Builtin/Constants/passGlobe.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passGlobe.js +11 -0
- package/Source/Shaders/Builtin/Constants/passOpaque.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passOpaque.js +11 -0
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passOverlay.js +11 -0
- package/Source/Shaders/Builtin/Constants/passTerrainClassification.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passTerrainClassification.js +11 -0
- package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passTranslucent.js +11 -0
- package/Source/Shaders/Builtin/Constants/pi.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/pi.js +18 -0
- package/Source/Shaders/Builtin/Constants/piOverFour.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/piOverFour.js +18 -0
- package/Source/Shaders/Builtin/Constants/piOverSix.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/piOverSix.js +18 -0
- package/Source/Shaders/Builtin/Constants/piOverThree.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/piOverThree.js +18 -0
- package/Source/Shaders/Builtin/Constants/piOverTwo.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/piOverTwo.js +18 -0
- package/Source/Shaders/Builtin/Constants/radiansPerDegree.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/radiansPerDegree.js +18 -0
- package/Source/Shaders/Builtin/Constants/sceneMode2D.glsl +11 -0
- package/Source/Shaders/Builtin/Constants/sceneMode2D.js +13 -0
- package/Source/Shaders/Builtin/Constants/sceneMode3D.glsl +11 -0
- package/Source/Shaders/Builtin/Constants/sceneMode3D.js +13 -0
- package/Source/Shaders/Builtin/Constants/sceneModeColumbusView.glsl +11 -0
- package/Source/Shaders/Builtin/Constants/sceneModeColumbusView.js +13 -0
- package/Source/Shaders/Builtin/Constants/sceneModeMorphing.glsl +11 -0
- package/Source/Shaders/Builtin/Constants/sceneModeMorphing.js +13 -0
- package/Source/Shaders/Builtin/Constants/solarRadius.glsl +13 -0
- package/Source/Shaders/Builtin/Constants/solarRadius.js +15 -0
- package/Source/Shaders/Builtin/Constants/threePiOver2.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/threePiOver2.js +18 -0
- package/Source/Shaders/Builtin/Constants/twoPi.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/twoPi.js +18 -0
- package/Source/Shaders/Builtin/Constants/webMercatorMaxLatitude.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/webMercatorMaxLatitude.js +18 -0
- package/Source/Shaders/Builtin/CzmBuiltins.js +262 -0
- package/Source/Shaders/Builtin/Functions/HSBToRGB.glsl +24 -0
- package/Source/Shaders/Builtin/Functions/HSBToRGB.js +26 -0
- package/Source/Shaders/Builtin/Functions/HSLToRGB.glsl +31 -0
- package/Source/Shaders/Builtin/Functions/HSLToRGB.js +33 -0
- package/Source/Shaders/Builtin/Functions/RGBToHSB.glsl +27 -0
- package/Source/Shaders/Builtin/Functions/RGBToHSB.js +29 -0
- package/Source/Shaders/Builtin/Functions/RGBToHSL.glsl +34 -0
- package/Source/Shaders/Builtin/Functions/RGBToHSL.js +36 -0
- package/Source/Shaders/Builtin/Functions/RGBToXYZ.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/RGBToXYZ.js +32 -0
- package/Source/Shaders/Builtin/Functions/XYZToRGB.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/XYZToRGB.js +32 -0
- package/Source/Shaders/Builtin/Functions/acesTonemapping.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/acesTonemapping.js +18 -0
- package/Source/Shaders/Builtin/Functions/alphaWeight.glsl +11 -0
- package/Source/Shaders/Builtin/Functions/alphaWeight.js +13 -0
- package/Source/Shaders/Builtin/Functions/antialias.glsl +39 -0
- package/Source/Shaders/Builtin/Functions/antialias.js +41 -0
- package/Source/Shaders/Builtin/Functions/approximateSphericalCoordinates.glsl +18 -0
- package/Source/Shaders/Builtin/Functions/approximateSphericalCoordinates.js +20 -0
- package/Source/Shaders/Builtin/Functions/backFacing.glsl +13 -0
- package/Source/Shaders/Builtin/Functions/backFacing.js +15 -0
- package/Source/Shaders/Builtin/Functions/branchFreeTernary.glsl +71 -0
- package/Source/Shaders/Builtin/Functions/branchFreeTernary.js +73 -0
- package/Source/Shaders/Builtin/Functions/cascadeColor.glsl +8 -0
- package/Source/Shaders/Builtin/Functions/cascadeColor.js +10 -0
- package/Source/Shaders/Builtin/Functions/cascadeDistance.glsl +7 -0
- package/Source/Shaders/Builtin/Functions/cascadeDistance.js +9 -0
- package/Source/Shaders/Builtin/Functions/cascadeMatrix.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/cascadeMatrix.js +12 -0
- package/Source/Shaders/Builtin/Functions/cascadeWeights.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/cascadeWeights.js +12 -0
- package/Source/Shaders/Builtin/Functions/columbusViewMorph.glsl +12 -0
- package/Source/Shaders/Builtin/Functions/columbusViewMorph.js +14 -0
- package/Source/Shaders/Builtin/Functions/computePosition.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/computePosition.js +24 -0
- package/Source/Shaders/Builtin/Functions/cosineAndSine.glsl +211 -0
- package/Source/Shaders/Builtin/Functions/cosineAndSine.js +213 -0
- package/Source/Shaders/Builtin/Functions/decompressTextureCoordinates.glsl +17 -0
- package/Source/Shaders/Builtin/Functions/decompressTextureCoordinates.js +19 -0
- package/Source/Shaders/Builtin/Functions/defaultPbrMaterial.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/defaultPbrMaterial.js +18 -0
- package/Source/Shaders/Builtin/Functions/depthClamp.glsl +47 -0
- package/Source/Shaders/Builtin/Functions/depthClamp.js +49 -0
- package/Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.glsl +33 -0
- package/Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.js +35 -0
- package/Source/Shaders/Builtin/Functions/ellipsoidContainsPoint.glsl +12 -0
- package/Source/Shaders/Builtin/Functions/ellipsoidContainsPoint.js +14 -0
- package/Source/Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates.js +12 -0
- package/Source/Shaders/Builtin/Functions/equalsEpsilon.glsl +36 -0
- package/Source/Shaders/Builtin/Functions/equalsEpsilon.js +38 -0
- package/Source/Shaders/Builtin/Functions/eyeOffset.glsl +20 -0
- package/Source/Shaders/Builtin/Functions/eyeOffset.js +22 -0
- package/Source/Shaders/Builtin/Functions/eyeToWindowCoordinates.glsl +32 -0
- package/Source/Shaders/Builtin/Functions/eyeToWindowCoordinates.js +34 -0
- package/Source/Shaders/Builtin/Functions/fastApproximateAtan.glsl +55 -0
- package/Source/Shaders/Builtin/Functions/fastApproximateAtan.js +57 -0
- package/Source/Shaders/Builtin/Functions/fog.glsl +38 -0
- package/Source/Shaders/Builtin/Functions/fog.js +40 -0
- package/Source/Shaders/Builtin/Functions/gammaCorrect.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/gammaCorrect.js +24 -0
- package/Source/Shaders/Builtin/Functions/geodeticSurfaceNormal.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/geodeticSurfaceNormal.js +18 -0
- package/Source/Shaders/Builtin/Functions/getDefaultMaterial.glsl +27 -0
- package/Source/Shaders/Builtin/Functions/getDefaultMaterial.js +29 -0
- package/Source/Shaders/Builtin/Functions/getLambertDiffuse.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/getLambertDiffuse.js +24 -0
- package/Source/Shaders/Builtin/Functions/getSpecular.glsl +29 -0
- package/Source/Shaders/Builtin/Functions/getSpecular.js +31 -0
- package/Source/Shaders/Builtin/Functions/getWaterNoise.glsl +37 -0
- package/Source/Shaders/Builtin/Functions/getWaterNoise.js +39 -0
- package/Source/Shaders/Builtin/Functions/hue.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/hue.js +32 -0
- package/Source/Shaders/Builtin/Functions/inverseGamma.glsl +12 -0
- package/Source/Shaders/Builtin/Functions/inverseGamma.js +14 -0
- package/Source/Shaders/Builtin/Functions/isEmpty.glsl +19 -0
- package/Source/Shaders/Builtin/Functions/isEmpty.js +21 -0
- package/Source/Shaders/Builtin/Functions/isFull.glsl +19 -0
- package/Source/Shaders/Builtin/Functions/isFull.js +21 -0
- package/Source/Shaders/Builtin/Functions/latitudeToWebMercatorFraction.glsl +21 -0
- package/Source/Shaders/Builtin/Functions/latitudeToWebMercatorFraction.js +23 -0
- package/Source/Shaders/Builtin/Functions/lineDistance.glsl +14 -0
- package/Source/Shaders/Builtin/Functions/lineDistance.js +16 -0
- package/Source/Shaders/Builtin/Functions/linearToSrgb.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/linearToSrgb.js +18 -0
- package/Source/Shaders/Builtin/Functions/luminance.glsl +20 -0
- package/Source/Shaders/Builtin/Functions/luminance.js +22 -0
- package/Source/Shaders/Builtin/Functions/metersPerPixel.glsl +61 -0
- package/Source/Shaders/Builtin/Functions/metersPerPixel.js +63 -0
- package/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.glsl +37 -0
- package/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.js +39 -0
- package/Source/Shaders/Builtin/Functions/multiplyWithColorBalance.glsl +18 -0
- package/Source/Shaders/Builtin/Functions/multiplyWithColorBalance.js +20 -0
- package/Source/Shaders/Builtin/Functions/nearFarScalar.glsl +26 -0
- package/Source/Shaders/Builtin/Functions/nearFarScalar.js +28 -0
- package/Source/Shaders/Builtin/Functions/octDecode.glsl +83 -0
- package/Source/Shaders/Builtin/Functions/octDecode.js +85 -0
- package/Source/Shaders/Builtin/Functions/packDepth.glsl +18 -0
- package/Source/Shaders/Builtin/Functions/packDepth.js +20 -0
- package/Source/Shaders/Builtin/Functions/pbrLighting.glsl +99 -0
- package/Source/Shaders/Builtin/Functions/pbrLighting.js +101 -0
- package/Source/Shaders/Builtin/Functions/pbrMetallicRoughnessMaterial.glsl +37 -0
- package/Source/Shaders/Builtin/Functions/pbrMetallicRoughnessMaterial.js +39 -0
- package/Source/Shaders/Builtin/Functions/pbrSpecularGlossinessMaterial.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/pbrSpecularGlossinessMaterial.js +32 -0
- package/Source/Shaders/Builtin/Functions/phong.glsl +63 -0
- package/Source/Shaders/Builtin/Functions/phong.js +65 -0
- package/Source/Shaders/Builtin/Functions/planeDistance.glsl +28 -0
- package/Source/Shaders/Builtin/Functions/planeDistance.js +30 -0
- package/Source/Shaders/Builtin/Functions/pointAlongRay.glsl +19 -0
- package/Source/Shaders/Builtin/Functions/pointAlongRay.js +21 -0
- package/Source/Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval.glsl +83 -0
- package/Source/Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval.js +85 -0
- package/Source/Shaders/Builtin/Functions/raySphereIntersectionInterval.glsl +36 -0
- package/Source/Shaders/Builtin/Functions/raySphereIntersectionInterval.js +38 -0
- package/Source/Shaders/Builtin/Functions/readDepth.glsl +4 -0
- package/Source/Shaders/Builtin/Functions/readDepth.js +6 -0
- package/Source/Shaders/Builtin/Functions/readNonPerspective.glsl +31 -0
- package/Source/Shaders/Builtin/Functions/readNonPerspective.js +33 -0
- package/Source/Shaders/Builtin/Functions/reverseLogDepth.glsl +11 -0
- package/Source/Shaders/Builtin/Functions/reverseLogDepth.js +13 -0
- package/Source/Shaders/Builtin/Functions/round.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/round.js +24 -0
- package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.glsl +78 -0
- package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.js +80 -0
- package/Source/Shaders/Builtin/Functions/saturation.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/saturation.js +24 -0
- package/Source/Shaders/Builtin/Functions/shadowDepthCompare.glsl +24 -0
- package/Source/Shaders/Builtin/Functions/shadowDepthCompare.js +26 -0
- package/Source/Shaders/Builtin/Functions/shadowVisibility.glsl +66 -0
- package/Source/Shaders/Builtin/Functions/shadowVisibility.js +68 -0
- package/Source/Shaders/Builtin/Functions/signNotZero.glsl +29 -0
- package/Source/Shaders/Builtin/Functions/signNotZero.js +31 -0
- package/Source/Shaders/Builtin/Functions/sphericalHarmonics.glsl +42 -0
- package/Source/Shaders/Builtin/Functions/sphericalHarmonics.js +44 -0
- package/Source/Shaders/Builtin/Functions/srgbToLinear.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/srgbToLinear.js +18 -0
- package/Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl +25 -0
- package/Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.js +27 -0
- package/Source/Shaders/Builtin/Functions/transformPlane.glsl +15 -0
- package/Source/Shaders/Builtin/Functions/transformPlane.js +17 -0
- package/Source/Shaders/Builtin/Functions/translateRelativeToEye.glsl +40 -0
- package/Source/Shaders/Builtin/Functions/translateRelativeToEye.js +42 -0
- package/Source/Shaders/Builtin/Functions/translucentPhong.glsl +27 -0
- package/Source/Shaders/Builtin/Functions/translucentPhong.js +29 -0
- package/Source/Shaders/Builtin/Functions/transpose.glsl +45 -0
- package/Source/Shaders/Builtin/Functions/transpose.js +47 -0
- package/Source/Shaders/Builtin/Functions/unpackDepth.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/unpackDepth.js +18 -0
- package/Source/Shaders/Builtin/Functions/unpackFloat.glsl +24 -0
- package/Source/Shaders/Builtin/Functions/unpackFloat.js +26 -0
- package/Source/Shaders/Builtin/Functions/unpackUint.glsl +31 -0
- package/Source/Shaders/Builtin/Functions/unpackUint.js +33 -0
- package/Source/Shaders/Builtin/Functions/valueTransform.glsl +38 -0
- package/Source/Shaders/Builtin/Functions/valueTransform.js +40 -0
- package/Source/Shaders/Builtin/Functions/vertexLogDepth.glsl +64 -0
- package/Source/Shaders/Builtin/Functions/vertexLogDepth.js +66 -0
- package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.glsl +99 -0
- package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js +101 -0
- package/Source/Shaders/Builtin/Functions/writeDepthClamp.glsl +27 -0
- package/Source/Shaders/Builtin/Functions/writeDepthClamp.js +29 -0
- package/Source/Shaders/Builtin/Functions/writeLogDepth.glsl +82 -0
- package/Source/Shaders/Builtin/Functions/writeLogDepth.js +84 -0
- package/Source/Shaders/Builtin/Functions/writeNonPerspective.glsl +32 -0
- package/Source/Shaders/Builtin/Functions/writeNonPerspective.js +34 -0
- package/Source/Shaders/Builtin/Structs/depthRangeStruct.glsl +9 -0
- package/Source/Shaders/Builtin/Structs/depthRangeStruct.js +11 -0
- package/Source/Shaders/Builtin/Structs/material.glsl +22 -0
- package/Source/Shaders/Builtin/Structs/material.js +24 -0
- package/Source/Shaders/Builtin/Structs/materialInput.glsl +28 -0
- package/Source/Shaders/Builtin/Structs/materialInput.js +30 -0
- package/Source/Shaders/Builtin/Structs/modelMaterial.glsl +29 -0
- package/Source/Shaders/Builtin/Structs/modelMaterial.js +31 -0
- package/Source/Shaders/Builtin/Structs/modelVertexOutput.glsl +16 -0
- package/Source/Shaders/Builtin/Structs/modelVertexOutput.js +18 -0
- package/Source/Shaders/Builtin/Structs/pbrParameters.glsl +16 -0
- package/Source/Shaders/Builtin/Structs/pbrParameters.js +18 -0
- package/Source/Shaders/Builtin/Structs/ray.glsl +11 -0
- package/Source/Shaders/Builtin/Structs/ray.js +13 -0
- package/Source/Shaders/Builtin/Structs/raySegment.glsl +27 -0
- package/Source/Shaders/Builtin/Structs/raySegment.js +29 -0
- package/Source/Shaders/Builtin/Structs/shadowParameters.glsl +15 -0
- package/Source/Shaders/Builtin/Structs/shadowParameters.js +17 -0
- package/Source/Shaders/CloudCollectionFS.glsl +263 -0
- package/Source/Shaders/CloudCollectionFS.js +265 -0
- package/Source/Shaders/CloudCollectionVS.glsl +48 -0
- package/Source/Shaders/CloudCollectionVS.js +50 -0
- package/Source/Shaders/CloudNoiseFS.glsl +92 -0
- package/Source/Shaders/CloudNoiseFS.js +94 -0
- package/Source/Shaders/CloudNoiseVS.glsl +18 -0
- package/Source/Shaders/CloudNoiseVS.js +20 -0
- package/Source/Shaders/CompareAndPackTranslucentDepth.glsl +12 -0
- package/Source/Shaders/CompareAndPackTranslucentDepth.js +14 -0
- package/Source/Shaders/CompositeOITFS.glsl +31 -0
- package/Source/Shaders/CompositeOITFS.js +33 -0
- package/Source/Shaders/DepthPlaneFS.glsl +36 -0
- package/Source/Shaders/DepthPlaneFS.js +38 -0
- package/Source/Shaders/DepthPlaneVS.glsl +11 -0
- package/Source/Shaders/DepthPlaneVS.js +13 -0
- package/Source/Shaders/EllipsoidFS.glsl +112 -0
- package/Source/Shaders/EllipsoidFS.js +114 -0
- package/Source/Shaders/EllipsoidVS.glsl +28 -0
- package/Source/Shaders/EllipsoidVS.js +30 -0
- package/Source/Shaders/FXAA3_11.glsl +648 -0
- package/Source/Shaders/FXAA3_11.js +678 -0
- package/Source/Shaders/GlobeFS.glsl +652 -0
- package/Source/Shaders/GlobeFS.js +654 -0
- package/Source/Shaders/GlobeVS.glsl +253 -0
- package/Source/Shaders/GlobeVS.js +255 -0
- package/Source/Shaders/GroundAtmosphere.glsl +18 -0
- package/Source/Shaders/GroundAtmosphere.js +20 -0
- package/Source/Shaders/Materials/AspectRampMaterial.glsl +11 -0
- package/Source/Shaders/Materials/AspectRampMaterial.js +13 -0
- package/Source/Shaders/Materials/BumpMapMaterial.glsl +29 -0
- package/Source/Shaders/Materials/BumpMapMaterial.js +31 -0
- package/Source/Shaders/Materials/CheckerboardMaterial.glsl +29 -0
- package/Source/Shaders/Materials/CheckerboardMaterial.js +31 -0
- package/Source/Shaders/Materials/DotMaterial.glsl +18 -0
- package/Source/Shaders/Materials/DotMaterial.js +20 -0
- package/Source/Shaders/Materials/ElevationBandMaterial.glsl +74 -0
- package/Source/Shaders/Materials/ElevationBandMaterial.js +76 -0
- package/Source/Shaders/Materials/ElevationContourMaterial.glsl +29 -0
- package/Source/Shaders/Materials/ElevationContourMaterial.js +31 -0
- package/Source/Shaders/Materials/ElevationRampMaterial.glsl +14 -0
- package/Source/Shaders/Materials/ElevationRampMaterial.js +16 -0
- package/Source/Shaders/Materials/FadeMaterial.glsl +37 -0
- package/Source/Shaders/Materials/FadeMaterial.js +39 -0
- package/Source/Shaders/Materials/GridMaterial.glsl +60 -0
- package/Source/Shaders/Materials/GridMaterial.js +62 -0
- package/Source/Shaders/Materials/NormalMapMaterial.glsl +19 -0
- package/Source/Shaders/Materials/NormalMapMaterial.js +21 -0
- package/Source/Shaders/Materials/PolylineArrowMaterial.glsl +66 -0
- package/Source/Shaders/Materials/PolylineArrowMaterial.js +68 -0
- package/Source/Shaders/Materials/PolylineDashMaterial.glsl +39 -0
- package/Source/Shaders/Materials/PolylineDashMaterial.js +41 -0
- package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +25 -0
- package/Source/Shaders/Materials/PolylineGlowMaterial.js +27 -0
- package/Source/Shaders/Materials/PolylineOutlineMaterial.glsl +29 -0
- package/Source/Shaders/Materials/PolylineOutlineMaterial.js +31 -0
- package/Source/Shaders/Materials/RimLightingMaterial.glsl +21 -0
- package/Source/Shaders/Materials/RimLightingMaterial.js +23 -0
- package/Source/Shaders/Materials/SlopeRampMaterial.glsl +11 -0
- package/Source/Shaders/Materials/SlopeRampMaterial.js +13 -0
- package/Source/Shaders/Materials/StripeMaterial.glsl +24 -0
- package/Source/Shaders/Materials/StripeMaterial.js +26 -0
- package/Source/Shaders/Materials/Water.glsl +58 -0
- package/Source/Shaders/Materials/Water.js +60 -0
- package/Source/Shaders/Model/CPUStylingStageFS.glsl +49 -0
- package/Source/Shaders/Model/CPUStylingStageFS.js +51 -0
- package/Source/Shaders/Model/CPUStylingStageVS.glsl +30 -0
- package/Source/Shaders/Model/CPUStylingStageVS.js +32 -0
- package/Source/Shaders/Model/CustomShaderStageFS.glsl +18 -0
- package/Source/Shaders/Model/CustomShaderStageFS.js +20 -0
- package/Source/Shaders/Model/CustomShaderStageVS.glsl +19 -0
- package/Source/Shaders/Model/CustomShaderStageVS.js +21 -0
- package/Source/Shaders/Model/FeatureIdStageFS.glsl +4 -0
- package/Source/Shaders/Model/FeatureIdStageFS.js +6 -0
- package/Source/Shaders/Model/FeatureIdStageVS.glsl +6 -0
- package/Source/Shaders/Model/FeatureIdStageVS.js +8 -0
- package/Source/Shaders/Model/GeometryStageFS.glsl +25 -0
- package/Source/Shaders/Model/GeometryStageFS.js +27 -0
- package/Source/Shaders/Model/GeometryStageVS.glsl +42 -0
- package/Source/Shaders/Model/GeometryStageVS.js +44 -0
- package/Source/Shaders/Model/ImageBasedLightingStageFS.glsl +165 -0
- package/Source/Shaders/Model/ImageBasedLightingStageFS.js +166 -0
- package/Source/Shaders/Model/InstancingStageCommon.glsl +67 -0
- package/Source/Shaders/Model/InstancingStageCommon.js +69 -0
- package/Source/Shaders/Model/InstancingStageVS.glsl +18 -0
- package/Source/Shaders/Model/InstancingStageVS.js +20 -0
- package/Source/Shaders/Model/LegacyInstancingStageVS.glsl +20 -0
- package/Source/Shaders/Model/LegacyInstancingStageVS.js +22 -0
- package/Source/Shaders/Model/LightingStageFS.glsl +73 -0
- package/Source/Shaders/Model/LightingStageFS.js +75 -0
- package/Source/Shaders/Model/MaterialStageFS.glsl +226 -0
- package/Source/Shaders/Model/MaterialStageFS.js +228 -0
- package/Source/Shaders/Model/MetadataStageFS.glsl +9 -0
- package/Source/Shaders/Model/MetadataStageFS.js +11 -0
- package/Source/Shaders/Model/MetadataStageVS.glsl +10 -0
- package/Source/Shaders/Model/MetadataStageVS.js +12 -0
- package/Source/Shaders/Model/ModelClippingPlanesStageFS.glsl +88 -0
- package/Source/Shaders/Model/ModelClippingPlanesStageFS.js +90 -0
- package/Source/Shaders/Model/ModelColorStageFS.glsl +7 -0
- package/Source/Shaders/Model/ModelColorStageFS.js +8 -0
- package/Source/Shaders/Model/ModelFS.glsl +89 -0
- package/Source/Shaders/Model/ModelFS.js +91 -0
- package/Source/Shaders/Model/ModelSilhouetteStageFS.glsl +5 -0
- package/Source/Shaders/Model/ModelSilhouetteStageFS.js +6 -0
- package/Source/Shaders/Model/ModelSilhouetteStageVS.glsl +10 -0
- package/Source/Shaders/Model/ModelSilhouetteStageVS.js +12 -0
- package/Source/Shaders/Model/ModelSplitterStageFS.glsl +9 -0
- package/Source/Shaders/Model/ModelSplitterStageFS.js +11 -0
- package/Source/Shaders/Model/ModelVS.glsl +136 -0
- package/Source/Shaders/Model/ModelVS.js +138 -0
- package/Source/Shaders/Model/MorphTargetsStageVS.glsl +15 -0
- package/Source/Shaders/Model/MorphTargetsStageVS.js +16 -0
- package/Source/Shaders/Model/PointCloudStylingStageVS.glsl +45 -0
- package/Source/Shaders/Model/PointCloudStylingStageVS.js +46 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.glsl +16 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +18 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageVS.glsl +3 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageVS.js +5 -0
- package/Source/Shaders/Model/SelectedFeatureIdStageCommon.glsl +51 -0
- package/Source/Shaders/Model/SelectedFeatureIdStageCommon.js +53 -0
- package/Source/Shaders/Model/SkinningStageVS.glsl +18 -0
- package/Source/Shaders/Model/SkinningStageVS.js +19 -0
- package/Source/Shaders/OctahedralProjectionAtlasFS.glsl +89 -0
- package/Source/Shaders/OctahedralProjectionAtlasFS.js +91 -0
- package/Source/Shaders/OctahedralProjectionFS.glsl +14 -0
- package/Source/Shaders/OctahedralProjectionFS.js +16 -0
- package/Source/Shaders/OctahedralProjectionVS.glsl +10 -0
- package/Source/Shaders/OctahedralProjectionVS.js +12 -0
- package/Source/Shaders/PointPrimitiveCollectionFS.glsl +43 -0
- package/Source/Shaders/PointPrimitiveCollectionFS.js +45 -0
- package/Source/Shaders/PointPrimitiveCollectionVS.glsl +180 -0
- package/Source/Shaders/PointPrimitiveCollectionVS.js +182 -0
- package/Source/Shaders/PolylineCommon.glsl +176 -0
- package/Source/Shaders/PolylineCommon.js +178 -0
- package/Source/Shaders/PolylineFS.glsl +25 -0
- package/Source/Shaders/PolylineFS.js +27 -0
- package/Source/Shaders/PolylineShadowVolumeFS.glsl +90 -0
- package/Source/Shaders/PolylineShadowVolumeFS.js +92 -0
- package/Source/Shaders/PolylineShadowVolumeMorphFS.glsl +45 -0
- package/Source/Shaders/PolylineShadowVolumeMorphFS.js +47 -0
- package/Source/Shaders/PolylineShadowVolumeMorphVS.glsl +177 -0
- package/Source/Shaders/PolylineShadowVolumeMorphVS.js +179 -0
- package/Source/Shaders/PolylineShadowVolumeVS.glsl +168 -0
- package/Source/Shaders/PolylineShadowVolumeVS.js +170 -0
- package/Source/Shaders/PolylineVS.glsl +103 -0
- package/Source/Shaders/PolylineVS.js +105 -0
- package/Source/Shaders/PostProcessStages/AcesTonemappingStage.glsl +21 -0
- package/Source/Shaders/PostProcessStages/AcesTonemappingStage.js +23 -0
- package/Source/Shaders/PostProcessStages/AdditiveBlend.glsl +17 -0
- package/Source/Shaders/PostProcessStages/AdditiveBlend.js +19 -0
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.glsl +115 -0
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js +117 -0
- package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.glsl +11 -0
- package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.js +13 -0
- package/Source/Shaders/PostProcessStages/BlackAndWhite.glsl +19 -0
- package/Source/Shaders/PostProcessStages/BlackAndWhite.js +21 -0
- package/Source/Shaders/PostProcessStages/BloomComposite.glsl +20 -0
- package/Source/Shaders/PostProcessStages/BloomComposite.js +22 -0
- package/Source/Shaders/PostProcessStages/BrightPass.glsl +30 -0
- package/Source/Shaders/PostProcessStages/BrightPass.js +32 -0
- package/Source/Shaders/PostProcessStages/Brightness.glsl +11 -0
- package/Source/Shaders/PostProcessStages/Brightness.js +13 -0
- package/Source/Shaders/PostProcessStages/CompositeTranslucentClassification.glsl +31 -0
- package/Source/Shaders/PostProcessStages/CompositeTranslucentClassification.js +33 -0
- package/Source/Shaders/PostProcessStages/ContrastBias.glsl +17 -0
- package/Source/Shaders/PostProcessStages/ContrastBias.js +19 -0
- package/Source/Shaders/PostProcessStages/DepthOfField.glsl +39 -0
- package/Source/Shaders/PostProcessStages/DepthOfField.js +41 -0
- package/Source/Shaders/PostProcessStages/DepthView.glsl +9 -0
- package/Source/Shaders/PostProcessStages/DepthView.js +11 -0
- package/Source/Shaders/PostProcessStages/DepthViewPacked.glsl +14 -0
- package/Source/Shaders/PostProcessStages/DepthViewPacked.js +16 -0
- package/Source/Shaders/PostProcessStages/EdgeDetection.glsl +60 -0
- package/Source/Shaders/PostProcessStages/EdgeDetection.js +62 -0
- package/Source/Shaders/PostProcessStages/FXAA.glsl +21 -0
- package/Source/Shaders/PostProcessStages/FXAA.js +23 -0
- package/Source/Shaders/PostProcessStages/FilmicTonemapping.glsl +36 -0
- package/Source/Shaders/PostProcessStages/FilmicTonemapping.js +38 -0
- package/Source/Shaders/PostProcessStages/GaussianBlur1D.glsl +47 -0
- package/Source/Shaders/PostProcessStages/GaussianBlur1D.js +49 -0
- package/Source/Shaders/PostProcessStages/LensFlare.glsl +153 -0
- package/Source/Shaders/PostProcessStages/LensFlare.js +155 -0
- package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.glsl +24 -0
- package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.js +26 -0
- package/Source/Shaders/PostProcessStages/NightVision.glsl +16 -0
- package/Source/Shaders/PostProcessStages/NightVision.js +18 -0
- package/Source/Shaders/PostProcessStages/PassThrough.glsl +8 -0
- package/Source/Shaders/PostProcessStages/PassThrough.js +10 -0
- package/Source/Shaders/PostProcessStages/PassThroughDepth.glsl +8 -0
- package/Source/Shaders/PostProcessStages/PassThroughDepth.js +10 -0
- package/Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.glsl +63 -0
- package/Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.js +65 -0
- package/Source/Shaders/PostProcessStages/ReinhardTonemapping.glsl +23 -0
- package/Source/Shaders/PostProcessStages/ReinhardTonemapping.js +25 -0
- package/Source/Shaders/PostProcessStages/Silhouette.glsl +11 -0
- package/Source/Shaders/PostProcessStages/Silhouette.js +13 -0
- package/Source/Shaders/ReprojectWebMercatorFS.glsl +8 -0
- package/Source/Shaders/ReprojectWebMercatorFS.js +10 -0
- package/Source/Shaders/ReprojectWebMercatorVS.glsl +12 -0
- package/Source/Shaders/ReprojectWebMercatorVS.js +14 -0
- package/Source/Shaders/ShadowVolumeAppearanceFS.glsl +165 -0
- package/Source/Shaders/ShadowVolumeAppearanceFS.js +167 -0
- package/Source/Shaders/ShadowVolumeAppearanceVS.glsl +101 -0
- package/Source/Shaders/ShadowVolumeAppearanceVS.js +103 -0
- package/Source/Shaders/ShadowVolumeFS.glsl +17 -0
- package/Source/Shaders/ShadowVolumeFS.js +19 -0
- package/Source/Shaders/SkyAtmosphereCommon.glsl +91 -0
- package/Source/Shaders/SkyAtmosphereCommon.js +93 -0
- package/Source/Shaders/SkyAtmosphereFS.glsl +64 -0
- package/Source/Shaders/SkyAtmosphereFS.js +66 -0
- package/Source/Shaders/SkyAtmosphereVS.glsl +30 -0
- package/Source/Shaders/SkyAtmosphereVS.js +32 -0
- package/Source/Shaders/SkyBoxFS.glsl +9 -0
- package/Source/Shaders/SkyBoxFS.js +11 -0
- package/Source/Shaders/SkyBoxVS.glsl +10 -0
- package/Source/Shaders/SkyBoxVS.js +12 -0
- package/Source/Shaders/SunFS.glsl +9 -0
- package/Source/Shaders/SunFS.js +11 -0
- package/Source/Shaders/SunTextureFS.glsl +55 -0
- package/Source/Shaders/SunTextureFS.js +57 -0
- package/Source/Shaders/SunVS.glsl +28 -0
- package/Source/Shaders/SunVS.js +30 -0
- package/Source/Shaders/Vector3DTileClampedPolylinesFS.glsl +52 -0
- package/Source/Shaders/Vector3DTileClampedPolylinesFS.js +54 -0
- package/Source/Shaders/Vector3DTileClampedPolylinesVS.glsl +85 -0
- package/Source/Shaders/Vector3DTileClampedPolylinesVS.js +87 -0
- package/Source/Shaders/Vector3DTilePolylinesVS.glsl +22 -0
- package/Source/Shaders/Vector3DTilePolylinesVS.js +24 -0
- package/Source/Shaders/VectorTileVS.glsl +9 -0
- package/Source/Shaders/VectorTileVS.js +11 -0
- package/Source/Shaders/ViewportQuadFS.glsl +16 -0
- package/Source/Shaders/ViewportQuadFS.js +18 -0
- package/Source/Shaders/ViewportQuadVS.glsl +10 -0
- package/Source/Shaders/ViewportQuadVS.js +12 -0
- package/Source/ThirdParty/Workers/basis_transcoder.js +21 -0
- package/Source/ThirdParty/Workers/draco_decoder_nodejs.js +118 -0
- package/Source/ThirdParty/Workers/package.json +1 -0
- package/Source/ThirdParty/Workers/pako_deflate.min.js +2 -0
- package/Source/ThirdParty/Workers/pako_inflate.min.js +2 -0
- package/Source/ThirdParty/Workers/z-worker-pako.js +1 -0
- package/Source/ThirdParty/basis_transcoder.wasm +0 -0
- package/Source/ThirdParty/draco_decoder.wasm +0 -0
- package/Source/ThirdParty/google-earth-dbroot-parser.js +8337 -0
- package/Source/Widget/CesiumWidget.css +124 -0
- package/Source/Widget/CesiumWidget.js +807 -0
- package/Source/Widget/lighter.css +14 -0
- package/Source/Workers/cesiumWorkerBootstrapper.js +2290 -0
- package/Source/Workers/package.json +1 -0
- package/Source/Workers/transferTypedArrayTest.js +22 -0
- package/Source/WorkersES6/combineGeometry.js +14 -0
- package/Source/WorkersES6/createBoxGeometry.js +10 -0
- package/Source/WorkersES6/createBoxOutlineGeometry.js +10 -0
- package/Source/WorkersES6/createCircleGeometry.js +18 -0
- package/Source/WorkersES6/createCircleOutlineGeometry.js +18 -0
- package/Source/WorkersES6/createCoplanarPolygonGeometry.js +10 -0
- package/Source/WorkersES6/createCoplanarPolygonOutlineGeometry.js +15 -0
- package/Source/WorkersES6/createCorridorGeometry.js +12 -0
- package/Source/WorkersES6/createCorridorOutlineGeometry.js +17 -0
- package/Source/WorkersES6/createCylinderGeometry.js +10 -0
- package/Source/WorkersES6/createCylinderOutlineGeometry.js +10 -0
- package/Source/WorkersES6/createEllipseGeometry.js +14 -0
- package/Source/WorkersES6/createEllipseOutlineGeometry.js +14 -0
- package/Source/WorkersES6/createEllipsoidGeometry.js +10 -0
- package/Source/WorkersES6/createEllipsoidOutlineGeometry.js +13 -0
- package/Source/WorkersES6/createFrustumGeometry.js +10 -0
- package/Source/WorkersES6/createFrustumOutlineGeometry.js +10 -0
- package/Source/WorkersES6/createGeometry.js +52 -0
- package/Source/WorkersES6/createGroundPolylineGeometry.js +16 -0
- package/Source/WorkersES6/createPlaneGeometry.js +10 -0
- package/Source/WorkersES6/createPlaneOutlineGeometry.js +10 -0
- package/Source/WorkersES6/createPolygonGeometry.js +12 -0
- package/Source/WorkersES6/createPolygonOutlineGeometry.js +12 -0
- package/Source/WorkersES6/createPolylineGeometry.js +12 -0
- package/Source/WorkersES6/createPolylineVolumeGeometry.js +17 -0
- package/Source/WorkersES6/createPolylineVolumeOutlineGeometry.js +22 -0
- package/Source/WorkersES6/createRectangleGeometry.js +14 -0
- package/Source/WorkersES6/createRectangleOutlineGeometry.js +17 -0
- package/Source/WorkersES6/createSimplePolylineGeometry.js +17 -0
- package/Source/WorkersES6/createSphereGeometry.js +10 -0
- package/Source/WorkersES6/createSphereOutlineGeometry.js +10 -0
- package/Source/WorkersES6/createTaskProcessorWorker.js +129 -0
- package/Source/WorkersES6/createVectorTileClampedPolylines.js +541 -0
- package/Source/WorkersES6/createVectorTileGeometries.js +414 -0
- package/Source/WorkersES6/createVectorTilePoints.js +81 -0
- package/Source/WorkersES6/createVectorTilePolygons.js +412 -0
- package/Source/WorkersES6/createVectorTilePolylines.js +210 -0
- package/Source/WorkersES6/createVerticesFromGoogleEarthEnterpriseBuffer.js +653 -0
- package/Source/WorkersES6/createVerticesFromHeightmap.js +53 -0
- package/Source/WorkersES6/createVerticesFromQuantizedTerrainMesh.js +549 -0
- package/Source/WorkersES6/createWallGeometry.js +12 -0
- package/Source/WorkersES6/createWallOutlineGeometry.js +12 -0
- package/Source/WorkersES6/decodeDraco.js +381 -0
- package/Source/WorkersES6/decodeGoogleEarthEnterprisePacket.js +268 -0
- package/Source/WorkersES6/decodeI3S.js +1044 -0
- package/Source/WorkersES6/transcodeKTX2.js +316 -0
- package/Source/WorkersES6/upsampleQuantizedTerrainMesh.js +680 -0
- package/index.d.ts +41767 -0
- package/index.js +1085 -0
- package/package.json +73 -0
|
@@ -0,0 +1,4498 @@
|
|
|
1
|
+
import BoundingRectangle from "../Core/BoundingRectangle.js";
|
|
2
|
+
import BoundingSphere from "../Core/BoundingSphere.js";
|
|
3
|
+
import BoxGeometry from "../Core/BoxGeometry.js";
|
|
4
|
+
import Cartesian3 from "../Core/Cartesian3.js";
|
|
5
|
+
import Cartographic from "../Core/Cartographic.js";
|
|
6
|
+
import clone from "../Core/clone.js";
|
|
7
|
+
import Color from "../Core/Color.js";
|
|
8
|
+
import ColorGeometryInstanceAttribute from "../Core/ColorGeometryInstanceAttribute.js";
|
|
9
|
+
import createGuid from "../Core/createGuid.js";
|
|
10
|
+
import CullingVolume from "../Core/CullingVolume.js";
|
|
11
|
+
import defaultValue from "../Core/defaultValue.js";
|
|
12
|
+
import defined from "../Core/defined.js";
|
|
13
|
+
import destroyObject from "../Core/destroyObject.js";
|
|
14
|
+
import DeveloperError from "../Core/DeveloperError.js";
|
|
15
|
+
import EllipsoidGeometry from "../Core/EllipsoidGeometry.js";
|
|
16
|
+
import Event from "../Core/Event.js";
|
|
17
|
+
import GeographicProjection from "../Core/GeographicProjection.js";
|
|
18
|
+
import GeometryInstance from "../Core/GeometryInstance.js";
|
|
19
|
+
import GeometryPipeline from "../Core/GeometryPipeline.js";
|
|
20
|
+
import Intersect from "../Core/Intersect.js";
|
|
21
|
+
import JulianDate from "../Core/JulianDate.js";
|
|
22
|
+
import CesiumMath from "../Core/Math.js";
|
|
23
|
+
import Matrix4 from "../Core/Matrix4.js";
|
|
24
|
+
import mergeSort from "../Core/mergeSort.js";
|
|
25
|
+
import Occluder from "../Core/Occluder.js";
|
|
26
|
+
import OrthographicFrustum from "../Core/OrthographicFrustum.js";
|
|
27
|
+
import OrthographicOffCenterFrustum from "../Core/OrthographicOffCenterFrustum.js";
|
|
28
|
+
import PerspectiveFrustum from "../Core/PerspectiveFrustum.js";
|
|
29
|
+
import PerspectiveOffCenterFrustum from "../Core/PerspectiveOffCenterFrustum.js";
|
|
30
|
+
import RequestScheduler from "../Core/RequestScheduler.js";
|
|
31
|
+
import TaskProcessor from "../Core/TaskProcessor.js";
|
|
32
|
+
import Transforms from "../Core/Transforms.js";
|
|
33
|
+
import ClearCommand from "../Renderer/ClearCommand.js";
|
|
34
|
+
import ComputeEngine from "../Renderer/ComputeEngine.js";
|
|
35
|
+
import Context from "../Renderer/Context.js";
|
|
36
|
+
import ContextLimits from "../Renderer/ContextLimits.js";
|
|
37
|
+
import Pass from "../Renderer/Pass.js";
|
|
38
|
+
import RenderState from "../Renderer/RenderState.js";
|
|
39
|
+
import BrdfLutGenerator from "./BrdfLutGenerator.js";
|
|
40
|
+
import Camera from "./Camera.js";
|
|
41
|
+
import Cesium3DTilePass from "./Cesium3DTilePass.js";
|
|
42
|
+
import Cesium3DTilePassState from "./Cesium3DTilePassState.js";
|
|
43
|
+
import CreditDisplay from "./CreditDisplay.js";
|
|
44
|
+
import DebugCameraPrimitive from "./DebugCameraPrimitive.js";
|
|
45
|
+
import DepthPlane from "./DepthPlane.js";
|
|
46
|
+
import DerivedCommand from "./DerivedCommand.js";
|
|
47
|
+
import DeviceOrientationCameraController from "./DeviceOrientationCameraController.js";
|
|
48
|
+
import Fog from "./Fog.js";
|
|
49
|
+
import FrameState from "./FrameState.js";
|
|
50
|
+
import GlobeTranslucencyState from "./GlobeTranslucencyState.js";
|
|
51
|
+
import InvertClassification from "./InvertClassification.js";
|
|
52
|
+
import JobScheduler from "./JobScheduler.js";
|
|
53
|
+
import MapMode2D from "./MapMode2D.js";
|
|
54
|
+
import OctahedralProjectedCubeMap from "./OctahedralProjectedCubeMap.js";
|
|
55
|
+
import PerformanceDisplay from "./PerformanceDisplay.js";
|
|
56
|
+
import PerInstanceColorAppearance from "./PerInstanceColorAppearance.js";
|
|
57
|
+
import Picking from "./Picking.js";
|
|
58
|
+
import PostProcessStageCollection from "./PostProcessStageCollection.js";
|
|
59
|
+
import Primitive from "./Primitive.js";
|
|
60
|
+
import PrimitiveCollection from "./PrimitiveCollection.js";
|
|
61
|
+
import SceneMode from "./SceneMode.js";
|
|
62
|
+
import SceneTransforms from "./SceneTransforms.js";
|
|
63
|
+
import SceneTransitioner from "./SceneTransitioner.js";
|
|
64
|
+
import ScreenSpaceCameraController from "./ScreenSpaceCameraController.js";
|
|
65
|
+
import ShadowMap from "./ShadowMap.js";
|
|
66
|
+
import StencilConstants from "./StencilConstants.js";
|
|
67
|
+
import SunLight from "./SunLight.js";
|
|
68
|
+
import SunPostProcess from "./SunPostProcess.js";
|
|
69
|
+
import TweenCollection from "./TweenCollection.js";
|
|
70
|
+
import View from "./View.js";
|
|
71
|
+
import DebugInspector from "./DebugInspector.js";
|
|
72
|
+
|
|
73
|
+
const requestRenderAfterFrame = function (scene) {
|
|
74
|
+
return function () {
|
|
75
|
+
scene.frameState.afterRender.push(function () {
|
|
76
|
+
scene.requestRender();
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The container for all 3D graphical objects and state in a Cesium virtual scene. Generally,
|
|
83
|
+
* a scene is not created directly; instead, it is implicitly created by {@link CesiumWidget}.
|
|
84
|
+
* <p>
|
|
85
|
+
* <em><code>contextOptions</code> parameter details:</em>
|
|
86
|
+
* </p>
|
|
87
|
+
* <p>
|
|
88
|
+
* The default values are:
|
|
89
|
+
* <code>
|
|
90
|
+
* {
|
|
91
|
+
* webgl : {
|
|
92
|
+
* alpha : false,
|
|
93
|
+
* depth : true,
|
|
94
|
+
* stencil : false,
|
|
95
|
+
* antialias : true,
|
|
96
|
+
* powerPreference: 'high-performance',
|
|
97
|
+
* premultipliedAlpha : true,
|
|
98
|
+
* preserveDrawingBuffer : false,
|
|
99
|
+
* failIfMajorPerformanceCaveat : false
|
|
100
|
+
* },
|
|
101
|
+
* allowTextureFilterAnisotropic : true
|
|
102
|
+
* }
|
|
103
|
+
* </code>
|
|
104
|
+
* </p>
|
|
105
|
+
* <p>
|
|
106
|
+
* The <code>webgl</code> property corresponds to the {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}
|
|
107
|
+
* object used to create the WebGL context.
|
|
108
|
+
* </p>
|
|
109
|
+
* <p>
|
|
110
|
+
* <code>webgl.alpha</code> defaults to false, which can improve performance compared to the standard WebGL default
|
|
111
|
+
* of true. If an application needs to composite Cesium above other HTML elements using alpha-blending, set
|
|
112
|
+
* <code>webgl.alpha</code> to true.
|
|
113
|
+
* </p>
|
|
114
|
+
* <p>
|
|
115
|
+
* The other <code>webgl</code> properties match the WebGL defaults for {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}.
|
|
116
|
+
* </p>
|
|
117
|
+
* <p>
|
|
118
|
+
* <code>allowTextureFilterAnisotropic</code> defaults to true, which enables anisotropic texture filtering when the
|
|
119
|
+
* WebGL extension is supported. Setting this to false will improve performance, but hurt visual quality, especially for horizon views.
|
|
120
|
+
* </p>
|
|
121
|
+
*
|
|
122
|
+
* @alias Scene
|
|
123
|
+
* @constructor
|
|
124
|
+
*
|
|
125
|
+
* @param {Object} options Object with the following properties:
|
|
126
|
+
* @param {HTMLCanvasElement} options.canvas The HTML canvas element to create the scene for.
|
|
127
|
+
* @param {Object} [options.contextOptions] Context and WebGL creation properties. See details above.
|
|
128
|
+
* @param {Element} [options.creditContainer] The HTML element in which the credits will be displayed.
|
|
129
|
+
* @param {Element} [options.creditViewport] The HTML element in which to display the credit popup. If not specified, the viewport will be a added as a sibling of the canvas.
|
|
130
|
+
* @param {MapProjection} [options.mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes.
|
|
131
|
+
* @param {Boolean} [options.orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency.
|
|
132
|
+
* @param {Boolean} [options.scene3DOnly=false] If true, optimizes memory use and performance for 3D mode but disables the ability to use 2D or Columbus View.
|
|
133
|
+
* @param {Boolean} [options.shadows=false] Determines if shadows are cast by light sources.
|
|
134
|
+
* @param {MapMode2D} [options.mapMode2D=MapMode2D.INFINITE_SCROLL] Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
|
|
135
|
+
* @param {Boolean} [options.requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
|
|
136
|
+
* @param {Number} [options.maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
|
|
137
|
+
* @param {Number} [depthPlaneEllipsoidOffset=0.0] Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.
|
|
138
|
+
* @param {Number} [options.msaaSamples=1] If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.
|
|
139
|
+
*
|
|
140
|
+
* @see CesiumWidget
|
|
141
|
+
* @see {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}
|
|
142
|
+
*
|
|
143
|
+
* @exception {DeveloperError} options and options.canvas are required.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* // Create scene without anisotropic texture filtering
|
|
147
|
+
* const scene = new Cesium.Scene({
|
|
148
|
+
* canvas : canvas,
|
|
149
|
+
* contextOptions : {
|
|
150
|
+
* allowTextureFilterAnisotropic : false
|
|
151
|
+
* }
|
|
152
|
+
* });
|
|
153
|
+
*/
|
|
154
|
+
function Scene(options) {
|
|
155
|
+
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
|
|
156
|
+
const canvas = options.canvas;
|
|
157
|
+
let creditContainer = options.creditContainer;
|
|
158
|
+
let creditViewport = options.creditViewport;
|
|
159
|
+
|
|
160
|
+
let contextOptions = clone(options.contextOptions);
|
|
161
|
+
if (!defined(contextOptions)) {
|
|
162
|
+
contextOptions = {};
|
|
163
|
+
}
|
|
164
|
+
if (!defined(contextOptions.webgl)) {
|
|
165
|
+
contextOptions.webgl = {};
|
|
166
|
+
}
|
|
167
|
+
contextOptions.webgl.powerPreference = defaultValue(
|
|
168
|
+
contextOptions.webgl.powerPreference,
|
|
169
|
+
"high-performance"
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
//>>includeStart('debug', pragmas.debug);
|
|
173
|
+
if (!defined(canvas)) {
|
|
174
|
+
throw new DeveloperError("options and options.canvas are required.");
|
|
175
|
+
}
|
|
176
|
+
//>>includeEnd('debug');
|
|
177
|
+
const hasCreditContainer = defined(creditContainer);
|
|
178
|
+
const context = new Context(canvas, contextOptions);
|
|
179
|
+
if (!hasCreditContainer) {
|
|
180
|
+
creditContainer = document.createElement("div");
|
|
181
|
+
creditContainer.style.position = "absolute";
|
|
182
|
+
creditContainer.style.bottom = "0";
|
|
183
|
+
creditContainer.style["text-shadow"] = "0 0 2px #000000";
|
|
184
|
+
creditContainer.style.color = "#ffffff";
|
|
185
|
+
creditContainer.style["font-size"] = "10px";
|
|
186
|
+
creditContainer.style["padding-right"] = "5px";
|
|
187
|
+
canvas.parentNode.appendChild(creditContainer);
|
|
188
|
+
}
|
|
189
|
+
if (!defined(creditViewport)) {
|
|
190
|
+
creditViewport = canvas.parentNode;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
this._id = createGuid();
|
|
194
|
+
this._jobScheduler = new JobScheduler();
|
|
195
|
+
this._frameState = new FrameState(
|
|
196
|
+
context,
|
|
197
|
+
new CreditDisplay(creditContainer, " • ", creditViewport),
|
|
198
|
+
this._jobScheduler
|
|
199
|
+
);
|
|
200
|
+
this._frameState.scene3DOnly = defaultValue(options.scene3DOnly, false);
|
|
201
|
+
this._removeCreditContainer = !hasCreditContainer;
|
|
202
|
+
this._creditContainer = creditContainer;
|
|
203
|
+
|
|
204
|
+
this._canvas = canvas;
|
|
205
|
+
this._context = context;
|
|
206
|
+
this._computeEngine = new ComputeEngine(context);
|
|
207
|
+
this._globe = undefined;
|
|
208
|
+
this._globeTranslucencyState = new GlobeTranslucencyState();
|
|
209
|
+
this._primitives = new PrimitiveCollection();
|
|
210
|
+
this._groundPrimitives = new PrimitiveCollection();
|
|
211
|
+
|
|
212
|
+
this._globeHeight = undefined;
|
|
213
|
+
this._cameraUnderground = false;
|
|
214
|
+
|
|
215
|
+
this._logDepthBuffer = context.fragmentDepth;
|
|
216
|
+
this._logDepthBufferDirty = true;
|
|
217
|
+
|
|
218
|
+
this._tweens = new TweenCollection();
|
|
219
|
+
|
|
220
|
+
this._shaderFrameCount = 0;
|
|
221
|
+
|
|
222
|
+
this._sunPostProcess = undefined;
|
|
223
|
+
|
|
224
|
+
this._computeCommandList = [];
|
|
225
|
+
this._overlayCommandList = [];
|
|
226
|
+
|
|
227
|
+
this._useOIT = defaultValue(options.orderIndependentTranslucency, true);
|
|
228
|
+
this._executeOITFunction = undefined;
|
|
229
|
+
|
|
230
|
+
this._depthPlane = new DepthPlane(options.depthPlaneEllipsoidOffset);
|
|
231
|
+
|
|
232
|
+
this._clearColorCommand = new ClearCommand({
|
|
233
|
+
color: new Color(),
|
|
234
|
+
stencil: 0,
|
|
235
|
+
owner: this,
|
|
236
|
+
});
|
|
237
|
+
this._depthClearCommand = new ClearCommand({
|
|
238
|
+
depth: 1.0,
|
|
239
|
+
owner: this,
|
|
240
|
+
});
|
|
241
|
+
this._stencilClearCommand = new ClearCommand({
|
|
242
|
+
stencil: 0,
|
|
243
|
+
});
|
|
244
|
+
this._classificationStencilClearCommand = new ClearCommand({
|
|
245
|
+
stencil: 0,
|
|
246
|
+
renderState: RenderState.fromCache({
|
|
247
|
+
stencilMask: StencilConstants.CLASSIFICATION_MASK,
|
|
248
|
+
}),
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
this._depthOnlyRenderStateCache = {};
|
|
252
|
+
|
|
253
|
+
this._transitioner = new SceneTransitioner(this);
|
|
254
|
+
|
|
255
|
+
this._preUpdate = new Event();
|
|
256
|
+
this._postUpdate = new Event();
|
|
257
|
+
|
|
258
|
+
this._renderError = new Event();
|
|
259
|
+
this._preRender = new Event();
|
|
260
|
+
this._postRender = new Event();
|
|
261
|
+
|
|
262
|
+
this._minimumDisableDepthTestDistance = 0.0;
|
|
263
|
+
this._debugInspector = new DebugInspector();
|
|
264
|
+
|
|
265
|
+
this._msaaSamples = defaultValue(options.msaaSamples, 1);
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Exceptions occurring in <code>render</code> are always caught in order to raise the
|
|
269
|
+
* <code>renderError</code> event. If this property is true, the error is rethrown
|
|
270
|
+
* after the event is raised. If this property is false, the <code>render</code> function
|
|
271
|
+
* returns normally after raising the event.
|
|
272
|
+
*
|
|
273
|
+
* @type {Boolean}
|
|
274
|
+
* @default false
|
|
275
|
+
*/
|
|
276
|
+
this.rethrowRenderErrors = false;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Determines whether or not to instantly complete the
|
|
280
|
+
* scene transition animation on user input.
|
|
281
|
+
*
|
|
282
|
+
* @type {Boolean}
|
|
283
|
+
* @default true
|
|
284
|
+
*/
|
|
285
|
+
this.completeMorphOnUserInput = true;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* The event fired at the beginning of a scene transition.
|
|
289
|
+
* @type {Event}
|
|
290
|
+
* @default Event()
|
|
291
|
+
*/
|
|
292
|
+
this.morphStart = new Event();
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* The event fired at the completion of a scene transition.
|
|
296
|
+
* @type {Event}
|
|
297
|
+
* @default Event()
|
|
298
|
+
*/
|
|
299
|
+
this.morphComplete = new Event();
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* The {@link SkyBox} used to draw the stars.
|
|
303
|
+
*
|
|
304
|
+
* @type {SkyBox}
|
|
305
|
+
* @default undefined
|
|
306
|
+
*
|
|
307
|
+
* @see Scene#backgroundColor
|
|
308
|
+
*/
|
|
309
|
+
this.skyBox = undefined;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* The sky atmosphere drawn around the globe.
|
|
313
|
+
*
|
|
314
|
+
* @type {SkyAtmosphere}
|
|
315
|
+
* @default undefined
|
|
316
|
+
*/
|
|
317
|
+
this.skyAtmosphere = undefined;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* The {@link Sun}.
|
|
321
|
+
*
|
|
322
|
+
* @type {Sun}
|
|
323
|
+
* @default undefined
|
|
324
|
+
*/
|
|
325
|
+
this.sun = undefined;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Uses a bloom filter on the sun when enabled.
|
|
329
|
+
*
|
|
330
|
+
* @type {Boolean}
|
|
331
|
+
* @default true
|
|
332
|
+
*/
|
|
333
|
+
this.sunBloom = true;
|
|
334
|
+
this._sunBloom = undefined;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* The {@link Moon}
|
|
338
|
+
*
|
|
339
|
+
* @type Moon
|
|
340
|
+
* @default undefined
|
|
341
|
+
*/
|
|
342
|
+
this.moon = undefined;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* The background color, which is only visible if there is no sky box, i.e., {@link Scene#skyBox} is undefined.
|
|
346
|
+
*
|
|
347
|
+
* @type {Color}
|
|
348
|
+
* @default {@link Color.BLACK}
|
|
349
|
+
*
|
|
350
|
+
* @see Scene#skyBox
|
|
351
|
+
*/
|
|
352
|
+
this.backgroundColor = Color.clone(Color.BLACK);
|
|
353
|
+
|
|
354
|
+
this._mode = SceneMode.SCENE3D;
|
|
355
|
+
|
|
356
|
+
this._mapProjection = defined(options.mapProjection)
|
|
357
|
+
? options.mapProjection
|
|
358
|
+
: new GeographicProjection();
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* The current morph transition time between 2D/Columbus View and 3D,
|
|
362
|
+
* with 0.0 being 2D or Columbus View and 1.0 being 3D.
|
|
363
|
+
*
|
|
364
|
+
* @type {Number}
|
|
365
|
+
* @default 1.0
|
|
366
|
+
*/
|
|
367
|
+
this.morphTime = 1.0;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* The far-to-near ratio of the multi-frustum when using a normal depth buffer.
|
|
371
|
+
* <p>
|
|
372
|
+
* This value is used to create the near and far values for each frustum of the multi-frustum. It is only used
|
|
373
|
+
* when {@link Scene#logarithmicDepthBuffer} is <code>false</code>. When <code>logarithmicDepthBuffer</code> is
|
|
374
|
+
* <code>true</code>, use {@link Scene#logarithmicDepthFarToNearRatio}.
|
|
375
|
+
* </p>
|
|
376
|
+
*
|
|
377
|
+
* @type {Number}
|
|
378
|
+
* @default 1000.0
|
|
379
|
+
*/
|
|
380
|
+
this.farToNearRatio = 1000.0;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* The far-to-near ratio of the multi-frustum when using a logarithmic depth buffer.
|
|
384
|
+
* <p>
|
|
385
|
+
* This value is used to create the near and far values for each frustum of the multi-frustum. It is only used
|
|
386
|
+
* when {@link Scene#logarithmicDepthBuffer} is <code>true</code>. When <code>logarithmicDepthBuffer</code> is
|
|
387
|
+
* <code>false</code>, use {@link Scene#farToNearRatio}.
|
|
388
|
+
* </p>
|
|
389
|
+
*
|
|
390
|
+
* @type {Number}
|
|
391
|
+
* @default 1e9
|
|
392
|
+
*/
|
|
393
|
+
this.logarithmicDepthFarToNearRatio = 1e9;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Determines the uniform depth size in meters of each frustum of the multifrustum in 2D. If a primitive or model close
|
|
397
|
+
* to the surface shows z-fighting, decreasing this will eliminate the artifact, but decrease performance. On the
|
|
398
|
+
* other hand, increasing this will increase performance but may cause z-fighting among primitives close to the surface.
|
|
399
|
+
*
|
|
400
|
+
* @type {Number}
|
|
401
|
+
* @default 1.75e6
|
|
402
|
+
*/
|
|
403
|
+
this.nearToFarDistance2D = 1.75e6;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* This property is for debugging only; it is not for production use.
|
|
407
|
+
* <p>
|
|
408
|
+
* A function that determines what commands are executed. As shown in the examples below,
|
|
409
|
+
* the function receives the command's <code>owner</code> as an argument, and returns a boolean indicating if the
|
|
410
|
+
* command should be executed.
|
|
411
|
+
* </p>
|
|
412
|
+
* <p>
|
|
413
|
+
* The default is <code>undefined</code>, indicating that all commands are executed.
|
|
414
|
+
* </p>
|
|
415
|
+
*
|
|
416
|
+
* @type Function
|
|
417
|
+
*
|
|
418
|
+
* @default undefined
|
|
419
|
+
*
|
|
420
|
+
* @example
|
|
421
|
+
* // Do not execute any commands.
|
|
422
|
+
* scene.debugCommandFilter = function(command) {
|
|
423
|
+
* return false;
|
|
424
|
+
* };
|
|
425
|
+
*
|
|
426
|
+
* // Execute only the billboard's commands. That is, only draw the billboard.
|
|
427
|
+
* const billboards = new Cesium.BillboardCollection();
|
|
428
|
+
* scene.debugCommandFilter = function(command) {
|
|
429
|
+
* return command.owner === billboards;
|
|
430
|
+
* };
|
|
431
|
+
*/
|
|
432
|
+
this.debugCommandFilter = undefined;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* This property is for debugging only; it is not for production use.
|
|
436
|
+
* <p>
|
|
437
|
+
* When <code>true</code>, commands are randomly shaded. This is useful
|
|
438
|
+
* for performance analysis to see what parts of a scene or model are
|
|
439
|
+
* command-dense and could benefit from batching.
|
|
440
|
+
* </p>
|
|
441
|
+
*
|
|
442
|
+
* @type Boolean
|
|
443
|
+
*
|
|
444
|
+
* @default false
|
|
445
|
+
*/
|
|
446
|
+
this.debugShowCommands = false;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* This property is for debugging only; it is not for production use.
|
|
450
|
+
* <p>
|
|
451
|
+
* When <code>true</code>, commands are shaded based on the frustums they
|
|
452
|
+
* overlap. Commands in the closest frustum are tinted red, commands in
|
|
453
|
+
* the next closest are green, and commands in the farthest frustum are
|
|
454
|
+
* blue. If a command overlaps more than one frustum, the color components
|
|
455
|
+
* are combined, e.g., a command overlapping the first two frustums is tinted
|
|
456
|
+
* yellow.
|
|
457
|
+
* </p>
|
|
458
|
+
*
|
|
459
|
+
* @type Boolean
|
|
460
|
+
*
|
|
461
|
+
* @default false
|
|
462
|
+
*/
|
|
463
|
+
this.debugShowFrustums = false;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* This property is for debugging only; it is not for production use.
|
|
467
|
+
* <p>
|
|
468
|
+
* Displays frames per second and time between frames.
|
|
469
|
+
* </p>
|
|
470
|
+
*
|
|
471
|
+
* @type Boolean
|
|
472
|
+
*
|
|
473
|
+
* @default false
|
|
474
|
+
*/
|
|
475
|
+
this.debugShowFramesPerSecond = false;
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* This property is for debugging only; it is not for production use.
|
|
479
|
+
* <p>
|
|
480
|
+
* Indicates which frustum will have depth information displayed.
|
|
481
|
+
* </p>
|
|
482
|
+
*
|
|
483
|
+
* @type Number
|
|
484
|
+
*
|
|
485
|
+
* @default 1
|
|
486
|
+
*/
|
|
487
|
+
this.debugShowDepthFrustum = 1;
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* This property is for debugging only; it is not for production use.
|
|
491
|
+
* <p>
|
|
492
|
+
* When <code>true</code>, draws outlines to show the boundaries of the camera frustums
|
|
493
|
+
* </p>
|
|
494
|
+
*
|
|
495
|
+
* @type Boolean
|
|
496
|
+
*
|
|
497
|
+
* @default false
|
|
498
|
+
*/
|
|
499
|
+
this.debugShowFrustumPlanes = false;
|
|
500
|
+
this._debugShowFrustumPlanes = false;
|
|
501
|
+
this._debugFrustumPlanes = undefined;
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* When <code>true</code>, enables picking using the depth buffer.
|
|
505
|
+
*
|
|
506
|
+
* @type Boolean
|
|
507
|
+
* @default true
|
|
508
|
+
*/
|
|
509
|
+
this.useDepthPicking = true;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* When <code>true</code>, enables picking translucent geometry using the depth buffer. Note that {@link Scene#useDepthPicking} must also be true for enabling this to work.
|
|
513
|
+
*
|
|
514
|
+
* <p>
|
|
515
|
+
* There is a decrease in performance when enabled. There are extra draw calls to write depth for
|
|
516
|
+
* translucent geometry.
|
|
517
|
+
* </p>
|
|
518
|
+
*
|
|
519
|
+
* @example
|
|
520
|
+
* // picking the position of a translucent primitive
|
|
521
|
+
* viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
|
|
522
|
+
* const pickedFeature = viewer.scene.pick(movement.position);
|
|
523
|
+
* if (!Cesium.defined(pickedFeature)) {
|
|
524
|
+
* // nothing picked
|
|
525
|
+
* return;
|
|
526
|
+
* }
|
|
527
|
+
* const worldPosition = viewer.scene.pickPosition(movement.position);
|
|
528
|
+
* }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
529
|
+
*
|
|
530
|
+
* @type {Boolean}
|
|
531
|
+
* @default false
|
|
532
|
+
*/
|
|
533
|
+
this.pickTranslucentDepth = false;
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* The time in milliseconds to wait before checking if the camera has not moved and fire the cameraMoveEnd event.
|
|
537
|
+
* @type {Number}
|
|
538
|
+
* @default 500.0
|
|
539
|
+
* @private
|
|
540
|
+
*/
|
|
541
|
+
this.cameraEventWaitTime = 500.0;
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
|
|
545
|
+
* performance improvements by rendering less geometry and dispatching less terrain requests.
|
|
546
|
+
* @type {Fog}
|
|
547
|
+
*/
|
|
548
|
+
this.fog = new Fog();
|
|
549
|
+
|
|
550
|
+
this._shadowMapCamera = new Camera(this);
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* The shadow map for the scene's light source. When enabled, models, primitives, and the globe may cast and receive shadows.
|
|
554
|
+
* @type {ShadowMap}
|
|
555
|
+
*/
|
|
556
|
+
this.shadowMap = new ShadowMap({
|
|
557
|
+
context: context,
|
|
558
|
+
lightCamera: this._shadowMapCamera,
|
|
559
|
+
enabled: defaultValue(options.shadows, false),
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* When <code>false</code>, 3D Tiles will render normally. When <code>true</code>, classified 3D Tile geometry will render normally and
|
|
564
|
+
* unclassified 3D Tile geometry will render with the color multiplied by {@link Scene#invertClassificationColor}.
|
|
565
|
+
* @type {Boolean}
|
|
566
|
+
* @default false
|
|
567
|
+
*/
|
|
568
|
+
this.invertClassification = false;
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* The highlight color of unclassified 3D Tile geometry when {@link Scene#invertClassification} is <code>true</code>.
|
|
572
|
+
* <p>When the color's alpha is less than 1.0, the unclassified portions of the 3D Tiles will not blend correctly with the classified positions of the 3D Tiles.</p>
|
|
573
|
+
* <p>Also, when the color's alpha is less than 1.0, the WEBGL_depth_texture and EXT_frag_depth WebGL extensions must be supported.</p>
|
|
574
|
+
* @type {Color}
|
|
575
|
+
* @default Color.WHITE
|
|
576
|
+
*/
|
|
577
|
+
this.invertClassificationColor = Color.clone(Color.WHITE);
|
|
578
|
+
|
|
579
|
+
this._actualInvertClassificationColor = Color.clone(
|
|
580
|
+
this._invertClassificationColor
|
|
581
|
+
);
|
|
582
|
+
this._invertClassification = new InvertClassification();
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* The focal length for use when with cardboard or WebVR.
|
|
586
|
+
* @type {Number}
|
|
587
|
+
*/
|
|
588
|
+
this.focalLength = undefined;
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* The eye separation distance in meters for use with cardboard or WebVR.
|
|
592
|
+
* @type {Number}
|
|
593
|
+
*/
|
|
594
|
+
this.eyeSeparation = undefined;
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Post processing effects applied to the final render.
|
|
598
|
+
* @type {PostProcessStageCollection}
|
|
599
|
+
*/
|
|
600
|
+
this.postProcessStages = new PostProcessStageCollection();
|
|
601
|
+
|
|
602
|
+
this._brdfLutGenerator = new BrdfLutGenerator();
|
|
603
|
+
|
|
604
|
+
this._performanceDisplay = undefined;
|
|
605
|
+
this._debugVolume = undefined;
|
|
606
|
+
|
|
607
|
+
this._screenSpaceCameraController = new ScreenSpaceCameraController(this);
|
|
608
|
+
this._cameraUnderground = false;
|
|
609
|
+
this._mapMode2D = defaultValue(options.mapMode2D, MapMode2D.INFINITE_SCROLL);
|
|
610
|
+
|
|
611
|
+
// Keeps track of the state of a frame. FrameState is the state across
|
|
612
|
+
// the primitives of the scene. This state is for internally keeping track
|
|
613
|
+
// of celestial and environment effects that need to be updated/rendered in
|
|
614
|
+
// a certain order as well as updating/tracking framebuffer usage.
|
|
615
|
+
this._environmentState = {
|
|
616
|
+
skyBoxCommand: undefined,
|
|
617
|
+
skyAtmosphereCommand: undefined,
|
|
618
|
+
sunDrawCommand: undefined,
|
|
619
|
+
sunComputeCommand: undefined,
|
|
620
|
+
moonCommand: undefined,
|
|
621
|
+
|
|
622
|
+
isSunVisible: false,
|
|
623
|
+
isMoonVisible: false,
|
|
624
|
+
isReadyForAtmosphere: false,
|
|
625
|
+
isSkyAtmosphereVisible: false,
|
|
626
|
+
|
|
627
|
+
clearGlobeDepth: false,
|
|
628
|
+
useDepthPlane: false,
|
|
629
|
+
renderTranslucentDepthForPick: false,
|
|
630
|
+
|
|
631
|
+
originalFramebuffer: undefined,
|
|
632
|
+
useGlobeDepthFramebuffer: false,
|
|
633
|
+
useOIT: false,
|
|
634
|
+
useInvertClassification: false,
|
|
635
|
+
usePostProcess: false,
|
|
636
|
+
usePostProcessSelected: false,
|
|
637
|
+
useWebVR: false,
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
this._useWebVR = false;
|
|
641
|
+
this._cameraVR = undefined;
|
|
642
|
+
this._aspectRatioVR = undefined;
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* When <code>true</code>, rendering a frame will only occur when needed as determined by changes within the scene.
|
|
646
|
+
* Enabling improves performance of the application, but requires using {@link Scene#requestRender}
|
|
647
|
+
* to render a new frame explicitly in this mode. This will be necessary in many cases after making changes
|
|
648
|
+
* to the scene in other parts of the API.
|
|
649
|
+
*
|
|
650
|
+
* @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}
|
|
651
|
+
* @see Scene#maximumRenderTimeChange
|
|
652
|
+
* @see Scene#requestRender
|
|
653
|
+
*
|
|
654
|
+
* @type {Boolean}
|
|
655
|
+
* @default false
|
|
656
|
+
*/
|
|
657
|
+
this.requestRenderMode = defaultValue(options.requestRenderMode, false);
|
|
658
|
+
this._renderRequested = true;
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* If {@link Scene#requestRenderMode} is <code>true</code>, this value defines the maximum change in
|
|
662
|
+
* simulation time allowed before a render is requested. Lower values increase the number of frames rendered
|
|
663
|
+
* and higher values decrease the number of frames rendered. If <code>undefined</code>, changes to
|
|
664
|
+
* the simulation time will never request a render.
|
|
665
|
+
* This value impacts the rate of rendering for changes in the scene like lighting, entity property updates,
|
|
666
|
+
* and animations.
|
|
667
|
+
*
|
|
668
|
+
* @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}
|
|
669
|
+
* @see Scene#requestRenderMode
|
|
670
|
+
*
|
|
671
|
+
* @type {Number}
|
|
672
|
+
* @default 0.0
|
|
673
|
+
*/
|
|
674
|
+
this.maximumRenderTimeChange = defaultValue(
|
|
675
|
+
options.maximumRenderTimeChange,
|
|
676
|
+
0.0
|
|
677
|
+
);
|
|
678
|
+
this._lastRenderTime = undefined;
|
|
679
|
+
this._frameRateMonitor = undefined;
|
|
680
|
+
|
|
681
|
+
this._removeRequestListenerCallback = RequestScheduler.requestCompletedEvent.addEventListener(
|
|
682
|
+
requestRenderAfterFrame(this)
|
|
683
|
+
);
|
|
684
|
+
this._removeTaskProcessorListenerCallback = TaskProcessor.taskCompletedEvent.addEventListener(
|
|
685
|
+
requestRenderAfterFrame(this)
|
|
686
|
+
);
|
|
687
|
+
this._removeGlobeCallbacks = [];
|
|
688
|
+
|
|
689
|
+
const viewport = new BoundingRectangle(
|
|
690
|
+
0,
|
|
691
|
+
0,
|
|
692
|
+
context.drawingBufferWidth,
|
|
693
|
+
context.drawingBufferHeight
|
|
694
|
+
);
|
|
695
|
+
const camera = new Camera(this);
|
|
696
|
+
|
|
697
|
+
if (this._logDepthBuffer) {
|
|
698
|
+
camera.frustum.near = 0.1;
|
|
699
|
+
camera.frustum.far = 10000000000.0;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* The camera view for the scene camera flight destination. Used for preloading flight destination tiles.
|
|
704
|
+
* @type {Camera}
|
|
705
|
+
* @private
|
|
706
|
+
*/
|
|
707
|
+
this.preloadFlightCamera = new Camera(this);
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* The culling volume for the scene camera flight destination. Used for preloading flight destination tiles.
|
|
711
|
+
* @type {CullingVolume}
|
|
712
|
+
* @private
|
|
713
|
+
*/
|
|
714
|
+
this.preloadFlightCullingVolume = undefined;
|
|
715
|
+
|
|
716
|
+
this._picking = new Picking(this);
|
|
717
|
+
this._defaultView = new View(this, camera, viewport);
|
|
718
|
+
this._view = this._defaultView;
|
|
719
|
+
|
|
720
|
+
this._hdr = undefined;
|
|
721
|
+
this._hdrDirty = undefined;
|
|
722
|
+
this.highDynamicRange = false;
|
|
723
|
+
this.gamma = 2.2;
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* The spherical harmonic coefficients for image-based lighting of PBR models.
|
|
727
|
+
* @type {Cartesian3[]}
|
|
728
|
+
*/
|
|
729
|
+
this.sphericalHarmonicCoefficients = undefined;
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* The url to the KTX2 file containing the specular environment map and convoluted mipmaps for image-based lighting of PBR models.
|
|
733
|
+
* @type {String}
|
|
734
|
+
*/
|
|
735
|
+
this.specularEnvironmentMaps = undefined;
|
|
736
|
+
this._specularEnvironmentMapAtlas = undefined;
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* The light source for shading. Defaults to a directional light from the Sun.
|
|
740
|
+
* @type {Light}
|
|
741
|
+
*/
|
|
742
|
+
this.light = new SunLight();
|
|
743
|
+
|
|
744
|
+
// Give frameState, camera, and screen space camera controller initial state before rendering
|
|
745
|
+
updateFrameNumber(this, 0.0, JulianDate.now());
|
|
746
|
+
this.updateFrameState();
|
|
747
|
+
this.initializeFrame();
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
function updateGlobeListeners(scene, globe) {
|
|
751
|
+
for (let i = 0; i < scene._removeGlobeCallbacks.length; ++i) {
|
|
752
|
+
scene._removeGlobeCallbacks[i]();
|
|
753
|
+
}
|
|
754
|
+
scene._removeGlobeCallbacks.length = 0;
|
|
755
|
+
|
|
756
|
+
const removeGlobeCallbacks = [];
|
|
757
|
+
if (defined(globe)) {
|
|
758
|
+
removeGlobeCallbacks.push(
|
|
759
|
+
globe.imageryLayersUpdatedEvent.addEventListener(
|
|
760
|
+
requestRenderAfterFrame(scene)
|
|
761
|
+
)
|
|
762
|
+
);
|
|
763
|
+
removeGlobeCallbacks.push(
|
|
764
|
+
globe.terrainProviderChanged.addEventListener(
|
|
765
|
+
requestRenderAfterFrame(scene)
|
|
766
|
+
)
|
|
767
|
+
);
|
|
768
|
+
}
|
|
769
|
+
scene._removeGlobeCallbacks = removeGlobeCallbacks;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
Object.defineProperties(Scene.prototype, {
|
|
773
|
+
/**
|
|
774
|
+
* Gets the canvas element to which this scene is bound.
|
|
775
|
+
* @memberof Scene.prototype
|
|
776
|
+
*
|
|
777
|
+
* @type {HTMLCanvasElement}
|
|
778
|
+
* @readonly
|
|
779
|
+
*/
|
|
780
|
+
canvas: {
|
|
781
|
+
get: function () {
|
|
782
|
+
return this._canvas;
|
|
783
|
+
},
|
|
784
|
+
},
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* The drawingBufferHeight of the underlying GL context.
|
|
788
|
+
* @memberof Scene.prototype
|
|
789
|
+
*
|
|
790
|
+
* @type {Number}
|
|
791
|
+
* @readonly
|
|
792
|
+
*
|
|
793
|
+
* @see {@link https://www.khronos.org/registry/webgl/specs/1.0/#DOM-WebGLRenderingContext-drawingBufferHeight|drawingBufferHeight}
|
|
794
|
+
*/
|
|
795
|
+
drawingBufferHeight: {
|
|
796
|
+
get: function () {
|
|
797
|
+
return this._context.drawingBufferHeight;
|
|
798
|
+
},
|
|
799
|
+
},
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* The drawingBufferHeight of the underlying GL context.
|
|
803
|
+
* @memberof Scene.prototype
|
|
804
|
+
*
|
|
805
|
+
* @type {Number}
|
|
806
|
+
* @readonly
|
|
807
|
+
*
|
|
808
|
+
* @see {@link https://www.khronos.org/registry/webgl/specs/1.0/#DOM-WebGLRenderingContext-drawingBufferHeight|drawingBufferHeight}
|
|
809
|
+
*/
|
|
810
|
+
drawingBufferWidth: {
|
|
811
|
+
get: function () {
|
|
812
|
+
return this._context.drawingBufferWidth;
|
|
813
|
+
},
|
|
814
|
+
},
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* The maximum aliased line width, in pixels, supported by this WebGL implementation. It will be at least one.
|
|
818
|
+
* @memberof Scene.prototype
|
|
819
|
+
*
|
|
820
|
+
* @type {Number}
|
|
821
|
+
* @readonly
|
|
822
|
+
*
|
|
823
|
+
* @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_LINE_WIDTH_RANGE</code>.
|
|
824
|
+
*/
|
|
825
|
+
maximumAliasedLineWidth: {
|
|
826
|
+
get: function () {
|
|
827
|
+
return ContextLimits.maximumAliasedLineWidth;
|
|
828
|
+
},
|
|
829
|
+
},
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* The maximum length in pixels of one edge of a cube map, supported by this WebGL implementation. It will be at least 16.
|
|
833
|
+
* @memberof Scene.prototype
|
|
834
|
+
*
|
|
835
|
+
* @type {Number}
|
|
836
|
+
* @readonly
|
|
837
|
+
*
|
|
838
|
+
* @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>GL_MAX_CUBE_MAP_TEXTURE_SIZE</code>.
|
|
839
|
+
*/
|
|
840
|
+
maximumCubeMapSize: {
|
|
841
|
+
get: function () {
|
|
842
|
+
return ContextLimits.maximumCubeMapSize;
|
|
843
|
+
},
|
|
844
|
+
},
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* Returns <code>true</code> if the {@link Scene#pickPosition} function is supported.
|
|
848
|
+
* @memberof Scene.prototype
|
|
849
|
+
*
|
|
850
|
+
* @type {Boolean}
|
|
851
|
+
* @readonly
|
|
852
|
+
*
|
|
853
|
+
* @see Scene#pickPosition
|
|
854
|
+
*/
|
|
855
|
+
pickPositionSupported: {
|
|
856
|
+
get: function () {
|
|
857
|
+
return this._context.depthTexture;
|
|
858
|
+
},
|
|
859
|
+
},
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* Returns <code>true</code> if the {@link Scene#sampleHeight} and {@link Scene#sampleHeightMostDetailed} functions are supported.
|
|
863
|
+
* @memberof Scene.prototype
|
|
864
|
+
*
|
|
865
|
+
* @type {Boolean}
|
|
866
|
+
* @readonly
|
|
867
|
+
*
|
|
868
|
+
* @see Scene#sampleHeight
|
|
869
|
+
* @see Scene#sampleHeightMostDetailed
|
|
870
|
+
*/
|
|
871
|
+
sampleHeightSupported: {
|
|
872
|
+
get: function () {
|
|
873
|
+
return this._context.depthTexture;
|
|
874
|
+
},
|
|
875
|
+
},
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* Returns <code>true</code> if the {@link Scene#clampToHeight} and {@link Scene#clampToHeightMostDetailed} functions are supported.
|
|
879
|
+
* @memberof Scene.prototype
|
|
880
|
+
*
|
|
881
|
+
* @type {Boolean}
|
|
882
|
+
* @readonly
|
|
883
|
+
*
|
|
884
|
+
* @see Scene#clampToHeight
|
|
885
|
+
* @see Scene#clampToHeightMostDetailed
|
|
886
|
+
*/
|
|
887
|
+
clampToHeightSupported: {
|
|
888
|
+
get: function () {
|
|
889
|
+
return this._context.depthTexture;
|
|
890
|
+
},
|
|
891
|
+
},
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* Returns <code>true</code> if the {@link Scene#invertClassification} is supported.
|
|
895
|
+
* @memberof Scene.prototype
|
|
896
|
+
*
|
|
897
|
+
* @type {Boolean}
|
|
898
|
+
* @readonly
|
|
899
|
+
*
|
|
900
|
+
* @see Scene#invertClassification
|
|
901
|
+
*/
|
|
902
|
+
invertClassificationSupported: {
|
|
903
|
+
get: function () {
|
|
904
|
+
return this._context.depthTexture;
|
|
905
|
+
},
|
|
906
|
+
},
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* Returns <code>true</code> if specular environment maps are supported.
|
|
910
|
+
* @memberof Scene.prototype
|
|
911
|
+
*
|
|
912
|
+
* @type {Boolean}
|
|
913
|
+
* @readonly
|
|
914
|
+
*
|
|
915
|
+
* @see Scene#specularEnvironmentMaps
|
|
916
|
+
*/
|
|
917
|
+
specularEnvironmentMapsSupported: {
|
|
918
|
+
get: function () {
|
|
919
|
+
return OctahedralProjectedCubeMap.isSupported(this._context);
|
|
920
|
+
},
|
|
921
|
+
},
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* Gets or sets the depth-test ellipsoid.
|
|
925
|
+
* @memberof Scene.prototype
|
|
926
|
+
*
|
|
927
|
+
* @type {Globe}
|
|
928
|
+
*/
|
|
929
|
+
globe: {
|
|
930
|
+
get: function () {
|
|
931
|
+
return this._globe;
|
|
932
|
+
},
|
|
933
|
+
|
|
934
|
+
set: function (globe) {
|
|
935
|
+
this._globe = this._globe && this._globe.destroy();
|
|
936
|
+
this._globe = globe;
|
|
937
|
+
|
|
938
|
+
updateGlobeListeners(this, globe);
|
|
939
|
+
},
|
|
940
|
+
},
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* Gets the collection of primitives.
|
|
944
|
+
* @memberof Scene.prototype
|
|
945
|
+
*
|
|
946
|
+
* @type {PrimitiveCollection}
|
|
947
|
+
* @readonly
|
|
948
|
+
*/
|
|
949
|
+
primitives: {
|
|
950
|
+
get: function () {
|
|
951
|
+
return this._primitives;
|
|
952
|
+
},
|
|
953
|
+
},
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* Gets the collection of ground primitives.
|
|
957
|
+
* @memberof Scene.prototype
|
|
958
|
+
*
|
|
959
|
+
* @type {PrimitiveCollection}
|
|
960
|
+
* @readonly
|
|
961
|
+
*/
|
|
962
|
+
groundPrimitives: {
|
|
963
|
+
get: function () {
|
|
964
|
+
return this._groundPrimitives;
|
|
965
|
+
},
|
|
966
|
+
},
|
|
967
|
+
|
|
968
|
+
/**
|
|
969
|
+
* Gets or sets the camera.
|
|
970
|
+
* @memberof Scene.prototype
|
|
971
|
+
*
|
|
972
|
+
* @type {Camera}
|
|
973
|
+
* @readonly
|
|
974
|
+
*/
|
|
975
|
+
camera: {
|
|
976
|
+
get: function () {
|
|
977
|
+
return this._view.camera;
|
|
978
|
+
},
|
|
979
|
+
set: function (camera) {
|
|
980
|
+
// For internal use only. Documentation is still @readonly.
|
|
981
|
+
this._view.camera = camera;
|
|
982
|
+
},
|
|
983
|
+
},
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* Gets or sets the view.
|
|
987
|
+
* @memberof Scene.prototype
|
|
988
|
+
*
|
|
989
|
+
* @type {View}
|
|
990
|
+
* @readonly
|
|
991
|
+
*
|
|
992
|
+
* @private
|
|
993
|
+
*/
|
|
994
|
+
view: {
|
|
995
|
+
get: function () {
|
|
996
|
+
return this._view;
|
|
997
|
+
},
|
|
998
|
+
set: function (view) {
|
|
999
|
+
// For internal use only. Documentation is still @readonly.
|
|
1000
|
+
this._view = view;
|
|
1001
|
+
},
|
|
1002
|
+
},
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* Gets the default view.
|
|
1006
|
+
* @memberof Scene.prototype
|
|
1007
|
+
*
|
|
1008
|
+
* @type {View}
|
|
1009
|
+
* @readonly
|
|
1010
|
+
*
|
|
1011
|
+
* @private
|
|
1012
|
+
*/
|
|
1013
|
+
defaultView: {
|
|
1014
|
+
get: function () {
|
|
1015
|
+
return this._defaultView;
|
|
1016
|
+
},
|
|
1017
|
+
},
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* Gets picking functions and state
|
|
1021
|
+
* @memberof Scene.prototype
|
|
1022
|
+
*
|
|
1023
|
+
* @type {Picking}
|
|
1024
|
+
* @readonly
|
|
1025
|
+
*
|
|
1026
|
+
* @private
|
|
1027
|
+
*/
|
|
1028
|
+
picking: {
|
|
1029
|
+
get: function () {
|
|
1030
|
+
return this._picking;
|
|
1031
|
+
},
|
|
1032
|
+
},
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* Gets the controller for camera input handling.
|
|
1036
|
+
* @memberof Scene.prototype
|
|
1037
|
+
*
|
|
1038
|
+
* @type {ScreenSpaceCameraController}
|
|
1039
|
+
* @readonly
|
|
1040
|
+
*/
|
|
1041
|
+
screenSpaceCameraController: {
|
|
1042
|
+
get: function () {
|
|
1043
|
+
return this._screenSpaceCameraController;
|
|
1044
|
+
},
|
|
1045
|
+
},
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* Get the map projection to use in 2D and Columbus View modes.
|
|
1049
|
+
* @memberof Scene.prototype
|
|
1050
|
+
*
|
|
1051
|
+
* @type {MapProjection}
|
|
1052
|
+
* @readonly
|
|
1053
|
+
*
|
|
1054
|
+
* @default new GeographicProjection()
|
|
1055
|
+
*/
|
|
1056
|
+
mapProjection: {
|
|
1057
|
+
get: function () {
|
|
1058
|
+
return this._mapProjection;
|
|
1059
|
+
},
|
|
1060
|
+
},
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* Gets the job scheduler
|
|
1064
|
+
* @memberof Scene.prototype
|
|
1065
|
+
* @type {JobScheduler}
|
|
1066
|
+
* @readonly
|
|
1067
|
+
*
|
|
1068
|
+
* @private
|
|
1069
|
+
*/
|
|
1070
|
+
jobScheduler: {
|
|
1071
|
+
get: function () {
|
|
1072
|
+
return this._jobScheduler;
|
|
1073
|
+
},
|
|
1074
|
+
},
|
|
1075
|
+
|
|
1076
|
+
/**
|
|
1077
|
+
* Gets state information about the current scene. If called outside of a primitive's <code>update</code>
|
|
1078
|
+
* function, the previous frame's state is returned.
|
|
1079
|
+
* @memberof Scene.prototype
|
|
1080
|
+
*
|
|
1081
|
+
* @type {FrameState}
|
|
1082
|
+
* @readonly
|
|
1083
|
+
*
|
|
1084
|
+
* @private
|
|
1085
|
+
*/
|
|
1086
|
+
frameState: {
|
|
1087
|
+
get: function () {
|
|
1088
|
+
return this._frameState;
|
|
1089
|
+
},
|
|
1090
|
+
},
|
|
1091
|
+
|
|
1092
|
+
/**
|
|
1093
|
+
* Gets the environment state.
|
|
1094
|
+
* @memberof Scene.prototype
|
|
1095
|
+
*
|
|
1096
|
+
* @type {EnvironmentState}
|
|
1097
|
+
* @readonly
|
|
1098
|
+
*
|
|
1099
|
+
* @private
|
|
1100
|
+
*/
|
|
1101
|
+
environmentState: {
|
|
1102
|
+
get: function () {
|
|
1103
|
+
return this._environmentState;
|
|
1104
|
+
},
|
|
1105
|
+
},
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* Gets the collection of tweens taking place in the scene.
|
|
1109
|
+
* @memberof Scene.prototype
|
|
1110
|
+
*
|
|
1111
|
+
* @type {TweenCollection}
|
|
1112
|
+
* @readonly
|
|
1113
|
+
*
|
|
1114
|
+
* @private
|
|
1115
|
+
*/
|
|
1116
|
+
tweens: {
|
|
1117
|
+
get: function () {
|
|
1118
|
+
return this._tweens;
|
|
1119
|
+
},
|
|
1120
|
+
},
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* Gets the collection of image layers that will be rendered on the globe.
|
|
1124
|
+
* @memberof Scene.prototype
|
|
1125
|
+
*
|
|
1126
|
+
* @type {ImageryLayerCollection}
|
|
1127
|
+
* @readonly
|
|
1128
|
+
*/
|
|
1129
|
+
imageryLayers: {
|
|
1130
|
+
get: function () {
|
|
1131
|
+
if (!defined(this.globe)) {
|
|
1132
|
+
return undefined;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
return this.globe.imageryLayers;
|
|
1136
|
+
},
|
|
1137
|
+
},
|
|
1138
|
+
|
|
1139
|
+
/**
|
|
1140
|
+
* The terrain provider providing surface geometry for the globe.
|
|
1141
|
+
* @memberof Scene.prototype
|
|
1142
|
+
*
|
|
1143
|
+
* @type {TerrainProvider}
|
|
1144
|
+
*/
|
|
1145
|
+
terrainProvider: {
|
|
1146
|
+
get: function () {
|
|
1147
|
+
if (!defined(this.globe)) {
|
|
1148
|
+
return undefined;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
return this.globe.terrainProvider;
|
|
1152
|
+
},
|
|
1153
|
+
set: function (terrainProvider) {
|
|
1154
|
+
if (defined(this.globe)) {
|
|
1155
|
+
this.globe.terrainProvider = terrainProvider;
|
|
1156
|
+
}
|
|
1157
|
+
},
|
|
1158
|
+
},
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* Gets an event that's raised when the terrain provider is changed
|
|
1162
|
+
* @memberof Scene.prototype
|
|
1163
|
+
*
|
|
1164
|
+
* @type {Event}
|
|
1165
|
+
* @readonly
|
|
1166
|
+
*/
|
|
1167
|
+
terrainProviderChanged: {
|
|
1168
|
+
get: function () {
|
|
1169
|
+
if (!defined(this.globe)) {
|
|
1170
|
+
return undefined;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
return this.globe.terrainProviderChanged;
|
|
1174
|
+
},
|
|
1175
|
+
},
|
|
1176
|
+
|
|
1177
|
+
/**
|
|
1178
|
+
* Gets the event that will be raised before the scene is updated or rendered. Subscribers to the event
|
|
1179
|
+
* receive the Scene instance as the first parameter and the current time as the second parameter.
|
|
1180
|
+
* @memberof Scene.prototype
|
|
1181
|
+
*
|
|
1182
|
+
* @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}
|
|
1183
|
+
* @see Scene#postUpdate
|
|
1184
|
+
* @see Scene#preRender
|
|
1185
|
+
* @see Scene#postRender
|
|
1186
|
+
*
|
|
1187
|
+
* @type {Event}
|
|
1188
|
+
* @readonly
|
|
1189
|
+
*/
|
|
1190
|
+
preUpdate: {
|
|
1191
|
+
get: function () {
|
|
1192
|
+
return this._preUpdate;
|
|
1193
|
+
},
|
|
1194
|
+
},
|
|
1195
|
+
|
|
1196
|
+
/**
|
|
1197
|
+
* Gets the event that will be raised immediately after the scene is updated and before the scene is rendered.
|
|
1198
|
+
* Subscribers to the event receive the Scene instance as the first parameter and the current time as the second
|
|
1199
|
+
* parameter.
|
|
1200
|
+
* @memberof Scene.prototype
|
|
1201
|
+
*
|
|
1202
|
+
* @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}
|
|
1203
|
+
* @see Scene#preUpdate
|
|
1204
|
+
* @see Scene#preRender
|
|
1205
|
+
* @see Scene#postRender
|
|
1206
|
+
*
|
|
1207
|
+
* @type {Event}
|
|
1208
|
+
* @readonly
|
|
1209
|
+
*/
|
|
1210
|
+
postUpdate: {
|
|
1211
|
+
get: function () {
|
|
1212
|
+
return this._postUpdate;
|
|
1213
|
+
},
|
|
1214
|
+
},
|
|
1215
|
+
|
|
1216
|
+
/**
|
|
1217
|
+
* Gets the event that will be raised when an error is thrown inside the <code>render</code> function.
|
|
1218
|
+
* The Scene instance and the thrown error are the only two parameters passed to the event handler.
|
|
1219
|
+
* By default, errors are not rethrown after this event is raised, but that can be changed by setting
|
|
1220
|
+
* the <code>rethrowRenderErrors</code> property.
|
|
1221
|
+
* @memberof Scene.prototype
|
|
1222
|
+
*
|
|
1223
|
+
* @type {Event}
|
|
1224
|
+
* @readonly
|
|
1225
|
+
*/
|
|
1226
|
+
renderError: {
|
|
1227
|
+
get: function () {
|
|
1228
|
+
return this._renderError;
|
|
1229
|
+
},
|
|
1230
|
+
},
|
|
1231
|
+
|
|
1232
|
+
/**
|
|
1233
|
+
* Gets the event that will be raised after the scene is updated and immediately before the scene is rendered.
|
|
1234
|
+
* Subscribers to the event receive the Scene instance as the first parameter and the current time as the second
|
|
1235
|
+
* parameter.
|
|
1236
|
+
* @memberof Scene.prototype
|
|
1237
|
+
*
|
|
1238
|
+
* @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}
|
|
1239
|
+
* @see Scene#preUpdate
|
|
1240
|
+
* @see Scene#postUpdate
|
|
1241
|
+
* @see Scene#postRender
|
|
1242
|
+
*
|
|
1243
|
+
* @type {Event}
|
|
1244
|
+
* @readonly
|
|
1245
|
+
*/
|
|
1246
|
+
preRender: {
|
|
1247
|
+
get: function () {
|
|
1248
|
+
return this._preRender;
|
|
1249
|
+
},
|
|
1250
|
+
},
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* Gets the event that will be raised immediately after the scene is rendered. Subscribers to the event
|
|
1254
|
+
* receive the Scene instance as the first parameter and the current time as the second parameter.
|
|
1255
|
+
* @memberof Scene.prototype
|
|
1256
|
+
*
|
|
1257
|
+
* @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}
|
|
1258
|
+
* @see Scene#preUpdate
|
|
1259
|
+
* @see Scene#postUpdate
|
|
1260
|
+
* @see Scene#postRender
|
|
1261
|
+
*
|
|
1262
|
+
* @type {Event}
|
|
1263
|
+
* @readonly
|
|
1264
|
+
*/
|
|
1265
|
+
postRender: {
|
|
1266
|
+
get: function () {
|
|
1267
|
+
return this._postRender;
|
|
1268
|
+
},
|
|
1269
|
+
},
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* Gets the simulation time when the scene was last rendered. Returns undefined if the scene has not yet been
|
|
1273
|
+
* rendered.
|
|
1274
|
+
* @memberof Scene.prototype
|
|
1275
|
+
*
|
|
1276
|
+
* @type {JulianDate}
|
|
1277
|
+
* @readonly
|
|
1278
|
+
*/
|
|
1279
|
+
lastRenderTime: {
|
|
1280
|
+
get: function () {
|
|
1281
|
+
return this._lastRenderTime;
|
|
1282
|
+
},
|
|
1283
|
+
},
|
|
1284
|
+
|
|
1285
|
+
/**
|
|
1286
|
+
* @memberof Scene.prototype
|
|
1287
|
+
* @private
|
|
1288
|
+
* @readonly
|
|
1289
|
+
*/
|
|
1290
|
+
context: {
|
|
1291
|
+
get: function () {
|
|
1292
|
+
return this._context;
|
|
1293
|
+
},
|
|
1294
|
+
},
|
|
1295
|
+
|
|
1296
|
+
/**
|
|
1297
|
+
* This property is for debugging only; it is not for production use.
|
|
1298
|
+
* <p>
|
|
1299
|
+
* When {@link Scene.debugShowFrustums} is <code>true</code>, this contains
|
|
1300
|
+
* properties with statistics about the number of command execute per frustum.
|
|
1301
|
+
* <code>totalCommands</code> is the total number of commands executed, ignoring
|
|
1302
|
+
* overlap. <code>commandsInFrustums</code> is an array with the number of times
|
|
1303
|
+
* commands are executed redundantly, e.g., how many commands overlap two or
|
|
1304
|
+
* three frustums.
|
|
1305
|
+
* </p>
|
|
1306
|
+
*
|
|
1307
|
+
* @memberof Scene.prototype
|
|
1308
|
+
*
|
|
1309
|
+
* @type {Object}
|
|
1310
|
+
* @readonly
|
|
1311
|
+
*
|
|
1312
|
+
* @default undefined
|
|
1313
|
+
*/
|
|
1314
|
+
debugFrustumStatistics: {
|
|
1315
|
+
get: function () {
|
|
1316
|
+
return this._view.debugFrustumStatistics;
|
|
1317
|
+
},
|
|
1318
|
+
},
|
|
1319
|
+
|
|
1320
|
+
/**
|
|
1321
|
+
* Gets whether or not the scene is optimized for 3D only viewing.
|
|
1322
|
+
* @memberof Scene.prototype
|
|
1323
|
+
* @type {Boolean}
|
|
1324
|
+
* @readonly
|
|
1325
|
+
*/
|
|
1326
|
+
scene3DOnly: {
|
|
1327
|
+
get: function () {
|
|
1328
|
+
return this._frameState.scene3DOnly;
|
|
1329
|
+
},
|
|
1330
|
+
},
|
|
1331
|
+
|
|
1332
|
+
/**
|
|
1333
|
+
* Gets whether or not the scene has order independent translucency enabled.
|
|
1334
|
+
* Note that this only reflects the original construction option, and there are
|
|
1335
|
+
* other factors that could prevent OIT from functioning on a given system configuration.
|
|
1336
|
+
* @memberof Scene.prototype
|
|
1337
|
+
* @type {Boolean}
|
|
1338
|
+
* @readonly
|
|
1339
|
+
*/
|
|
1340
|
+
orderIndependentTranslucency: {
|
|
1341
|
+
get: function () {
|
|
1342
|
+
return this._useOIT;
|
|
1343
|
+
},
|
|
1344
|
+
},
|
|
1345
|
+
|
|
1346
|
+
/**
|
|
1347
|
+
* Gets the unique identifier for this scene.
|
|
1348
|
+
* @memberof Scene.prototype
|
|
1349
|
+
* @type {String}
|
|
1350
|
+
* @readonly
|
|
1351
|
+
*/
|
|
1352
|
+
id: {
|
|
1353
|
+
get: function () {
|
|
1354
|
+
return this._id;
|
|
1355
|
+
},
|
|
1356
|
+
},
|
|
1357
|
+
|
|
1358
|
+
/**
|
|
1359
|
+
* Gets or sets the current mode of the scene.
|
|
1360
|
+
* @memberof Scene.prototype
|
|
1361
|
+
* @type {SceneMode}
|
|
1362
|
+
* @default {@link SceneMode.SCENE3D}
|
|
1363
|
+
*/
|
|
1364
|
+
mode: {
|
|
1365
|
+
get: function () {
|
|
1366
|
+
return this._mode;
|
|
1367
|
+
},
|
|
1368
|
+
set: function (value) {
|
|
1369
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1370
|
+
if (this.scene3DOnly && value !== SceneMode.SCENE3D) {
|
|
1371
|
+
throw new DeveloperError(
|
|
1372
|
+
"Only SceneMode.SCENE3D is valid when scene3DOnly is true."
|
|
1373
|
+
);
|
|
1374
|
+
}
|
|
1375
|
+
//>>includeEnd('debug');
|
|
1376
|
+
if (value === SceneMode.SCENE2D) {
|
|
1377
|
+
this.morphTo2D(0);
|
|
1378
|
+
} else if (value === SceneMode.SCENE3D) {
|
|
1379
|
+
this.morphTo3D(0);
|
|
1380
|
+
} else if (value === SceneMode.COLUMBUS_VIEW) {
|
|
1381
|
+
this.morphToColumbusView(0);
|
|
1382
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1383
|
+
} else {
|
|
1384
|
+
throw new DeveloperError(
|
|
1385
|
+
"value must be a valid SceneMode enumeration."
|
|
1386
|
+
);
|
|
1387
|
+
//>>includeEnd('debug');
|
|
1388
|
+
}
|
|
1389
|
+
this._mode = value;
|
|
1390
|
+
},
|
|
1391
|
+
},
|
|
1392
|
+
|
|
1393
|
+
/**
|
|
1394
|
+
* Gets the number of frustums used in the last frame.
|
|
1395
|
+
* @memberof Scene.prototype
|
|
1396
|
+
* @type {FrustumCommands[]}
|
|
1397
|
+
*
|
|
1398
|
+
* @private
|
|
1399
|
+
*/
|
|
1400
|
+
frustumCommandsList: {
|
|
1401
|
+
get: function () {
|
|
1402
|
+
return this._view.frustumCommandsList;
|
|
1403
|
+
},
|
|
1404
|
+
},
|
|
1405
|
+
|
|
1406
|
+
/**
|
|
1407
|
+
* Gets the number of frustums used in the last frame.
|
|
1408
|
+
* @memberof Scene.prototype
|
|
1409
|
+
* @type {Number}
|
|
1410
|
+
*
|
|
1411
|
+
* @private
|
|
1412
|
+
*/
|
|
1413
|
+
numberOfFrustums: {
|
|
1414
|
+
get: function () {
|
|
1415
|
+
return this._view.frustumCommandsList.length;
|
|
1416
|
+
},
|
|
1417
|
+
},
|
|
1418
|
+
|
|
1419
|
+
/**
|
|
1420
|
+
* When <code>true</code>, splits the scene into two viewports with steroscopic views for the left and right eyes.
|
|
1421
|
+
* Used for cardboard and WebVR.
|
|
1422
|
+
* @memberof Scene.prototype
|
|
1423
|
+
* @type {Boolean}
|
|
1424
|
+
* @default false
|
|
1425
|
+
*/
|
|
1426
|
+
useWebVR: {
|
|
1427
|
+
get: function () {
|
|
1428
|
+
return this._useWebVR;
|
|
1429
|
+
},
|
|
1430
|
+
set: function (value) {
|
|
1431
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1432
|
+
if (this.camera.frustum instanceof OrthographicFrustum) {
|
|
1433
|
+
throw new DeveloperError(
|
|
1434
|
+
"VR is unsupported with an orthographic projection."
|
|
1435
|
+
);
|
|
1436
|
+
}
|
|
1437
|
+
//>>includeEnd('debug');
|
|
1438
|
+
this._useWebVR = value;
|
|
1439
|
+
if (this._useWebVR) {
|
|
1440
|
+
this._frameState.creditDisplay.container.style.visibility = "hidden";
|
|
1441
|
+
this._cameraVR = new Camera(this);
|
|
1442
|
+
if (!defined(this._deviceOrientationCameraController)) {
|
|
1443
|
+
this._deviceOrientationCameraController = new DeviceOrientationCameraController(
|
|
1444
|
+
this
|
|
1445
|
+
);
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
this._aspectRatioVR = this.camera.frustum.aspectRatio;
|
|
1449
|
+
} else {
|
|
1450
|
+
this._frameState.creditDisplay.container.style.visibility = "visible";
|
|
1451
|
+
this._cameraVR = undefined;
|
|
1452
|
+
this._deviceOrientationCameraController =
|
|
1453
|
+
this._deviceOrientationCameraController &&
|
|
1454
|
+
!this._deviceOrientationCameraController.isDestroyed() &&
|
|
1455
|
+
this._deviceOrientationCameraController.destroy();
|
|
1456
|
+
|
|
1457
|
+
this.camera.frustum.aspectRatio = this._aspectRatioVR;
|
|
1458
|
+
this.camera.frustum.xOffset = 0.0;
|
|
1459
|
+
}
|
|
1460
|
+
},
|
|
1461
|
+
},
|
|
1462
|
+
|
|
1463
|
+
/**
|
|
1464
|
+
* Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
|
|
1465
|
+
* @memberof Scene.prototype
|
|
1466
|
+
* @type {MapMode2D}
|
|
1467
|
+
* @readonly
|
|
1468
|
+
*/
|
|
1469
|
+
mapMode2D: {
|
|
1470
|
+
get: function () {
|
|
1471
|
+
return this._mapMode2D;
|
|
1472
|
+
},
|
|
1473
|
+
},
|
|
1474
|
+
|
|
1475
|
+
/**
|
|
1476
|
+
* Gets or sets the position of the splitter within the viewport. Valid values are between 0.0 and 1.0.
|
|
1477
|
+
* @memberof Scene.prototype
|
|
1478
|
+
*
|
|
1479
|
+
* @type {Number}
|
|
1480
|
+
*/
|
|
1481
|
+
splitPosition: {
|
|
1482
|
+
get: function () {
|
|
1483
|
+
return this._frameState.splitPosition;
|
|
1484
|
+
},
|
|
1485
|
+
set: function (value) {
|
|
1486
|
+
this._frameState.splitPosition = value;
|
|
1487
|
+
},
|
|
1488
|
+
},
|
|
1489
|
+
|
|
1490
|
+
/**
|
|
1491
|
+
* The distance from the camera at which to disable the depth test of billboards, labels and points
|
|
1492
|
+
* to, for example, prevent clipping against terrain. When set to zero, the depth test should always
|
|
1493
|
+
* be applied. When less than zero, the depth test should never be applied. Setting the disableDepthTestDistance
|
|
1494
|
+
* property of a billboard, label or point will override this value.
|
|
1495
|
+
* @memberof Scene.prototype
|
|
1496
|
+
* @type {Number}
|
|
1497
|
+
* @default 0.0
|
|
1498
|
+
*/
|
|
1499
|
+
minimumDisableDepthTestDistance: {
|
|
1500
|
+
get: function () {
|
|
1501
|
+
return this._minimumDisableDepthTestDistance;
|
|
1502
|
+
},
|
|
1503
|
+
set: function (value) {
|
|
1504
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1505
|
+
if (!defined(value) || value < 0.0) {
|
|
1506
|
+
throw new DeveloperError(
|
|
1507
|
+
"minimumDisableDepthTestDistance must be greater than or equal to 0.0."
|
|
1508
|
+
);
|
|
1509
|
+
}
|
|
1510
|
+
//>>includeEnd('debug');
|
|
1511
|
+
this._minimumDisableDepthTestDistance = value;
|
|
1512
|
+
},
|
|
1513
|
+
},
|
|
1514
|
+
|
|
1515
|
+
/**
|
|
1516
|
+
* Whether or not to use a logarithmic depth buffer. Enabling this option will allow for less frustums in the multi-frustum,
|
|
1517
|
+
* increasing performance. This property relies on fragmentDepth being supported.
|
|
1518
|
+
* @memberof Scene.prototype
|
|
1519
|
+
* @type {Boolean}
|
|
1520
|
+
*/
|
|
1521
|
+
logarithmicDepthBuffer: {
|
|
1522
|
+
get: function () {
|
|
1523
|
+
return this._logDepthBuffer;
|
|
1524
|
+
},
|
|
1525
|
+
set: function (value) {
|
|
1526
|
+
value = this._context.fragmentDepth && value;
|
|
1527
|
+
if (this._logDepthBuffer !== value) {
|
|
1528
|
+
this._logDepthBuffer = value;
|
|
1529
|
+
this._logDepthBufferDirty = true;
|
|
1530
|
+
}
|
|
1531
|
+
},
|
|
1532
|
+
},
|
|
1533
|
+
|
|
1534
|
+
/**
|
|
1535
|
+
* The value used for gamma correction. This is only used when rendering with high dynamic range.
|
|
1536
|
+
* @memberof Scene.prototype
|
|
1537
|
+
* @type {Number}
|
|
1538
|
+
* @default 2.2
|
|
1539
|
+
*/
|
|
1540
|
+
gamma: {
|
|
1541
|
+
get: function () {
|
|
1542
|
+
return this._context.uniformState.gamma;
|
|
1543
|
+
},
|
|
1544
|
+
set: function (value) {
|
|
1545
|
+
this._context.uniformState.gamma = value;
|
|
1546
|
+
},
|
|
1547
|
+
},
|
|
1548
|
+
|
|
1549
|
+
/**
|
|
1550
|
+
* Whether or not to use high dynamic range rendering.
|
|
1551
|
+
* @memberof Scene.prototype
|
|
1552
|
+
* @type {Boolean}
|
|
1553
|
+
* @default false
|
|
1554
|
+
*/
|
|
1555
|
+
highDynamicRange: {
|
|
1556
|
+
get: function () {
|
|
1557
|
+
return this._hdr;
|
|
1558
|
+
},
|
|
1559
|
+
set: function (value) {
|
|
1560
|
+
const context = this._context;
|
|
1561
|
+
const hdr =
|
|
1562
|
+
value &&
|
|
1563
|
+
context.depthTexture &&
|
|
1564
|
+
(context.colorBufferFloat || context.colorBufferHalfFloat);
|
|
1565
|
+
this._hdrDirty = hdr !== this._hdr;
|
|
1566
|
+
this._hdr = hdr;
|
|
1567
|
+
},
|
|
1568
|
+
},
|
|
1569
|
+
|
|
1570
|
+
/**
|
|
1571
|
+
* Whether or not high dynamic range rendering is supported.
|
|
1572
|
+
* @memberof Scene.prototype
|
|
1573
|
+
* @type {Boolean}
|
|
1574
|
+
* @readonly
|
|
1575
|
+
* @default true
|
|
1576
|
+
*/
|
|
1577
|
+
highDynamicRangeSupported: {
|
|
1578
|
+
get: function () {
|
|
1579
|
+
const context = this._context;
|
|
1580
|
+
return (
|
|
1581
|
+
context.depthTexture &&
|
|
1582
|
+
(context.colorBufferFloat || context.colorBufferHalfFloat)
|
|
1583
|
+
);
|
|
1584
|
+
},
|
|
1585
|
+
},
|
|
1586
|
+
|
|
1587
|
+
/**
|
|
1588
|
+
* Whether or not the camera is underneath the globe.
|
|
1589
|
+
* @memberof Scene.prototype
|
|
1590
|
+
* @type {Boolean}
|
|
1591
|
+
* @readonly
|
|
1592
|
+
* @default false
|
|
1593
|
+
*/
|
|
1594
|
+
cameraUnderground: {
|
|
1595
|
+
get: function () {
|
|
1596
|
+
return this._cameraUnderground;
|
|
1597
|
+
},
|
|
1598
|
+
},
|
|
1599
|
+
|
|
1600
|
+
/**
|
|
1601
|
+
* The sample rate of multisample antialiasing (values greater than 1 enable MSAA).
|
|
1602
|
+
* @memberof Scene.prototype
|
|
1603
|
+
* @type {Number}
|
|
1604
|
+
* @default 1
|
|
1605
|
+
*/
|
|
1606
|
+
msaaSamples: {
|
|
1607
|
+
get: function () {
|
|
1608
|
+
return this._msaaSamples;
|
|
1609
|
+
},
|
|
1610
|
+
set: function (value) {
|
|
1611
|
+
value = Math.min(value, ContextLimits.maximumSamples);
|
|
1612
|
+
this._msaaSamples = value;
|
|
1613
|
+
},
|
|
1614
|
+
},
|
|
1615
|
+
|
|
1616
|
+
/**
|
|
1617
|
+
* Returns <code>true</code> if the Scene's context supports MSAA.
|
|
1618
|
+
* @memberof Scene.prototype
|
|
1619
|
+
* @type {Boolean}
|
|
1620
|
+
* @readonly
|
|
1621
|
+
*/
|
|
1622
|
+
msaaSupported: {
|
|
1623
|
+
get: function () {
|
|
1624
|
+
return this._context.msaa;
|
|
1625
|
+
},
|
|
1626
|
+
},
|
|
1627
|
+
|
|
1628
|
+
/**
|
|
1629
|
+
* Ratio between a pixel and a density-independent pixel. Provides a standard unit of
|
|
1630
|
+
* measure for real pixel measurements appropriate to a particular device.
|
|
1631
|
+
*
|
|
1632
|
+
* @memberof Scene.prototype
|
|
1633
|
+
* @type {Number}
|
|
1634
|
+
* @default 1.0
|
|
1635
|
+
* @private
|
|
1636
|
+
*/
|
|
1637
|
+
pixelRatio: {
|
|
1638
|
+
get: function () {
|
|
1639
|
+
return this._frameState.pixelRatio;
|
|
1640
|
+
},
|
|
1641
|
+
set: function (value) {
|
|
1642
|
+
this._frameState.pixelRatio = value;
|
|
1643
|
+
},
|
|
1644
|
+
},
|
|
1645
|
+
|
|
1646
|
+
/**
|
|
1647
|
+
* @private
|
|
1648
|
+
*/
|
|
1649
|
+
opaqueFrustumNearOffset: {
|
|
1650
|
+
get: function () {
|
|
1651
|
+
return 0.9999;
|
|
1652
|
+
},
|
|
1653
|
+
},
|
|
1654
|
+
|
|
1655
|
+
/**
|
|
1656
|
+
* @private
|
|
1657
|
+
*/
|
|
1658
|
+
globeHeight: {
|
|
1659
|
+
get: function () {
|
|
1660
|
+
return this._globeHeight;
|
|
1661
|
+
},
|
|
1662
|
+
},
|
|
1663
|
+
});
|
|
1664
|
+
|
|
1665
|
+
/**
|
|
1666
|
+
* Determines if a compressed texture format is supported.
|
|
1667
|
+
* @param {String} format The texture format. May be the name of the format or the WebGL extension name, e.g. s3tc or WEBGL_compressed_texture_s3tc.
|
|
1668
|
+
* @return {boolean} Whether or not the format is supported.
|
|
1669
|
+
*/
|
|
1670
|
+
Scene.prototype.getCompressedTextureFormatSupported = function (format) {
|
|
1671
|
+
const context = this.context;
|
|
1672
|
+
return (
|
|
1673
|
+
((format === "WEBGL_compressed_texture_s3tc" || format === "s3tc") &&
|
|
1674
|
+
context.s3tc) ||
|
|
1675
|
+
((format === "WEBGL_compressed_texture_pvrtc" || format === "pvrtc") &&
|
|
1676
|
+
context.pvrtc) ||
|
|
1677
|
+
((format === "WEBGL_compressed_texture_etc" || format === "etc") &&
|
|
1678
|
+
context.etc) ||
|
|
1679
|
+
((format === "WEBGL_compressed_texture_etc1" || format === "etc1") &&
|
|
1680
|
+
context.etc1) ||
|
|
1681
|
+
((format === "WEBGL_compressed_texture_astc" || format === "astc") &&
|
|
1682
|
+
context.astc) ||
|
|
1683
|
+
((format === "EXT_texture_compression_bptc" || format === "bc7") &&
|
|
1684
|
+
context.bc7)
|
|
1685
|
+
);
|
|
1686
|
+
};
|
|
1687
|
+
|
|
1688
|
+
function updateDerivedCommands(scene, command, shadowsDirty) {
|
|
1689
|
+
const frameState = scene._frameState;
|
|
1690
|
+
const context = scene._context;
|
|
1691
|
+
const oit = scene._view.oit;
|
|
1692
|
+
const lightShadowMaps = frameState.shadowState.lightShadowMaps;
|
|
1693
|
+
const lightShadowsEnabled = frameState.shadowState.lightShadowsEnabled;
|
|
1694
|
+
|
|
1695
|
+
let derivedCommands = command.derivedCommands;
|
|
1696
|
+
|
|
1697
|
+
if (defined(command.pickId)) {
|
|
1698
|
+
derivedCommands.picking = DerivedCommand.createPickDerivedCommand(
|
|
1699
|
+
scene,
|
|
1700
|
+
command,
|
|
1701
|
+
context,
|
|
1702
|
+
derivedCommands.picking
|
|
1703
|
+
);
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
if (!command.pickOnly) {
|
|
1707
|
+
derivedCommands.depth = DerivedCommand.createDepthOnlyDerivedCommand(
|
|
1708
|
+
scene,
|
|
1709
|
+
command,
|
|
1710
|
+
context,
|
|
1711
|
+
derivedCommands.depth
|
|
1712
|
+
);
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
derivedCommands.originalCommand = command;
|
|
1716
|
+
|
|
1717
|
+
if (scene._hdr) {
|
|
1718
|
+
derivedCommands.hdr = DerivedCommand.createHdrCommand(
|
|
1719
|
+
command,
|
|
1720
|
+
context,
|
|
1721
|
+
derivedCommands.hdr
|
|
1722
|
+
);
|
|
1723
|
+
command = derivedCommands.hdr.command;
|
|
1724
|
+
derivedCommands = command.derivedCommands;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
if (lightShadowsEnabled && command.receiveShadows) {
|
|
1728
|
+
derivedCommands.shadows = ShadowMap.createReceiveDerivedCommand(
|
|
1729
|
+
lightShadowMaps,
|
|
1730
|
+
command,
|
|
1731
|
+
shadowsDirty,
|
|
1732
|
+
context,
|
|
1733
|
+
derivedCommands.shadows
|
|
1734
|
+
);
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
if (command.pass === Pass.TRANSLUCENT && defined(oit) && oit.isSupported()) {
|
|
1738
|
+
if (lightShadowsEnabled && command.receiveShadows) {
|
|
1739
|
+
derivedCommands.oit = defined(derivedCommands.oit)
|
|
1740
|
+
? derivedCommands.oit
|
|
1741
|
+
: {};
|
|
1742
|
+
derivedCommands.oit.shadows = oit.createDerivedCommands(
|
|
1743
|
+
derivedCommands.shadows.receiveCommand,
|
|
1744
|
+
context,
|
|
1745
|
+
derivedCommands.oit.shadows
|
|
1746
|
+
);
|
|
1747
|
+
} else {
|
|
1748
|
+
derivedCommands.oit = oit.createDerivedCommands(
|
|
1749
|
+
command,
|
|
1750
|
+
context,
|
|
1751
|
+
derivedCommands.oit
|
|
1752
|
+
);
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
/**
|
|
1758
|
+
* @private
|
|
1759
|
+
*/
|
|
1760
|
+
Scene.prototype.updateDerivedCommands = function (command) {
|
|
1761
|
+
if (!defined(command.derivedCommands)) {
|
|
1762
|
+
// Is not a DrawCommand
|
|
1763
|
+
return;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
const frameState = this._frameState;
|
|
1767
|
+
const context = this._context;
|
|
1768
|
+
|
|
1769
|
+
// Update derived commands when any shadow maps become dirty
|
|
1770
|
+
let shadowsDirty = false;
|
|
1771
|
+
const lastDirtyTime = frameState.shadowState.lastDirtyTime;
|
|
1772
|
+
if (command.lastDirtyTime !== lastDirtyTime) {
|
|
1773
|
+
command.lastDirtyTime = lastDirtyTime;
|
|
1774
|
+
command.dirty = true;
|
|
1775
|
+
shadowsDirty = true;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
const useLogDepth = frameState.useLogDepth;
|
|
1779
|
+
const useHdr = this._hdr;
|
|
1780
|
+
const derivedCommands = command.derivedCommands;
|
|
1781
|
+
const hasLogDepthDerivedCommands = defined(derivedCommands.logDepth);
|
|
1782
|
+
const hasHdrCommands = defined(derivedCommands.hdr);
|
|
1783
|
+
const hasDerivedCommands = defined(derivedCommands.originalCommand);
|
|
1784
|
+
const needsLogDepthDerivedCommands =
|
|
1785
|
+
useLogDepth && !hasLogDepthDerivedCommands;
|
|
1786
|
+
const needsHdrCommands = useHdr && !hasHdrCommands;
|
|
1787
|
+
const needsDerivedCommands = (!useLogDepth || !useHdr) && !hasDerivedCommands;
|
|
1788
|
+
command.dirty =
|
|
1789
|
+
command.dirty ||
|
|
1790
|
+
needsLogDepthDerivedCommands ||
|
|
1791
|
+
needsHdrCommands ||
|
|
1792
|
+
needsDerivedCommands;
|
|
1793
|
+
|
|
1794
|
+
if (command.dirty) {
|
|
1795
|
+
command.dirty = false;
|
|
1796
|
+
|
|
1797
|
+
const shadowMaps = frameState.shadowState.shadowMaps;
|
|
1798
|
+
const shadowsEnabled = frameState.shadowState.shadowsEnabled;
|
|
1799
|
+
if (shadowsEnabled && command.castShadows) {
|
|
1800
|
+
derivedCommands.shadows = ShadowMap.createCastDerivedCommand(
|
|
1801
|
+
shadowMaps,
|
|
1802
|
+
command,
|
|
1803
|
+
shadowsDirty,
|
|
1804
|
+
context,
|
|
1805
|
+
derivedCommands.shadows
|
|
1806
|
+
);
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
if (hasLogDepthDerivedCommands || needsLogDepthDerivedCommands) {
|
|
1810
|
+
derivedCommands.logDepth = DerivedCommand.createLogDepthCommand(
|
|
1811
|
+
command,
|
|
1812
|
+
context,
|
|
1813
|
+
derivedCommands.logDepth
|
|
1814
|
+
);
|
|
1815
|
+
updateDerivedCommands(
|
|
1816
|
+
this,
|
|
1817
|
+
derivedCommands.logDepth.command,
|
|
1818
|
+
shadowsDirty
|
|
1819
|
+
);
|
|
1820
|
+
}
|
|
1821
|
+
if (hasDerivedCommands || needsDerivedCommands) {
|
|
1822
|
+
updateDerivedCommands(this, command, shadowsDirty);
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
};
|
|
1826
|
+
|
|
1827
|
+
const renderTilesetPassState = new Cesium3DTilePassState({
|
|
1828
|
+
pass: Cesium3DTilePass.RENDER,
|
|
1829
|
+
});
|
|
1830
|
+
|
|
1831
|
+
const preloadTilesetPassState = new Cesium3DTilePassState({
|
|
1832
|
+
pass: Cesium3DTilePass.PRELOAD,
|
|
1833
|
+
});
|
|
1834
|
+
|
|
1835
|
+
const preloadFlightTilesetPassState = new Cesium3DTilePassState({
|
|
1836
|
+
pass: Cesium3DTilePass.PRELOAD_FLIGHT,
|
|
1837
|
+
});
|
|
1838
|
+
|
|
1839
|
+
const requestRenderModeDeferCheckPassState = new Cesium3DTilePassState({
|
|
1840
|
+
pass: Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK,
|
|
1841
|
+
});
|
|
1842
|
+
|
|
1843
|
+
const scratchOccluderBoundingSphere = new BoundingSphere();
|
|
1844
|
+
let scratchOccluder;
|
|
1845
|
+
|
|
1846
|
+
function getOccluder(scene) {
|
|
1847
|
+
// TODO: The occluder is the top-level globe. When we add
|
|
1848
|
+
// support for multiple central bodies, this should be the closest one.
|
|
1849
|
+
const globe = scene.globe;
|
|
1850
|
+
if (
|
|
1851
|
+
scene._mode === SceneMode.SCENE3D &&
|
|
1852
|
+
defined(globe) &&
|
|
1853
|
+
globe.show &&
|
|
1854
|
+
!scene._cameraUnderground &&
|
|
1855
|
+
!scene._globeTranslucencyState.translucent
|
|
1856
|
+
) {
|
|
1857
|
+
const ellipsoid = globe.ellipsoid;
|
|
1858
|
+
const minimumTerrainHeight = scene.frameState.minimumTerrainHeight;
|
|
1859
|
+
scratchOccluderBoundingSphere.radius =
|
|
1860
|
+
ellipsoid.minimumRadius + minimumTerrainHeight;
|
|
1861
|
+
scratchOccluder = Occluder.fromBoundingSphere(
|
|
1862
|
+
scratchOccluderBoundingSphere,
|
|
1863
|
+
scene.camera.positionWC,
|
|
1864
|
+
scratchOccluder
|
|
1865
|
+
);
|
|
1866
|
+
return scratchOccluder;
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
return undefined;
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
/**
|
|
1873
|
+
* @private
|
|
1874
|
+
*/
|
|
1875
|
+
Scene.prototype.clearPasses = function (passes) {
|
|
1876
|
+
passes.render = false;
|
|
1877
|
+
passes.pick = false;
|
|
1878
|
+
passes.depth = false;
|
|
1879
|
+
passes.postProcess = false;
|
|
1880
|
+
passes.offscreen = false;
|
|
1881
|
+
};
|
|
1882
|
+
|
|
1883
|
+
function updateFrameNumber(scene, frameNumber, time) {
|
|
1884
|
+
const frameState = scene._frameState;
|
|
1885
|
+
frameState.frameNumber = frameNumber;
|
|
1886
|
+
frameState.time = JulianDate.clone(time, frameState.time);
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
/**
|
|
1890
|
+
* @private
|
|
1891
|
+
*/
|
|
1892
|
+
Scene.prototype.updateFrameState = function () {
|
|
1893
|
+
const camera = this.camera;
|
|
1894
|
+
|
|
1895
|
+
const frameState = this._frameState;
|
|
1896
|
+
frameState.commandList.length = 0;
|
|
1897
|
+
frameState.shadowMaps.length = 0;
|
|
1898
|
+
frameState.brdfLutGenerator = this._brdfLutGenerator;
|
|
1899
|
+
frameState.environmentMap = this.skyBox && this.skyBox._cubeMap;
|
|
1900
|
+
frameState.mode = this._mode;
|
|
1901
|
+
frameState.morphTime = this.morphTime;
|
|
1902
|
+
frameState.mapProjection = this.mapProjection;
|
|
1903
|
+
frameState.camera = camera;
|
|
1904
|
+
frameState.cullingVolume = camera.frustum.computeCullingVolume(
|
|
1905
|
+
camera.positionWC,
|
|
1906
|
+
camera.directionWC,
|
|
1907
|
+
camera.upWC
|
|
1908
|
+
);
|
|
1909
|
+
frameState.occluder = getOccluder(this);
|
|
1910
|
+
frameState.minimumTerrainHeight = 0.0;
|
|
1911
|
+
frameState.minimumDisableDepthTestDistance = this._minimumDisableDepthTestDistance;
|
|
1912
|
+
frameState.invertClassification = this.invertClassification;
|
|
1913
|
+
frameState.useLogDepth =
|
|
1914
|
+
this._logDepthBuffer &&
|
|
1915
|
+
!(
|
|
1916
|
+
this.camera.frustum instanceof OrthographicFrustum ||
|
|
1917
|
+
this.camera.frustum instanceof OrthographicOffCenterFrustum
|
|
1918
|
+
);
|
|
1919
|
+
frameState.light = this.light;
|
|
1920
|
+
frameState.cameraUnderground = this._cameraUnderground;
|
|
1921
|
+
frameState.globeTranslucencyState = this._globeTranslucencyState;
|
|
1922
|
+
|
|
1923
|
+
if (defined(this.globe)) {
|
|
1924
|
+
frameState.terrainExaggeration = this.globe.terrainExaggeration;
|
|
1925
|
+
frameState.terrainExaggerationRelativeHeight = this.globe.terrainExaggerationRelativeHeight;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
if (
|
|
1929
|
+
defined(this._specularEnvironmentMapAtlas) &&
|
|
1930
|
+
this._specularEnvironmentMapAtlas.ready
|
|
1931
|
+
) {
|
|
1932
|
+
frameState.specularEnvironmentMaps = this._specularEnvironmentMapAtlas.texture;
|
|
1933
|
+
frameState.specularEnvironmentMapsMaximumLOD = this._specularEnvironmentMapAtlas.maximumMipmapLevel;
|
|
1934
|
+
} else {
|
|
1935
|
+
frameState.specularEnvironmentMaps = undefined;
|
|
1936
|
+
frameState.specularEnvironmentMapsMaximumLOD = undefined;
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
frameState.sphericalHarmonicCoefficients = this.sphericalHarmonicCoefficients;
|
|
1940
|
+
|
|
1941
|
+
this._actualInvertClassificationColor = Color.clone(
|
|
1942
|
+
this.invertClassificationColor,
|
|
1943
|
+
this._actualInvertClassificationColor
|
|
1944
|
+
);
|
|
1945
|
+
if (!InvertClassification.isTranslucencySupported(this._context)) {
|
|
1946
|
+
this._actualInvertClassificationColor.alpha = 1.0;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
frameState.invertClassificationColor = this._actualInvertClassificationColor;
|
|
1950
|
+
|
|
1951
|
+
if (defined(this.globe)) {
|
|
1952
|
+
frameState.maximumScreenSpaceError = this.globe.maximumScreenSpaceError;
|
|
1953
|
+
} else {
|
|
1954
|
+
frameState.maximumScreenSpaceError = 2;
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
this.clearPasses(frameState.passes);
|
|
1958
|
+
|
|
1959
|
+
frameState.tilesetPassState = undefined;
|
|
1960
|
+
};
|
|
1961
|
+
|
|
1962
|
+
/**
|
|
1963
|
+
* @private
|
|
1964
|
+
*/
|
|
1965
|
+
Scene.prototype.isVisible = function (command, cullingVolume, occluder) {
|
|
1966
|
+
return (
|
|
1967
|
+
defined(command) &&
|
|
1968
|
+
(!defined(command.boundingVolume) ||
|
|
1969
|
+
!command.cull ||
|
|
1970
|
+
(cullingVolume.computeVisibility(command.boundingVolume) !==
|
|
1971
|
+
Intersect.OUTSIDE &&
|
|
1972
|
+
(!defined(occluder) ||
|
|
1973
|
+
!command.occlude ||
|
|
1974
|
+
!command.boundingVolume.isOccluded(occluder))))
|
|
1975
|
+
);
|
|
1976
|
+
};
|
|
1977
|
+
|
|
1978
|
+
let transformFrom2D = new Matrix4(
|
|
1979
|
+
0.0,
|
|
1980
|
+
0.0,
|
|
1981
|
+
1.0,
|
|
1982
|
+
0.0,
|
|
1983
|
+
1.0,
|
|
1984
|
+
0.0,
|
|
1985
|
+
0.0,
|
|
1986
|
+
0.0,
|
|
1987
|
+
0.0,
|
|
1988
|
+
1.0,
|
|
1989
|
+
0.0,
|
|
1990
|
+
0.0,
|
|
1991
|
+
0.0,
|
|
1992
|
+
0.0,
|
|
1993
|
+
0.0,
|
|
1994
|
+
1.0
|
|
1995
|
+
);
|
|
1996
|
+
transformFrom2D = Matrix4.inverseTransformation(
|
|
1997
|
+
transformFrom2D,
|
|
1998
|
+
transformFrom2D
|
|
1999
|
+
);
|
|
2000
|
+
|
|
2001
|
+
function debugShowBoundingVolume(command, scene, passState, debugFramebuffer) {
|
|
2002
|
+
// Debug code to draw bounding volume for command. Not optimized!
|
|
2003
|
+
// Assumes bounding volume is a bounding sphere or box
|
|
2004
|
+
const frameState = scene._frameState;
|
|
2005
|
+
const context = frameState.context;
|
|
2006
|
+
const boundingVolume = command.boundingVolume;
|
|
2007
|
+
|
|
2008
|
+
if (defined(scene._debugVolume)) {
|
|
2009
|
+
scene._debugVolume.destroy();
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2012
|
+
let geometry;
|
|
2013
|
+
|
|
2014
|
+
let center = Cartesian3.clone(boundingVolume.center);
|
|
2015
|
+
if (frameState.mode !== SceneMode.SCENE3D) {
|
|
2016
|
+
center = Matrix4.multiplyByPoint(transformFrom2D, center, center);
|
|
2017
|
+
const projection = frameState.mapProjection;
|
|
2018
|
+
const centerCartographic = projection.unproject(center);
|
|
2019
|
+
center = projection.ellipsoid.cartographicToCartesian(centerCartographic);
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
if (defined(boundingVolume.radius)) {
|
|
2023
|
+
const radius = boundingVolume.radius;
|
|
2024
|
+
|
|
2025
|
+
geometry = GeometryPipeline.toWireframe(
|
|
2026
|
+
EllipsoidGeometry.createGeometry(
|
|
2027
|
+
new EllipsoidGeometry({
|
|
2028
|
+
radii: new Cartesian3(radius, radius, radius),
|
|
2029
|
+
vertexFormat: PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,
|
|
2030
|
+
})
|
|
2031
|
+
)
|
|
2032
|
+
);
|
|
2033
|
+
|
|
2034
|
+
scene._debugVolume = new Primitive({
|
|
2035
|
+
geometryInstances: new GeometryInstance({
|
|
2036
|
+
geometry: geometry,
|
|
2037
|
+
modelMatrix: Matrix4.fromTranslation(center),
|
|
2038
|
+
attributes: {
|
|
2039
|
+
color: new ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 1.0),
|
|
2040
|
+
},
|
|
2041
|
+
}),
|
|
2042
|
+
appearance: new PerInstanceColorAppearance({
|
|
2043
|
+
flat: true,
|
|
2044
|
+
translucent: false,
|
|
2045
|
+
}),
|
|
2046
|
+
asynchronous: false,
|
|
2047
|
+
});
|
|
2048
|
+
} else {
|
|
2049
|
+
const halfAxes = boundingVolume.halfAxes;
|
|
2050
|
+
|
|
2051
|
+
geometry = GeometryPipeline.toWireframe(
|
|
2052
|
+
BoxGeometry.createGeometry(
|
|
2053
|
+
BoxGeometry.fromDimensions({
|
|
2054
|
+
dimensions: new Cartesian3(2.0, 2.0, 2.0),
|
|
2055
|
+
vertexFormat: PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,
|
|
2056
|
+
})
|
|
2057
|
+
)
|
|
2058
|
+
);
|
|
2059
|
+
|
|
2060
|
+
scene._debugVolume = new Primitive({
|
|
2061
|
+
geometryInstances: new GeometryInstance({
|
|
2062
|
+
geometry: geometry,
|
|
2063
|
+
modelMatrix: Matrix4.fromRotationTranslation(
|
|
2064
|
+
halfAxes,
|
|
2065
|
+
center,
|
|
2066
|
+
new Matrix4()
|
|
2067
|
+
),
|
|
2068
|
+
attributes: {
|
|
2069
|
+
color: new ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 1.0),
|
|
2070
|
+
},
|
|
2071
|
+
}),
|
|
2072
|
+
appearance: new PerInstanceColorAppearance({
|
|
2073
|
+
flat: true,
|
|
2074
|
+
translucent: false,
|
|
2075
|
+
}),
|
|
2076
|
+
asynchronous: false,
|
|
2077
|
+
});
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
const savedCommandList = frameState.commandList;
|
|
2081
|
+
const commandList = (frameState.commandList = []);
|
|
2082
|
+
scene._debugVolume.update(frameState);
|
|
2083
|
+
|
|
2084
|
+
command = commandList[0];
|
|
2085
|
+
|
|
2086
|
+
if (frameState.useLogDepth) {
|
|
2087
|
+
const logDepth = DerivedCommand.createLogDepthCommand(command, context);
|
|
2088
|
+
command = logDepth.command;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
let framebuffer;
|
|
2092
|
+
if (defined(debugFramebuffer)) {
|
|
2093
|
+
framebuffer = passState.framebuffer;
|
|
2094
|
+
passState.framebuffer = debugFramebuffer;
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
command.execute(context, passState);
|
|
2098
|
+
|
|
2099
|
+
if (defined(framebuffer)) {
|
|
2100
|
+
passState.framebuffer = framebuffer;
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
frameState.commandList = savedCommandList;
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
function executeCommand(command, scene, context, passState, debugFramebuffer) {
|
|
2107
|
+
const frameState = scene._frameState;
|
|
2108
|
+
|
|
2109
|
+
if (defined(scene.debugCommandFilter) && !scene.debugCommandFilter(command)) {
|
|
2110
|
+
return;
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
if (command instanceof ClearCommand) {
|
|
2114
|
+
command.execute(context, passState);
|
|
2115
|
+
return;
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
if (command.debugShowBoundingVolume && defined(command.boundingVolume)) {
|
|
2119
|
+
debugShowBoundingVolume(command, scene, passState, debugFramebuffer);
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
if (frameState.useLogDepth && defined(command.derivedCommands.logDepth)) {
|
|
2123
|
+
command = command.derivedCommands.logDepth.command;
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2126
|
+
const passes = frameState.passes;
|
|
2127
|
+
if (
|
|
2128
|
+
!passes.pick &&
|
|
2129
|
+
!passes.depth &&
|
|
2130
|
+
scene._hdr &&
|
|
2131
|
+
defined(command.derivedCommands) &&
|
|
2132
|
+
defined(command.derivedCommands.hdr)
|
|
2133
|
+
) {
|
|
2134
|
+
command = command.derivedCommands.hdr.command;
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2137
|
+
if (passes.pick || passes.depth) {
|
|
2138
|
+
if (
|
|
2139
|
+
passes.pick &&
|
|
2140
|
+
!passes.depth &&
|
|
2141
|
+
defined(command.derivedCommands.picking)
|
|
2142
|
+
) {
|
|
2143
|
+
command = command.derivedCommands.picking.pickCommand;
|
|
2144
|
+
command.execute(context, passState);
|
|
2145
|
+
return;
|
|
2146
|
+
} else if (defined(command.derivedCommands.depth)) {
|
|
2147
|
+
command = command.derivedCommands.depth.depthOnlyCommand;
|
|
2148
|
+
command.execute(context, passState);
|
|
2149
|
+
return;
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
if (scene.debugShowCommands || scene.debugShowFrustums) {
|
|
2154
|
+
scene._debugInspector.executeDebugShowFrustumsCommand(
|
|
2155
|
+
scene,
|
|
2156
|
+
command,
|
|
2157
|
+
passState
|
|
2158
|
+
);
|
|
2159
|
+
return;
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
if (
|
|
2163
|
+
frameState.shadowState.lightShadowsEnabled &&
|
|
2164
|
+
command.receiveShadows &&
|
|
2165
|
+
defined(command.derivedCommands.shadows)
|
|
2166
|
+
) {
|
|
2167
|
+
// If the command receives shadows, execute the derived shadows command.
|
|
2168
|
+
// Some commands, such as OIT derived commands, do not have derived shadow commands themselves
|
|
2169
|
+
// and instead shadowing is built-in. In this case execute the command regularly below.
|
|
2170
|
+
command.derivedCommands.shadows.receiveCommand.execute(context, passState);
|
|
2171
|
+
} else {
|
|
2172
|
+
command.execute(context, passState);
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2176
|
+
function executeIdCommand(command, scene, context, passState) {
|
|
2177
|
+
const frameState = scene._frameState;
|
|
2178
|
+
let derivedCommands = command.derivedCommands;
|
|
2179
|
+
if (!defined(derivedCommands)) {
|
|
2180
|
+
return;
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
if (frameState.useLogDepth && defined(derivedCommands.logDepth)) {
|
|
2184
|
+
command = derivedCommands.logDepth.command;
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
derivedCommands = command.derivedCommands;
|
|
2188
|
+
if (defined(derivedCommands.picking)) {
|
|
2189
|
+
command = derivedCommands.picking.pickCommand;
|
|
2190
|
+
command.execute(context, passState);
|
|
2191
|
+
} else if (defined(derivedCommands.depth)) {
|
|
2192
|
+
command = derivedCommands.depth.depthOnlyCommand;
|
|
2193
|
+
command.execute(context, passState);
|
|
2194
|
+
}
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
function backToFront(a, b, position) {
|
|
2198
|
+
return (
|
|
2199
|
+
b.boundingVolume.distanceSquaredTo(position) -
|
|
2200
|
+
a.boundingVolume.distanceSquaredTo(position)
|
|
2201
|
+
);
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
function frontToBack(a, b, position) {
|
|
2205
|
+
// When distances are equal equal favor sorting b before a. This gives render priority to commands later in the list.
|
|
2206
|
+
return (
|
|
2207
|
+
a.boundingVolume.distanceSquaredTo(position) -
|
|
2208
|
+
b.boundingVolume.distanceSquaredTo(position) +
|
|
2209
|
+
CesiumMath.EPSILON12
|
|
2210
|
+
);
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
function executeTranslucentCommandsBackToFront(
|
|
2214
|
+
scene,
|
|
2215
|
+
executeFunction,
|
|
2216
|
+
passState,
|
|
2217
|
+
commands,
|
|
2218
|
+
invertClassification
|
|
2219
|
+
) {
|
|
2220
|
+
const context = scene.context;
|
|
2221
|
+
|
|
2222
|
+
mergeSort(commands, backToFront, scene.camera.positionWC);
|
|
2223
|
+
|
|
2224
|
+
if (defined(invertClassification)) {
|
|
2225
|
+
executeFunction(
|
|
2226
|
+
invertClassification.unclassifiedCommand,
|
|
2227
|
+
scene,
|
|
2228
|
+
context,
|
|
2229
|
+
passState
|
|
2230
|
+
);
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
const length = commands.length;
|
|
2234
|
+
for (let i = 0; i < length; ++i) {
|
|
2235
|
+
executeFunction(commands[i], scene, context, passState);
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
function executeTranslucentCommandsFrontToBack(
|
|
2240
|
+
scene,
|
|
2241
|
+
executeFunction,
|
|
2242
|
+
passState,
|
|
2243
|
+
commands,
|
|
2244
|
+
invertClassification
|
|
2245
|
+
) {
|
|
2246
|
+
const context = scene.context;
|
|
2247
|
+
|
|
2248
|
+
mergeSort(commands, frontToBack, scene.camera.positionWC);
|
|
2249
|
+
|
|
2250
|
+
if (defined(invertClassification)) {
|
|
2251
|
+
executeFunction(
|
|
2252
|
+
invertClassification.unclassifiedCommand,
|
|
2253
|
+
scene,
|
|
2254
|
+
context,
|
|
2255
|
+
passState
|
|
2256
|
+
);
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
const length = commands.length;
|
|
2260
|
+
for (let i = 0; i < length; ++i) {
|
|
2261
|
+
executeFunction(commands[i], scene, context, passState);
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
const scratchPerspectiveFrustum = new PerspectiveFrustum();
|
|
2266
|
+
const scratchPerspectiveOffCenterFrustum = new PerspectiveOffCenterFrustum();
|
|
2267
|
+
const scratchOrthographicFrustum = new OrthographicFrustum();
|
|
2268
|
+
const scratchOrthographicOffCenterFrustum = new OrthographicOffCenterFrustum();
|
|
2269
|
+
|
|
2270
|
+
function executeCommands(scene, passState) {
|
|
2271
|
+
const camera = scene.camera;
|
|
2272
|
+
const context = scene.context;
|
|
2273
|
+
const frameState = scene.frameState;
|
|
2274
|
+
const us = context.uniformState;
|
|
2275
|
+
|
|
2276
|
+
us.updateCamera(camera);
|
|
2277
|
+
|
|
2278
|
+
// Create a working frustum from the original camera frustum.
|
|
2279
|
+
let frustum;
|
|
2280
|
+
if (defined(camera.frustum.fov)) {
|
|
2281
|
+
frustum = camera.frustum.clone(scratchPerspectiveFrustum);
|
|
2282
|
+
} else if (defined(camera.frustum.infiniteProjectionMatrix)) {
|
|
2283
|
+
frustum = camera.frustum.clone(scratchPerspectiveOffCenterFrustum);
|
|
2284
|
+
} else if (defined(camera.frustum.width)) {
|
|
2285
|
+
frustum = camera.frustum.clone(scratchOrthographicFrustum);
|
|
2286
|
+
} else {
|
|
2287
|
+
frustum = camera.frustum.clone(scratchOrthographicOffCenterFrustum);
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
// Ideally, we would render the sky box and atmosphere last for
|
|
2291
|
+
// early-z, but we would have to draw it in each frustum
|
|
2292
|
+
frustum.near = camera.frustum.near;
|
|
2293
|
+
frustum.far = camera.frustum.far;
|
|
2294
|
+
us.updateFrustum(frustum);
|
|
2295
|
+
us.updatePass(Pass.ENVIRONMENT);
|
|
2296
|
+
|
|
2297
|
+
const passes = frameState.passes;
|
|
2298
|
+
const picking = passes.pick;
|
|
2299
|
+
const environmentState = scene._environmentState;
|
|
2300
|
+
const view = scene._view;
|
|
2301
|
+
const renderTranslucentDepthForPick =
|
|
2302
|
+
environmentState.renderTranslucentDepthForPick;
|
|
2303
|
+
const useWebVR = environmentState.useWebVR;
|
|
2304
|
+
|
|
2305
|
+
// Do not render environment primitives during a pick pass since they do not generate picking commands.
|
|
2306
|
+
if (!picking) {
|
|
2307
|
+
const skyBoxCommand = environmentState.skyBoxCommand;
|
|
2308
|
+
if (defined(skyBoxCommand)) {
|
|
2309
|
+
executeCommand(skyBoxCommand, scene, context, passState);
|
|
2310
|
+
}
|
|
2311
|
+
|
|
2312
|
+
if (environmentState.isSkyAtmosphereVisible) {
|
|
2313
|
+
executeCommand(
|
|
2314
|
+
environmentState.skyAtmosphereCommand,
|
|
2315
|
+
scene,
|
|
2316
|
+
context,
|
|
2317
|
+
passState
|
|
2318
|
+
);
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
if (environmentState.isSunVisible) {
|
|
2322
|
+
environmentState.sunDrawCommand.execute(context, passState);
|
|
2323
|
+
if (scene.sunBloom && !useWebVR) {
|
|
2324
|
+
let framebuffer;
|
|
2325
|
+
if (environmentState.useGlobeDepthFramebuffer) {
|
|
2326
|
+
framebuffer = view.globeDepth.framebuffer;
|
|
2327
|
+
} else if (environmentState.usePostProcess) {
|
|
2328
|
+
framebuffer = view.sceneFramebuffer.framebuffer;
|
|
2329
|
+
} else {
|
|
2330
|
+
framebuffer = environmentState.originalFramebuffer;
|
|
2331
|
+
}
|
|
2332
|
+
scene._sunPostProcess.execute(context);
|
|
2333
|
+
scene._sunPostProcess.copy(context, framebuffer);
|
|
2334
|
+
passState.framebuffer = framebuffer;
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
|
|
2338
|
+
// Moon can be seen through the atmosphere, since the sun is rendered after the atmosphere.
|
|
2339
|
+
if (environmentState.isMoonVisible) {
|
|
2340
|
+
environmentState.moonCommand.execute(context, passState);
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
|
|
2344
|
+
// Determine how translucent surfaces will be handled.
|
|
2345
|
+
let executeTranslucentCommands;
|
|
2346
|
+
if (environmentState.useOIT) {
|
|
2347
|
+
if (!defined(scene._executeOITFunction)) {
|
|
2348
|
+
scene._executeOITFunction = function (
|
|
2349
|
+
scene,
|
|
2350
|
+
executeFunction,
|
|
2351
|
+
passState,
|
|
2352
|
+
commands,
|
|
2353
|
+
invertClassification
|
|
2354
|
+
) {
|
|
2355
|
+
view.globeDepth.prepareColorTextures(context);
|
|
2356
|
+
view.oit.executeCommands(
|
|
2357
|
+
scene,
|
|
2358
|
+
executeFunction,
|
|
2359
|
+
passState,
|
|
2360
|
+
commands,
|
|
2361
|
+
invertClassification
|
|
2362
|
+
);
|
|
2363
|
+
};
|
|
2364
|
+
}
|
|
2365
|
+
executeTranslucentCommands = scene._executeOITFunction;
|
|
2366
|
+
} else if (passes.render) {
|
|
2367
|
+
executeTranslucentCommands = executeTranslucentCommandsBackToFront;
|
|
2368
|
+
} else {
|
|
2369
|
+
executeTranslucentCommands = executeTranslucentCommandsFrontToBack;
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2372
|
+
const frustumCommandsList = view.frustumCommandsList;
|
|
2373
|
+
const numFrustums = frustumCommandsList.length;
|
|
2374
|
+
|
|
2375
|
+
const clearGlobeDepth = environmentState.clearGlobeDepth;
|
|
2376
|
+
const useDepthPlane = environmentState.useDepthPlane;
|
|
2377
|
+
const globeTranslucencyState = scene._globeTranslucencyState;
|
|
2378
|
+
const globeTranslucent = globeTranslucencyState.translucent;
|
|
2379
|
+
const globeTranslucencyFramebuffer = scene._view.globeTranslucencyFramebuffer;
|
|
2380
|
+
const clearDepth = scene._depthClearCommand;
|
|
2381
|
+
const clearStencil = scene._stencilClearCommand;
|
|
2382
|
+
const clearClassificationStencil = scene._classificationStencilClearCommand;
|
|
2383
|
+
const depthPlane = scene._depthPlane;
|
|
2384
|
+
const usePostProcessSelected = environmentState.usePostProcessSelected;
|
|
2385
|
+
|
|
2386
|
+
const height2D = camera.position.z;
|
|
2387
|
+
|
|
2388
|
+
// Execute commands in each frustum in back to front order
|
|
2389
|
+
let j;
|
|
2390
|
+
for (let i = 0; i < numFrustums; ++i) {
|
|
2391
|
+
const index = numFrustums - i - 1;
|
|
2392
|
+
const frustumCommands = frustumCommandsList[index];
|
|
2393
|
+
|
|
2394
|
+
if (scene.mode === SceneMode.SCENE2D) {
|
|
2395
|
+
// To avoid z-fighting in 2D, move the camera to just before the frustum
|
|
2396
|
+
// and scale the frustum depth to be in [1.0, nearToFarDistance2D].
|
|
2397
|
+
camera.position.z = height2D - frustumCommands.near + 1.0;
|
|
2398
|
+
frustum.far = Math.max(1.0, frustumCommands.far - frustumCommands.near);
|
|
2399
|
+
frustum.near = 1.0;
|
|
2400
|
+
us.update(frameState);
|
|
2401
|
+
us.updateFrustum(frustum);
|
|
2402
|
+
} else {
|
|
2403
|
+
// Avoid tearing artifacts between adjacent frustums in the opaque passes
|
|
2404
|
+
frustum.near =
|
|
2405
|
+
index !== 0
|
|
2406
|
+
? frustumCommands.near * scene.opaqueFrustumNearOffset
|
|
2407
|
+
: frustumCommands.near;
|
|
2408
|
+
frustum.far = frustumCommands.far;
|
|
2409
|
+
us.updateFrustum(frustum);
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
clearDepth.execute(context, passState);
|
|
2413
|
+
|
|
2414
|
+
if (context.stencilBuffer) {
|
|
2415
|
+
clearStencil.execute(context, passState);
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
us.updatePass(Pass.GLOBE);
|
|
2419
|
+
let commands = frustumCommands.commands[Pass.GLOBE];
|
|
2420
|
+
let length = frustumCommands.indices[Pass.GLOBE];
|
|
2421
|
+
|
|
2422
|
+
if (globeTranslucent) {
|
|
2423
|
+
globeTranslucencyState.executeGlobeCommands(
|
|
2424
|
+
frustumCommands,
|
|
2425
|
+
executeCommand,
|
|
2426
|
+
globeTranslucencyFramebuffer,
|
|
2427
|
+
scene,
|
|
2428
|
+
passState
|
|
2429
|
+
);
|
|
2430
|
+
} else {
|
|
2431
|
+
for (j = 0; j < length; ++j) {
|
|
2432
|
+
executeCommand(commands[j], scene, context, passState);
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2436
|
+
const globeDepth = view.globeDepth;
|
|
2437
|
+
if (defined(globeDepth) && environmentState.useGlobeDepthFramebuffer) {
|
|
2438
|
+
globeDepth.executeCopyDepth(context, passState);
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
// Draw terrain classification
|
|
2442
|
+
if (!environmentState.renderTranslucentDepthForPick) {
|
|
2443
|
+
us.updatePass(Pass.TERRAIN_CLASSIFICATION);
|
|
2444
|
+
commands = frustumCommands.commands[Pass.TERRAIN_CLASSIFICATION];
|
|
2445
|
+
length = frustumCommands.indices[Pass.TERRAIN_CLASSIFICATION];
|
|
2446
|
+
|
|
2447
|
+
if (globeTranslucent) {
|
|
2448
|
+
globeTranslucencyState.executeGlobeClassificationCommands(
|
|
2449
|
+
frustumCommands,
|
|
2450
|
+
executeCommand,
|
|
2451
|
+
globeTranslucencyFramebuffer,
|
|
2452
|
+
scene,
|
|
2453
|
+
passState
|
|
2454
|
+
);
|
|
2455
|
+
} else {
|
|
2456
|
+
for (j = 0; j < length; ++j) {
|
|
2457
|
+
executeCommand(commands[j], scene, context, passState);
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
if (clearGlobeDepth) {
|
|
2463
|
+
clearDepth.execute(context, passState);
|
|
2464
|
+
if (useDepthPlane) {
|
|
2465
|
+
depthPlane.execute(context, passState);
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2469
|
+
if (
|
|
2470
|
+
!environmentState.useInvertClassification ||
|
|
2471
|
+
picking ||
|
|
2472
|
+
environmentState.renderTranslucentDepthForPick
|
|
2473
|
+
) {
|
|
2474
|
+
// Common/fastest path. Draw 3D Tiles and classification normally.
|
|
2475
|
+
|
|
2476
|
+
// Draw 3D Tiles
|
|
2477
|
+
us.updatePass(Pass.CESIUM_3D_TILE);
|
|
2478
|
+
commands = frustumCommands.commands[Pass.CESIUM_3D_TILE];
|
|
2479
|
+
length = frustumCommands.indices[Pass.CESIUM_3D_TILE];
|
|
2480
|
+
for (j = 0; j < length; ++j) {
|
|
2481
|
+
executeCommand(commands[j], scene, context, passState);
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
if (length > 0) {
|
|
2485
|
+
if (defined(globeDepth) && environmentState.useGlobeDepthFramebuffer) {
|
|
2486
|
+
// When clearGlobeDepth is true, executeUpdateDepth needs
|
|
2487
|
+
// a globe depth texture with resolved stencil bits.
|
|
2488
|
+
globeDepth.prepareColorTextures(context, clearGlobeDepth);
|
|
2489
|
+
globeDepth.executeUpdateDepth(
|
|
2490
|
+
context,
|
|
2491
|
+
passState,
|
|
2492
|
+
clearGlobeDepth,
|
|
2493
|
+
globeDepth.depthStencilTexture
|
|
2494
|
+
);
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
// Draw classifications. Modifies 3D Tiles color.
|
|
2498
|
+
if (!environmentState.renderTranslucentDepthForPick) {
|
|
2499
|
+
us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION);
|
|
2500
|
+
commands =
|
|
2501
|
+
frustumCommands.commands[Pass.CESIUM_3D_TILE_CLASSIFICATION];
|
|
2502
|
+
length = frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION];
|
|
2503
|
+
for (j = 0; j < length; ++j) {
|
|
2504
|
+
executeCommand(commands[j], scene, context, passState);
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
} else {
|
|
2509
|
+
// When the invert classification color is opaque:
|
|
2510
|
+
// Main FBO (FBO1): Main_Color + Main_DepthStencil
|
|
2511
|
+
// Invert classification FBO (FBO2) : Invert_Color + Main_DepthStencil
|
|
2512
|
+
//
|
|
2513
|
+
// 1. Clear FBO2 color to vec4(0.0) for each frustum
|
|
2514
|
+
// 2. Draw 3D Tiles to FBO2
|
|
2515
|
+
// 3. Draw classification to FBO2
|
|
2516
|
+
// 4. Fullscreen pass to FBO1, draw Invert_Color when:
|
|
2517
|
+
// * Main_DepthStencil has the stencil bit set > 0 (classified)
|
|
2518
|
+
// 5. Fullscreen pass to FBO1, draw Invert_Color * czm_invertClassificationColor when:
|
|
2519
|
+
// * Main_DepthStencil has stencil bit set to 0 (unclassified) and
|
|
2520
|
+
// * Invert_Color !== vec4(0.0)
|
|
2521
|
+
//
|
|
2522
|
+
// When the invert classification color is translucent:
|
|
2523
|
+
// Main FBO (FBO1): Main_Color + Main_DepthStencil
|
|
2524
|
+
// Invert classification FBO (FBO2): Invert_Color + Invert_DepthStencil
|
|
2525
|
+
// IsClassified FBO (FBO3): IsClassified_Color + Invert_DepthStencil
|
|
2526
|
+
//
|
|
2527
|
+
// 1. Clear FBO2 and FBO3 color to vec4(0.0), stencil to 0, and depth to 1.0
|
|
2528
|
+
// 2. Draw 3D Tiles to FBO2
|
|
2529
|
+
// 3. Draw classification to FBO2
|
|
2530
|
+
// 4. Fullscreen pass to FBO3, draw any color when
|
|
2531
|
+
// * Invert_DepthStencil has the stencil bit set > 0 (classified)
|
|
2532
|
+
// 5. Fullscreen pass to FBO1, draw Invert_Color when:
|
|
2533
|
+
// * Invert_Color !== vec4(0.0) and
|
|
2534
|
+
// * IsClassified_Color !== vec4(0.0)
|
|
2535
|
+
// 6. Fullscreen pass to FBO1, draw Invert_Color * czm_invertClassificationColor when:
|
|
2536
|
+
// * Invert_Color !== vec4(0.0) and
|
|
2537
|
+
// * IsClassified_Color === vec4(0.0)
|
|
2538
|
+
//
|
|
2539
|
+
// NOTE: Step six when translucent invert color occurs after the TRANSLUCENT pass
|
|
2540
|
+
//
|
|
2541
|
+
scene._invertClassification.clear(context, passState);
|
|
2542
|
+
|
|
2543
|
+
const opaqueClassificationFramebuffer = passState.framebuffer;
|
|
2544
|
+
passState.framebuffer = scene._invertClassification._fbo.framebuffer;
|
|
2545
|
+
|
|
2546
|
+
// Draw normally
|
|
2547
|
+
us.updatePass(Pass.CESIUM_3D_TILE);
|
|
2548
|
+
commands = frustumCommands.commands[Pass.CESIUM_3D_TILE];
|
|
2549
|
+
length = frustumCommands.indices[Pass.CESIUM_3D_TILE];
|
|
2550
|
+
for (j = 0; j < length; ++j) {
|
|
2551
|
+
executeCommand(commands[j], scene, context, passState);
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
if (defined(globeDepth) && environmentState.useGlobeDepthFramebuffer) {
|
|
2555
|
+
scene._invertClassification.prepareTextures(context);
|
|
2556
|
+
globeDepth.executeUpdateDepth(
|
|
2557
|
+
context,
|
|
2558
|
+
passState,
|
|
2559
|
+
clearGlobeDepth,
|
|
2560
|
+
scene._invertClassification._fbo.getDepthStencilTexture()
|
|
2561
|
+
);
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
// Set stencil
|
|
2565
|
+
us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW);
|
|
2566
|
+
commands =
|
|
2567
|
+
frustumCommands.commands[
|
|
2568
|
+
Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW
|
|
2569
|
+
];
|
|
2570
|
+
length =
|
|
2571
|
+
frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW];
|
|
2572
|
+
for (j = 0; j < length; ++j) {
|
|
2573
|
+
executeCommand(commands[j], scene, context, passState);
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
passState.framebuffer = opaqueClassificationFramebuffer;
|
|
2577
|
+
|
|
2578
|
+
// Fullscreen pass to copy classified fragments
|
|
2579
|
+
scene._invertClassification.executeClassified(context, passState);
|
|
2580
|
+
if (frameState.invertClassificationColor.alpha === 1.0) {
|
|
2581
|
+
// Fullscreen pass to copy unclassified fragments when alpha == 1.0
|
|
2582
|
+
scene._invertClassification.executeUnclassified(context, passState);
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2585
|
+
// Clear stencil set by the classification for the next classification pass
|
|
2586
|
+
if (length > 0 && context.stencilBuffer) {
|
|
2587
|
+
clearClassificationStencil.execute(context, passState);
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
// Draw style over classification.
|
|
2591
|
+
us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION);
|
|
2592
|
+
commands = frustumCommands.commands[Pass.CESIUM_3D_TILE_CLASSIFICATION];
|
|
2593
|
+
length = frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION];
|
|
2594
|
+
for (j = 0; j < length; ++j) {
|
|
2595
|
+
executeCommand(commands[j], scene, context, passState);
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
if (length > 0 && context.stencilBuffer) {
|
|
2600
|
+
clearStencil.execute(context, passState);
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
us.updatePass(Pass.OPAQUE);
|
|
2604
|
+
commands = frustumCommands.commands[Pass.OPAQUE];
|
|
2605
|
+
length = frustumCommands.indices[Pass.OPAQUE];
|
|
2606
|
+
for (j = 0; j < length; ++j) {
|
|
2607
|
+
executeCommand(commands[j], scene, context, passState);
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2610
|
+
if (index !== 0 && scene.mode !== SceneMode.SCENE2D) {
|
|
2611
|
+
// Do not overlap frustums in the translucent pass to avoid blending artifacts
|
|
2612
|
+
frustum.near = frustumCommands.near;
|
|
2613
|
+
us.updateFrustum(frustum);
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
let invertClassification;
|
|
2617
|
+
if (
|
|
2618
|
+
!picking &&
|
|
2619
|
+
environmentState.useInvertClassification &&
|
|
2620
|
+
frameState.invertClassificationColor.alpha < 1.0
|
|
2621
|
+
) {
|
|
2622
|
+
// Fullscreen pass to copy unclassified fragments when alpha < 1.0.
|
|
2623
|
+
// Not executed when undefined.
|
|
2624
|
+
invertClassification = scene._invertClassification;
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
us.updatePass(Pass.TRANSLUCENT);
|
|
2628
|
+
commands = frustumCommands.commands[Pass.TRANSLUCENT];
|
|
2629
|
+
commands.length = frustumCommands.indices[Pass.TRANSLUCENT];
|
|
2630
|
+
executeTranslucentCommands(
|
|
2631
|
+
scene,
|
|
2632
|
+
executeCommand,
|
|
2633
|
+
passState,
|
|
2634
|
+
commands,
|
|
2635
|
+
invertClassification
|
|
2636
|
+
);
|
|
2637
|
+
|
|
2638
|
+
// Classification for translucent 3D Tiles
|
|
2639
|
+
const has3DTilesClassificationCommands =
|
|
2640
|
+
frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION] > 0;
|
|
2641
|
+
if (
|
|
2642
|
+
has3DTilesClassificationCommands &&
|
|
2643
|
+
view.translucentTileClassification.isSupported()
|
|
2644
|
+
) {
|
|
2645
|
+
view.translucentTileClassification.executeTranslucentCommands(
|
|
2646
|
+
scene,
|
|
2647
|
+
executeCommand,
|
|
2648
|
+
passState,
|
|
2649
|
+
commands,
|
|
2650
|
+
globeDepth.depthStencilTexture
|
|
2651
|
+
);
|
|
2652
|
+
view.translucentTileClassification.executeClassificationCommands(
|
|
2653
|
+
scene,
|
|
2654
|
+
executeCommand,
|
|
2655
|
+
passState,
|
|
2656
|
+
frustumCommands
|
|
2657
|
+
);
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
if (
|
|
2661
|
+
context.depthTexture &&
|
|
2662
|
+
scene.useDepthPicking &&
|
|
2663
|
+
(environmentState.useGlobeDepthFramebuffer ||
|
|
2664
|
+
renderTranslucentDepthForPick)
|
|
2665
|
+
) {
|
|
2666
|
+
// PERFORMANCE_IDEA: Use MRT to avoid the extra copy.
|
|
2667
|
+
const depthStencilTexture = globeDepth.depthStencilTexture;
|
|
2668
|
+
const pickDepth = scene._picking.getPickDepth(scene, index);
|
|
2669
|
+
pickDepth.update(context, depthStencilTexture);
|
|
2670
|
+
pickDepth.executeCopyDepth(context, passState);
|
|
2671
|
+
}
|
|
2672
|
+
|
|
2673
|
+
if (picking || !usePostProcessSelected) {
|
|
2674
|
+
continue;
|
|
2675
|
+
}
|
|
2676
|
+
|
|
2677
|
+
const originalFramebuffer = passState.framebuffer;
|
|
2678
|
+
passState.framebuffer = view.sceneFramebuffer.getIdFramebuffer();
|
|
2679
|
+
|
|
2680
|
+
// reset frustum
|
|
2681
|
+
frustum.near =
|
|
2682
|
+
index !== 0
|
|
2683
|
+
? frustumCommands.near * scene.opaqueFrustumNearOffset
|
|
2684
|
+
: frustumCommands.near;
|
|
2685
|
+
frustum.far = frustumCommands.far;
|
|
2686
|
+
us.updateFrustum(frustum);
|
|
2687
|
+
|
|
2688
|
+
us.updatePass(Pass.GLOBE);
|
|
2689
|
+
commands = frustumCommands.commands[Pass.GLOBE];
|
|
2690
|
+
length = frustumCommands.indices[Pass.GLOBE];
|
|
2691
|
+
|
|
2692
|
+
if (globeTranslucent) {
|
|
2693
|
+
globeTranslucencyState.executeGlobeCommands(
|
|
2694
|
+
frustumCommands,
|
|
2695
|
+
executeIdCommand,
|
|
2696
|
+
globeTranslucencyFramebuffer,
|
|
2697
|
+
scene,
|
|
2698
|
+
passState
|
|
2699
|
+
);
|
|
2700
|
+
} else {
|
|
2701
|
+
for (j = 0; j < length; ++j) {
|
|
2702
|
+
executeIdCommand(commands[j], scene, context, passState);
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
if (clearGlobeDepth) {
|
|
2707
|
+
clearDepth.framebuffer = passState.framebuffer;
|
|
2708
|
+
clearDepth.execute(context, passState);
|
|
2709
|
+
clearDepth.framebuffer = undefined;
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
if (clearGlobeDepth && useDepthPlane) {
|
|
2713
|
+
depthPlane.execute(context, passState);
|
|
2714
|
+
}
|
|
2715
|
+
|
|
2716
|
+
us.updatePass(Pass.CESIUM_3D_TILE);
|
|
2717
|
+
commands = frustumCommands.commands[Pass.CESIUM_3D_TILE];
|
|
2718
|
+
length = frustumCommands.indices[Pass.CESIUM_3D_TILE];
|
|
2719
|
+
for (j = 0; j < length; ++j) {
|
|
2720
|
+
executeIdCommand(commands[j], scene, context, passState);
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
us.updatePass(Pass.OPAQUE);
|
|
2724
|
+
commands = frustumCommands.commands[Pass.OPAQUE];
|
|
2725
|
+
length = frustumCommands.indices[Pass.OPAQUE];
|
|
2726
|
+
for (j = 0; j < length; ++j) {
|
|
2727
|
+
executeIdCommand(commands[j], scene, context, passState);
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
us.updatePass(Pass.TRANSLUCENT);
|
|
2731
|
+
commands = frustumCommands.commands[Pass.TRANSLUCENT];
|
|
2732
|
+
length = frustumCommands.indices[Pass.TRANSLUCENT];
|
|
2733
|
+
for (j = 0; j < length; ++j) {
|
|
2734
|
+
executeIdCommand(commands[j], scene, context, passState);
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
passState.framebuffer = originalFramebuffer;
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
function executeComputeCommands(scene) {
|
|
2742
|
+
const us = scene.context.uniformState;
|
|
2743
|
+
us.updatePass(Pass.COMPUTE);
|
|
2744
|
+
|
|
2745
|
+
const sunComputeCommand = scene._environmentState.sunComputeCommand;
|
|
2746
|
+
if (defined(sunComputeCommand)) {
|
|
2747
|
+
sunComputeCommand.execute(scene._computeEngine);
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
const commandList = scene._computeCommandList;
|
|
2751
|
+
const length = commandList.length;
|
|
2752
|
+
for (let i = 0; i < length; ++i) {
|
|
2753
|
+
commandList[i].execute(scene._computeEngine);
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2757
|
+
function executeOverlayCommands(scene, passState) {
|
|
2758
|
+
const us = scene.context.uniformState;
|
|
2759
|
+
us.updatePass(Pass.OVERLAY);
|
|
2760
|
+
|
|
2761
|
+
const context = scene.context;
|
|
2762
|
+
const commandList = scene._overlayCommandList;
|
|
2763
|
+
const length = commandList.length;
|
|
2764
|
+
for (let i = 0; i < length; ++i) {
|
|
2765
|
+
commandList[i].execute(context, passState);
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
function insertShadowCastCommands(scene, commandList, shadowMap) {
|
|
2770
|
+
const shadowVolume = shadowMap.shadowMapCullingVolume;
|
|
2771
|
+
const isPointLight = shadowMap.isPointLight;
|
|
2772
|
+
const passes = shadowMap.passes;
|
|
2773
|
+
const numberOfPasses = passes.length;
|
|
2774
|
+
|
|
2775
|
+
const length = commandList.length;
|
|
2776
|
+
for (let i = 0; i < length; ++i) {
|
|
2777
|
+
const command = commandList[i];
|
|
2778
|
+
scene.updateDerivedCommands(command);
|
|
2779
|
+
|
|
2780
|
+
if (
|
|
2781
|
+
command.castShadows &&
|
|
2782
|
+
(command.pass === Pass.GLOBE ||
|
|
2783
|
+
command.pass === Pass.CESIUM_3D_TILE ||
|
|
2784
|
+
command.pass === Pass.OPAQUE ||
|
|
2785
|
+
command.pass === Pass.TRANSLUCENT)
|
|
2786
|
+
) {
|
|
2787
|
+
if (scene.isVisible(command, shadowVolume)) {
|
|
2788
|
+
if (isPointLight) {
|
|
2789
|
+
for (let k = 0; k < numberOfPasses; ++k) {
|
|
2790
|
+
passes[k].commandList.push(command);
|
|
2791
|
+
}
|
|
2792
|
+
} else if (numberOfPasses === 1) {
|
|
2793
|
+
passes[0].commandList.push(command);
|
|
2794
|
+
} else {
|
|
2795
|
+
let wasVisible = false;
|
|
2796
|
+
// Loop over cascades from largest to smallest
|
|
2797
|
+
for (let j = numberOfPasses - 1; j >= 0; --j) {
|
|
2798
|
+
const cascadeVolume = passes[j].cullingVolume;
|
|
2799
|
+
if (scene.isVisible(command, cascadeVolume)) {
|
|
2800
|
+
passes[j].commandList.push(command);
|
|
2801
|
+
wasVisible = true;
|
|
2802
|
+
} else if (wasVisible) {
|
|
2803
|
+
// If it was visible in the previous cascade but now isn't
|
|
2804
|
+
// then there is no need to check any more cascades
|
|
2805
|
+
break;
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
function executeShadowMapCastCommands(scene) {
|
|
2815
|
+
const frameState = scene.frameState;
|
|
2816
|
+
const shadowMaps = frameState.shadowState.shadowMaps;
|
|
2817
|
+
const shadowMapLength = shadowMaps.length;
|
|
2818
|
+
|
|
2819
|
+
if (!frameState.shadowState.shadowsEnabled) {
|
|
2820
|
+
return;
|
|
2821
|
+
}
|
|
2822
|
+
|
|
2823
|
+
const context = scene.context;
|
|
2824
|
+
const uniformState = context.uniformState;
|
|
2825
|
+
|
|
2826
|
+
for (let i = 0; i < shadowMapLength; ++i) {
|
|
2827
|
+
const shadowMap = shadowMaps[i];
|
|
2828
|
+
if (shadowMap.outOfView) {
|
|
2829
|
+
continue;
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
// Reset the command lists
|
|
2833
|
+
const passes = shadowMap.passes;
|
|
2834
|
+
const numberOfPasses = passes.length;
|
|
2835
|
+
for (let j = 0; j < numberOfPasses; ++j) {
|
|
2836
|
+
passes[j].commandList.length = 0;
|
|
2837
|
+
}
|
|
2838
|
+
|
|
2839
|
+
// Insert the primitive/model commands into the command lists
|
|
2840
|
+
const sceneCommands = scene.frameState.commandList;
|
|
2841
|
+
insertShadowCastCommands(scene, sceneCommands, shadowMap);
|
|
2842
|
+
|
|
2843
|
+
for (let j = 0; j < numberOfPasses; ++j) {
|
|
2844
|
+
const pass = shadowMap.passes[j];
|
|
2845
|
+
uniformState.updateCamera(pass.camera);
|
|
2846
|
+
shadowMap.updatePass(context, j);
|
|
2847
|
+
const numberOfCommands = pass.commandList.length;
|
|
2848
|
+
for (let k = 0; k < numberOfCommands; ++k) {
|
|
2849
|
+
const command = pass.commandList[k];
|
|
2850
|
+
// Set the correct pass before rendering into the shadow map because some shaders
|
|
2851
|
+
// conditionally render based on whether the pass is translucent or opaque.
|
|
2852
|
+
uniformState.updatePass(command.pass);
|
|
2853
|
+
executeCommand(
|
|
2854
|
+
command.derivedCommands.shadows.castCommands[i],
|
|
2855
|
+
scene,
|
|
2856
|
+
context,
|
|
2857
|
+
pass.passState
|
|
2858
|
+
);
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
const scratchEyeTranslation = new Cartesian3();
|
|
2865
|
+
|
|
2866
|
+
/**
|
|
2867
|
+
* @private
|
|
2868
|
+
*/
|
|
2869
|
+
Scene.prototype.updateAndExecuteCommands = function (
|
|
2870
|
+
passState,
|
|
2871
|
+
backgroundColor
|
|
2872
|
+
) {
|
|
2873
|
+
const frameState = this._frameState;
|
|
2874
|
+
const mode = frameState.mode;
|
|
2875
|
+
const useWebVR = this._environmentState.useWebVR;
|
|
2876
|
+
|
|
2877
|
+
if (useWebVR) {
|
|
2878
|
+
executeWebVRCommands(this, passState, backgroundColor);
|
|
2879
|
+
} else if (
|
|
2880
|
+
mode !== SceneMode.SCENE2D ||
|
|
2881
|
+
this._mapMode2D === MapMode2D.ROTATE
|
|
2882
|
+
) {
|
|
2883
|
+
executeCommandsInViewport(true, this, passState, backgroundColor);
|
|
2884
|
+
} else {
|
|
2885
|
+
updateAndClearFramebuffers(this, passState, backgroundColor);
|
|
2886
|
+
execute2DViewportCommands(this, passState);
|
|
2887
|
+
}
|
|
2888
|
+
};
|
|
2889
|
+
|
|
2890
|
+
function executeWebVRCommands(scene, passState, backgroundColor) {
|
|
2891
|
+
const view = scene._view;
|
|
2892
|
+
const camera = view.camera;
|
|
2893
|
+
const environmentState = scene._environmentState;
|
|
2894
|
+
const renderTranslucentDepthForPick =
|
|
2895
|
+
environmentState.renderTranslucentDepthForPick;
|
|
2896
|
+
|
|
2897
|
+
updateAndClearFramebuffers(scene, passState, backgroundColor);
|
|
2898
|
+
|
|
2899
|
+
updateAndRenderPrimitives(scene);
|
|
2900
|
+
|
|
2901
|
+
view.createPotentiallyVisibleSet(scene);
|
|
2902
|
+
|
|
2903
|
+
executeComputeCommands(scene);
|
|
2904
|
+
|
|
2905
|
+
if (!renderTranslucentDepthForPick) {
|
|
2906
|
+
executeShadowMapCastCommands(scene);
|
|
2907
|
+
}
|
|
2908
|
+
|
|
2909
|
+
// Based on Calculating Stereo pairs by Paul Bourke
|
|
2910
|
+
// http://paulbourke.net/stereographics/stereorender/
|
|
2911
|
+
const viewport = passState.viewport;
|
|
2912
|
+
viewport.x = 0;
|
|
2913
|
+
viewport.y = 0;
|
|
2914
|
+
viewport.width = viewport.width * 0.5;
|
|
2915
|
+
|
|
2916
|
+
const savedCamera = Camera.clone(camera, scene._cameraVR);
|
|
2917
|
+
savedCamera.frustum = camera.frustum;
|
|
2918
|
+
|
|
2919
|
+
const near = camera.frustum.near;
|
|
2920
|
+
const fo = near * defaultValue(scene.focalLength, 5.0);
|
|
2921
|
+
const eyeSeparation = defaultValue(scene.eyeSeparation, fo / 30.0);
|
|
2922
|
+
const eyeTranslation = Cartesian3.multiplyByScalar(
|
|
2923
|
+
savedCamera.right,
|
|
2924
|
+
eyeSeparation * 0.5,
|
|
2925
|
+
scratchEyeTranslation
|
|
2926
|
+
);
|
|
2927
|
+
|
|
2928
|
+
camera.frustum.aspectRatio = viewport.width / viewport.height;
|
|
2929
|
+
|
|
2930
|
+
const offset = (0.5 * eyeSeparation * near) / fo;
|
|
2931
|
+
|
|
2932
|
+
Cartesian3.add(savedCamera.position, eyeTranslation, camera.position);
|
|
2933
|
+
camera.frustum.xOffset = offset;
|
|
2934
|
+
|
|
2935
|
+
executeCommands(scene, passState);
|
|
2936
|
+
|
|
2937
|
+
viewport.x = viewport.width;
|
|
2938
|
+
|
|
2939
|
+
Cartesian3.subtract(savedCamera.position, eyeTranslation, camera.position);
|
|
2940
|
+
camera.frustum.xOffset = -offset;
|
|
2941
|
+
|
|
2942
|
+
executeCommands(scene, passState);
|
|
2943
|
+
|
|
2944
|
+
Camera.clone(savedCamera, camera);
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2947
|
+
const scratch2DViewportCartographic = new Cartographic(
|
|
2948
|
+
Math.PI,
|
|
2949
|
+
CesiumMath.PI_OVER_TWO
|
|
2950
|
+
);
|
|
2951
|
+
const scratch2DViewportMaxCoord = new Cartesian3();
|
|
2952
|
+
const scratch2DViewportSavedPosition = new Cartesian3();
|
|
2953
|
+
const scratch2DViewportTransform = new Matrix4();
|
|
2954
|
+
const scratch2DViewportCameraTransform = new Matrix4();
|
|
2955
|
+
const scratch2DViewportEyePoint = new Cartesian3();
|
|
2956
|
+
const scratch2DViewportWindowCoords = new Cartesian3();
|
|
2957
|
+
const scratch2DViewport = new BoundingRectangle();
|
|
2958
|
+
|
|
2959
|
+
function execute2DViewportCommands(scene, passState) {
|
|
2960
|
+
const context = scene.context;
|
|
2961
|
+
const frameState = scene.frameState;
|
|
2962
|
+
const camera = scene.camera;
|
|
2963
|
+
|
|
2964
|
+
const originalViewport = passState.viewport;
|
|
2965
|
+
const viewport = BoundingRectangle.clone(originalViewport, scratch2DViewport);
|
|
2966
|
+
passState.viewport = viewport;
|
|
2967
|
+
|
|
2968
|
+
const maxCartographic = scratch2DViewportCartographic;
|
|
2969
|
+
const maxCoord = scratch2DViewportMaxCoord;
|
|
2970
|
+
|
|
2971
|
+
const projection = scene.mapProjection;
|
|
2972
|
+
projection.project(maxCartographic, maxCoord);
|
|
2973
|
+
|
|
2974
|
+
const position = Cartesian3.clone(
|
|
2975
|
+
camera.position,
|
|
2976
|
+
scratch2DViewportSavedPosition
|
|
2977
|
+
);
|
|
2978
|
+
const transform = Matrix4.clone(
|
|
2979
|
+
camera.transform,
|
|
2980
|
+
scratch2DViewportCameraTransform
|
|
2981
|
+
);
|
|
2982
|
+
const frustum = camera.frustum.clone();
|
|
2983
|
+
|
|
2984
|
+
camera._setTransform(Matrix4.IDENTITY);
|
|
2985
|
+
|
|
2986
|
+
const viewportTransformation = Matrix4.computeViewportTransformation(
|
|
2987
|
+
viewport,
|
|
2988
|
+
0.0,
|
|
2989
|
+
1.0,
|
|
2990
|
+
scratch2DViewportTransform
|
|
2991
|
+
);
|
|
2992
|
+
const projectionMatrix = camera.frustum.projectionMatrix;
|
|
2993
|
+
|
|
2994
|
+
const x = camera.positionWC.y;
|
|
2995
|
+
const eyePoint = Cartesian3.fromElements(
|
|
2996
|
+
CesiumMath.sign(x) * maxCoord.x - x,
|
|
2997
|
+
0.0,
|
|
2998
|
+
-camera.positionWC.x,
|
|
2999
|
+
scratch2DViewportEyePoint
|
|
3000
|
+
);
|
|
3001
|
+
const windowCoordinates = Transforms.pointToGLWindowCoordinates(
|
|
3002
|
+
projectionMatrix,
|
|
3003
|
+
viewportTransformation,
|
|
3004
|
+
eyePoint,
|
|
3005
|
+
scratch2DViewportWindowCoords
|
|
3006
|
+
);
|
|
3007
|
+
|
|
3008
|
+
windowCoordinates.x = Math.floor(windowCoordinates.x);
|
|
3009
|
+
|
|
3010
|
+
const viewportX = viewport.x;
|
|
3011
|
+
const viewportWidth = viewport.width;
|
|
3012
|
+
|
|
3013
|
+
if (
|
|
3014
|
+
x === 0.0 ||
|
|
3015
|
+
windowCoordinates.x <= viewportX ||
|
|
3016
|
+
windowCoordinates.x >= viewportX + viewportWidth
|
|
3017
|
+
) {
|
|
3018
|
+
executeCommandsInViewport(true, scene, passState);
|
|
3019
|
+
} else if (
|
|
3020
|
+
Math.abs(viewportX + viewportWidth * 0.5 - windowCoordinates.x) < 1.0
|
|
3021
|
+
) {
|
|
3022
|
+
viewport.width = windowCoordinates.x - viewport.x;
|
|
3023
|
+
|
|
3024
|
+
camera.position.x *= CesiumMath.sign(camera.position.x);
|
|
3025
|
+
|
|
3026
|
+
camera.frustum.right = 0.0;
|
|
3027
|
+
|
|
3028
|
+
frameState.cullingVolume = camera.frustum.computeCullingVolume(
|
|
3029
|
+
camera.positionWC,
|
|
3030
|
+
camera.directionWC,
|
|
3031
|
+
camera.upWC
|
|
3032
|
+
);
|
|
3033
|
+
context.uniformState.update(frameState);
|
|
3034
|
+
|
|
3035
|
+
executeCommandsInViewport(true, scene, passState);
|
|
3036
|
+
|
|
3037
|
+
viewport.x = windowCoordinates.x;
|
|
3038
|
+
|
|
3039
|
+
camera.position.x = -camera.position.x;
|
|
3040
|
+
|
|
3041
|
+
camera.frustum.right = -camera.frustum.left;
|
|
3042
|
+
camera.frustum.left = 0.0;
|
|
3043
|
+
|
|
3044
|
+
frameState.cullingVolume = camera.frustum.computeCullingVolume(
|
|
3045
|
+
camera.positionWC,
|
|
3046
|
+
camera.directionWC,
|
|
3047
|
+
camera.upWC
|
|
3048
|
+
);
|
|
3049
|
+
context.uniformState.update(frameState);
|
|
3050
|
+
|
|
3051
|
+
executeCommandsInViewport(false, scene, passState);
|
|
3052
|
+
} else if (windowCoordinates.x > viewportX + viewportWidth * 0.5) {
|
|
3053
|
+
viewport.width = windowCoordinates.x - viewportX;
|
|
3054
|
+
|
|
3055
|
+
const right = camera.frustum.right;
|
|
3056
|
+
camera.frustum.right = maxCoord.x - x;
|
|
3057
|
+
|
|
3058
|
+
frameState.cullingVolume = camera.frustum.computeCullingVolume(
|
|
3059
|
+
camera.positionWC,
|
|
3060
|
+
camera.directionWC,
|
|
3061
|
+
camera.upWC
|
|
3062
|
+
);
|
|
3063
|
+
context.uniformState.update(frameState);
|
|
3064
|
+
|
|
3065
|
+
executeCommandsInViewport(true, scene, passState);
|
|
3066
|
+
|
|
3067
|
+
viewport.x = windowCoordinates.x;
|
|
3068
|
+
viewport.width = viewportX + viewportWidth - windowCoordinates.x;
|
|
3069
|
+
|
|
3070
|
+
camera.position.x = -camera.position.x;
|
|
3071
|
+
|
|
3072
|
+
camera.frustum.left = -camera.frustum.right;
|
|
3073
|
+
camera.frustum.right = right - camera.frustum.right * 2.0;
|
|
3074
|
+
|
|
3075
|
+
frameState.cullingVolume = camera.frustum.computeCullingVolume(
|
|
3076
|
+
camera.positionWC,
|
|
3077
|
+
camera.directionWC,
|
|
3078
|
+
camera.upWC
|
|
3079
|
+
);
|
|
3080
|
+
context.uniformState.update(frameState);
|
|
3081
|
+
|
|
3082
|
+
executeCommandsInViewport(false, scene, passState);
|
|
3083
|
+
} else {
|
|
3084
|
+
viewport.x = windowCoordinates.x;
|
|
3085
|
+
viewport.width = viewportX + viewportWidth - windowCoordinates.x;
|
|
3086
|
+
|
|
3087
|
+
const left = camera.frustum.left;
|
|
3088
|
+
camera.frustum.left = -maxCoord.x - x;
|
|
3089
|
+
|
|
3090
|
+
frameState.cullingVolume = camera.frustum.computeCullingVolume(
|
|
3091
|
+
camera.positionWC,
|
|
3092
|
+
camera.directionWC,
|
|
3093
|
+
camera.upWC
|
|
3094
|
+
);
|
|
3095
|
+
context.uniformState.update(frameState);
|
|
3096
|
+
|
|
3097
|
+
executeCommandsInViewport(true, scene, passState);
|
|
3098
|
+
|
|
3099
|
+
viewport.x = viewportX;
|
|
3100
|
+
viewport.width = windowCoordinates.x - viewportX;
|
|
3101
|
+
|
|
3102
|
+
camera.position.x = -camera.position.x;
|
|
3103
|
+
|
|
3104
|
+
camera.frustum.right = -camera.frustum.left;
|
|
3105
|
+
camera.frustum.left = left - camera.frustum.left * 2.0;
|
|
3106
|
+
|
|
3107
|
+
frameState.cullingVolume = camera.frustum.computeCullingVolume(
|
|
3108
|
+
camera.positionWC,
|
|
3109
|
+
camera.directionWC,
|
|
3110
|
+
camera.upWC
|
|
3111
|
+
);
|
|
3112
|
+
context.uniformState.update(frameState);
|
|
3113
|
+
|
|
3114
|
+
executeCommandsInViewport(false, scene, passState);
|
|
3115
|
+
}
|
|
3116
|
+
|
|
3117
|
+
camera._setTransform(transform);
|
|
3118
|
+
Cartesian3.clone(position, camera.position);
|
|
3119
|
+
camera.frustum = frustum.clone();
|
|
3120
|
+
passState.viewport = originalViewport;
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
function executeCommandsInViewport(
|
|
3124
|
+
firstViewport,
|
|
3125
|
+
scene,
|
|
3126
|
+
passState,
|
|
3127
|
+
backgroundColor
|
|
3128
|
+
) {
|
|
3129
|
+
const environmentState = scene._environmentState;
|
|
3130
|
+
const view = scene._view;
|
|
3131
|
+
const renderTranslucentDepthForPick =
|
|
3132
|
+
environmentState.renderTranslucentDepthForPick;
|
|
3133
|
+
|
|
3134
|
+
if (!firstViewport) {
|
|
3135
|
+
scene.frameState.commandList.length = 0;
|
|
3136
|
+
}
|
|
3137
|
+
|
|
3138
|
+
updateAndRenderPrimitives(scene);
|
|
3139
|
+
|
|
3140
|
+
view.createPotentiallyVisibleSet(scene);
|
|
3141
|
+
|
|
3142
|
+
if (firstViewport) {
|
|
3143
|
+
if (defined(backgroundColor)) {
|
|
3144
|
+
updateAndClearFramebuffers(scene, passState, backgroundColor);
|
|
3145
|
+
}
|
|
3146
|
+
executeComputeCommands(scene);
|
|
3147
|
+
if (!renderTranslucentDepthForPick) {
|
|
3148
|
+
executeShadowMapCastCommands(scene);
|
|
3149
|
+
}
|
|
3150
|
+
}
|
|
3151
|
+
|
|
3152
|
+
executeCommands(scene, passState);
|
|
3153
|
+
}
|
|
3154
|
+
|
|
3155
|
+
const scratchCullingVolume = new CullingVolume();
|
|
3156
|
+
|
|
3157
|
+
/**
|
|
3158
|
+
* @private
|
|
3159
|
+
*/
|
|
3160
|
+
Scene.prototype.updateEnvironment = function () {
|
|
3161
|
+
const frameState = this._frameState;
|
|
3162
|
+
const view = this._view;
|
|
3163
|
+
|
|
3164
|
+
// Update celestial and terrestrial environment effects.
|
|
3165
|
+
const environmentState = this._environmentState;
|
|
3166
|
+
const renderPass = frameState.passes.render;
|
|
3167
|
+
const offscreenPass = frameState.passes.offscreen;
|
|
3168
|
+
const skyAtmosphere = this.skyAtmosphere;
|
|
3169
|
+
const globe = this.globe;
|
|
3170
|
+
const globeTranslucencyState = this._globeTranslucencyState;
|
|
3171
|
+
|
|
3172
|
+
if (
|
|
3173
|
+
!renderPass ||
|
|
3174
|
+
(this._mode !== SceneMode.SCENE2D &&
|
|
3175
|
+
view.camera.frustum instanceof OrthographicFrustum) ||
|
|
3176
|
+
!globeTranslucencyState.environmentVisible
|
|
3177
|
+
) {
|
|
3178
|
+
environmentState.skyAtmosphereCommand = undefined;
|
|
3179
|
+
environmentState.skyBoxCommand = undefined;
|
|
3180
|
+
environmentState.sunDrawCommand = undefined;
|
|
3181
|
+
environmentState.sunComputeCommand = undefined;
|
|
3182
|
+
environmentState.moonCommand = undefined;
|
|
3183
|
+
} else {
|
|
3184
|
+
if (defined(skyAtmosphere)) {
|
|
3185
|
+
if (defined(globe)) {
|
|
3186
|
+
skyAtmosphere.setDynamicAtmosphereColor(
|
|
3187
|
+
globe.enableLighting && globe.dynamicAtmosphereLighting,
|
|
3188
|
+
globe.dynamicAtmosphereLightingFromSun
|
|
3189
|
+
);
|
|
3190
|
+
environmentState.isReadyForAtmosphere =
|
|
3191
|
+
environmentState.isReadyForAtmosphere ||
|
|
3192
|
+
globe._surface._tilesToRender.length > 0;
|
|
3193
|
+
}
|
|
3194
|
+
environmentState.skyAtmosphereCommand = skyAtmosphere.update(
|
|
3195
|
+
frameState,
|
|
3196
|
+
globe
|
|
3197
|
+
);
|
|
3198
|
+
if (defined(environmentState.skyAtmosphereCommand)) {
|
|
3199
|
+
this.updateDerivedCommands(environmentState.skyAtmosphereCommand);
|
|
3200
|
+
}
|
|
3201
|
+
} else {
|
|
3202
|
+
environmentState.skyAtmosphereCommand = undefined;
|
|
3203
|
+
}
|
|
3204
|
+
|
|
3205
|
+
environmentState.skyBoxCommand = defined(this.skyBox)
|
|
3206
|
+
? this.skyBox.update(frameState, this._hdr)
|
|
3207
|
+
: undefined;
|
|
3208
|
+
const sunCommands = defined(this.sun)
|
|
3209
|
+
? this.sun.update(frameState, view.passState, this._hdr)
|
|
3210
|
+
: undefined;
|
|
3211
|
+
environmentState.sunDrawCommand = defined(sunCommands)
|
|
3212
|
+
? sunCommands.drawCommand
|
|
3213
|
+
: undefined;
|
|
3214
|
+
environmentState.sunComputeCommand = defined(sunCommands)
|
|
3215
|
+
? sunCommands.computeCommand
|
|
3216
|
+
: undefined;
|
|
3217
|
+
environmentState.moonCommand = defined(this.moon)
|
|
3218
|
+
? this.moon.update(frameState)
|
|
3219
|
+
: undefined;
|
|
3220
|
+
}
|
|
3221
|
+
|
|
3222
|
+
const clearGlobeDepth = (environmentState.clearGlobeDepth =
|
|
3223
|
+
defined(globe) &&
|
|
3224
|
+
globe.show &&
|
|
3225
|
+
(!globe.depthTestAgainstTerrain || this.mode === SceneMode.SCENE2D));
|
|
3226
|
+
const useDepthPlane = (environmentState.useDepthPlane =
|
|
3227
|
+
clearGlobeDepth &&
|
|
3228
|
+
this.mode === SceneMode.SCENE3D &&
|
|
3229
|
+
globeTranslucencyState.useDepthPlane);
|
|
3230
|
+
if (useDepthPlane) {
|
|
3231
|
+
// Update the depth plane that is rendered in 3D when the primitives are
|
|
3232
|
+
// not depth tested against terrain so primitives on the backface
|
|
3233
|
+
// of the globe are not picked.
|
|
3234
|
+
this._depthPlane.update(frameState);
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3237
|
+
environmentState.renderTranslucentDepthForPick = false;
|
|
3238
|
+
environmentState.useWebVR =
|
|
3239
|
+
this._useWebVR && this.mode !== SceneMode.SCENE2D && !offscreenPass;
|
|
3240
|
+
|
|
3241
|
+
const occluder =
|
|
3242
|
+
frameState.mode === SceneMode.SCENE3D &&
|
|
3243
|
+
!globeTranslucencyState.sunVisibleThroughGlobe
|
|
3244
|
+
? frameState.occluder
|
|
3245
|
+
: undefined;
|
|
3246
|
+
let cullingVolume = frameState.cullingVolume;
|
|
3247
|
+
|
|
3248
|
+
// get user culling volume minus the far plane.
|
|
3249
|
+
const planes = scratchCullingVolume.planes;
|
|
3250
|
+
for (let k = 0; k < 5; ++k) {
|
|
3251
|
+
planes[k] = cullingVolume.planes[k];
|
|
3252
|
+
}
|
|
3253
|
+
cullingVolume = scratchCullingVolume;
|
|
3254
|
+
|
|
3255
|
+
// Determine visibility of celestial and terrestrial environment effects.
|
|
3256
|
+
environmentState.isSkyAtmosphereVisible =
|
|
3257
|
+
defined(environmentState.skyAtmosphereCommand) &&
|
|
3258
|
+
environmentState.isReadyForAtmosphere;
|
|
3259
|
+
environmentState.isSunVisible = this.isVisible(
|
|
3260
|
+
environmentState.sunDrawCommand,
|
|
3261
|
+
cullingVolume,
|
|
3262
|
+
occluder
|
|
3263
|
+
);
|
|
3264
|
+
environmentState.isMoonVisible = this.isVisible(
|
|
3265
|
+
environmentState.moonCommand,
|
|
3266
|
+
cullingVolume,
|
|
3267
|
+
occluder
|
|
3268
|
+
);
|
|
3269
|
+
|
|
3270
|
+
const envMaps = this.specularEnvironmentMaps;
|
|
3271
|
+
let envMapAtlas = this._specularEnvironmentMapAtlas;
|
|
3272
|
+
if (
|
|
3273
|
+
defined(envMaps) &&
|
|
3274
|
+
(!defined(envMapAtlas) || envMapAtlas.url !== envMaps)
|
|
3275
|
+
) {
|
|
3276
|
+
envMapAtlas = envMapAtlas && envMapAtlas.destroy();
|
|
3277
|
+
this._specularEnvironmentMapAtlas = new OctahedralProjectedCubeMap(envMaps);
|
|
3278
|
+
} else if (!defined(envMaps) && defined(envMapAtlas)) {
|
|
3279
|
+
envMapAtlas.destroy();
|
|
3280
|
+
this._specularEnvironmentMapAtlas = undefined;
|
|
3281
|
+
}
|
|
3282
|
+
|
|
3283
|
+
if (defined(this._specularEnvironmentMapAtlas)) {
|
|
3284
|
+
this._specularEnvironmentMapAtlas.update(frameState);
|
|
3285
|
+
}
|
|
3286
|
+
};
|
|
3287
|
+
|
|
3288
|
+
function updateDebugFrustumPlanes(scene) {
|
|
3289
|
+
const frameState = scene._frameState;
|
|
3290
|
+
if (scene.debugShowFrustumPlanes !== scene._debugShowFrustumPlanes) {
|
|
3291
|
+
if (scene.debugShowFrustumPlanes) {
|
|
3292
|
+
scene._debugFrustumPlanes = new DebugCameraPrimitive({
|
|
3293
|
+
camera: scene.camera,
|
|
3294
|
+
updateOnChange: false,
|
|
3295
|
+
frustumSplits: frameState.frustumSplits,
|
|
3296
|
+
});
|
|
3297
|
+
} else {
|
|
3298
|
+
scene._debugFrustumPlanes =
|
|
3299
|
+
scene._debugFrustumPlanes && scene._debugFrustumPlanes.destroy();
|
|
3300
|
+
}
|
|
3301
|
+
scene._debugShowFrustumPlanes = scene.debugShowFrustumPlanes;
|
|
3302
|
+
}
|
|
3303
|
+
|
|
3304
|
+
if (defined(scene._debugFrustumPlanes)) {
|
|
3305
|
+
scene._debugFrustumPlanes.update(frameState);
|
|
3306
|
+
}
|
|
3307
|
+
}
|
|
3308
|
+
|
|
3309
|
+
function updateShadowMaps(scene) {
|
|
3310
|
+
const frameState = scene._frameState;
|
|
3311
|
+
const shadowMaps = frameState.shadowMaps;
|
|
3312
|
+
const length = shadowMaps.length;
|
|
3313
|
+
|
|
3314
|
+
const shadowsEnabled =
|
|
3315
|
+
length > 0 && !frameState.passes.pick && scene.mode === SceneMode.SCENE3D;
|
|
3316
|
+
if (shadowsEnabled !== frameState.shadowState.shadowsEnabled) {
|
|
3317
|
+
// Update derived commands when shadowsEnabled changes
|
|
3318
|
+
++frameState.shadowState.lastDirtyTime;
|
|
3319
|
+
frameState.shadowState.shadowsEnabled = shadowsEnabled;
|
|
3320
|
+
}
|
|
3321
|
+
|
|
3322
|
+
frameState.shadowState.lightShadowsEnabled = false;
|
|
3323
|
+
|
|
3324
|
+
if (!shadowsEnabled) {
|
|
3325
|
+
return;
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
// Check if the shadow maps are different than the shadow maps last frame.
|
|
3329
|
+
// If so, the derived commands need to be updated.
|
|
3330
|
+
for (let j = 0; j < length; ++j) {
|
|
3331
|
+
if (shadowMaps[j] !== frameState.shadowState.shadowMaps[j]) {
|
|
3332
|
+
++frameState.shadowState.lastDirtyTime;
|
|
3333
|
+
break;
|
|
3334
|
+
}
|
|
3335
|
+
}
|
|
3336
|
+
|
|
3337
|
+
frameState.shadowState.shadowMaps.length = 0;
|
|
3338
|
+
frameState.shadowState.lightShadowMaps.length = 0;
|
|
3339
|
+
|
|
3340
|
+
for (let i = 0; i < length; ++i) {
|
|
3341
|
+
const shadowMap = shadowMaps[i];
|
|
3342
|
+
shadowMap.update(frameState);
|
|
3343
|
+
|
|
3344
|
+
frameState.shadowState.shadowMaps.push(shadowMap);
|
|
3345
|
+
|
|
3346
|
+
if (shadowMap.fromLightSource) {
|
|
3347
|
+
frameState.shadowState.lightShadowMaps.push(shadowMap);
|
|
3348
|
+
frameState.shadowState.lightShadowsEnabled = true;
|
|
3349
|
+
}
|
|
3350
|
+
|
|
3351
|
+
if (shadowMap.dirty) {
|
|
3352
|
+
++frameState.shadowState.lastDirtyTime;
|
|
3353
|
+
shadowMap.dirty = false;
|
|
3354
|
+
}
|
|
3355
|
+
}
|
|
3356
|
+
}
|
|
3357
|
+
|
|
3358
|
+
function updateAndRenderPrimitives(scene) {
|
|
3359
|
+
const frameState = scene._frameState;
|
|
3360
|
+
|
|
3361
|
+
scene._groundPrimitives.update(frameState);
|
|
3362
|
+
scene._primitives.update(frameState);
|
|
3363
|
+
|
|
3364
|
+
updateDebugFrustumPlanes(scene);
|
|
3365
|
+
updateShadowMaps(scene);
|
|
3366
|
+
|
|
3367
|
+
if (scene._globe) {
|
|
3368
|
+
scene._globe.render(frameState);
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
|
|
3372
|
+
function updateAndClearFramebuffers(scene, passState, clearColor) {
|
|
3373
|
+
const context = scene._context;
|
|
3374
|
+
const frameState = scene._frameState;
|
|
3375
|
+
const environmentState = scene._environmentState;
|
|
3376
|
+
const view = scene._view;
|
|
3377
|
+
|
|
3378
|
+
const passes = scene._frameState.passes;
|
|
3379
|
+
const picking = passes.pick;
|
|
3380
|
+
if (defined(view.globeDepth)) {
|
|
3381
|
+
view.globeDepth.picking = picking;
|
|
3382
|
+
}
|
|
3383
|
+
const useWebVR = environmentState.useWebVR;
|
|
3384
|
+
|
|
3385
|
+
// Preserve the reference to the original framebuffer.
|
|
3386
|
+
environmentState.originalFramebuffer = passState.framebuffer;
|
|
3387
|
+
|
|
3388
|
+
// Manage sun bloom post-processing effect.
|
|
3389
|
+
if (defined(scene.sun) && scene.sunBloom !== scene._sunBloom) {
|
|
3390
|
+
if (scene.sunBloom && !useWebVR) {
|
|
3391
|
+
scene._sunPostProcess = new SunPostProcess();
|
|
3392
|
+
} else if (defined(scene._sunPostProcess)) {
|
|
3393
|
+
scene._sunPostProcess = scene._sunPostProcess.destroy();
|
|
3394
|
+
}
|
|
3395
|
+
|
|
3396
|
+
scene._sunBloom = scene.sunBloom;
|
|
3397
|
+
} else if (!defined(scene.sun) && defined(scene._sunPostProcess)) {
|
|
3398
|
+
scene._sunPostProcess = scene._sunPostProcess.destroy();
|
|
3399
|
+
scene._sunBloom = false;
|
|
3400
|
+
}
|
|
3401
|
+
|
|
3402
|
+
// Clear the pass state framebuffer.
|
|
3403
|
+
const clear = scene._clearColorCommand;
|
|
3404
|
+
Color.clone(clearColor, clear.color);
|
|
3405
|
+
clear.execute(context, passState);
|
|
3406
|
+
|
|
3407
|
+
// Update globe depth rendering based on the current context and clear the globe depth framebuffer.
|
|
3408
|
+
// Globe depth is copied for the pick pass to support picking batched geometries in GroundPrimitives.
|
|
3409
|
+
const useGlobeDepthFramebuffer = (environmentState.useGlobeDepthFramebuffer = defined(
|
|
3410
|
+
view.globeDepth
|
|
3411
|
+
));
|
|
3412
|
+
if (useGlobeDepthFramebuffer) {
|
|
3413
|
+
view.globeDepth.update(
|
|
3414
|
+
context,
|
|
3415
|
+
passState,
|
|
3416
|
+
view.viewport,
|
|
3417
|
+
scene.msaaSamples,
|
|
3418
|
+
scene._hdr,
|
|
3419
|
+
environmentState.clearGlobeDepth
|
|
3420
|
+
);
|
|
3421
|
+
view.globeDepth.clear(context, passState, clearColor);
|
|
3422
|
+
}
|
|
3423
|
+
|
|
3424
|
+
// If supported, configure OIT to use the globe depth framebuffer and clear the OIT framebuffer.
|
|
3425
|
+
const oit = view.oit;
|
|
3426
|
+
const useOIT = (environmentState.useOIT =
|
|
3427
|
+
!picking && defined(oit) && oit.isSupported());
|
|
3428
|
+
if (useOIT) {
|
|
3429
|
+
oit.update(
|
|
3430
|
+
context,
|
|
3431
|
+
passState,
|
|
3432
|
+
view.globeDepth.colorFramebufferManager,
|
|
3433
|
+
scene._hdr,
|
|
3434
|
+
scene.msaaSamples
|
|
3435
|
+
);
|
|
3436
|
+
oit.clear(context, passState, clearColor);
|
|
3437
|
+
environmentState.useOIT = oit.isSupported();
|
|
3438
|
+
}
|
|
3439
|
+
|
|
3440
|
+
const postProcess = scene.postProcessStages;
|
|
3441
|
+
let usePostProcess = (environmentState.usePostProcess =
|
|
3442
|
+
!picking &&
|
|
3443
|
+
(scene._hdr ||
|
|
3444
|
+
postProcess.length > 0 ||
|
|
3445
|
+
postProcess.ambientOcclusion.enabled ||
|
|
3446
|
+
postProcess.fxaa.enabled ||
|
|
3447
|
+
postProcess.bloom.enabled));
|
|
3448
|
+
environmentState.usePostProcessSelected = false;
|
|
3449
|
+
if (usePostProcess) {
|
|
3450
|
+
view.sceneFramebuffer.update(
|
|
3451
|
+
context,
|
|
3452
|
+
view.viewport,
|
|
3453
|
+
scene._hdr,
|
|
3454
|
+
scene.msaaSamples
|
|
3455
|
+
);
|
|
3456
|
+
view.sceneFramebuffer.clear(context, passState, clearColor);
|
|
3457
|
+
|
|
3458
|
+
postProcess.update(context, frameState.useLogDepth, scene._hdr);
|
|
3459
|
+
postProcess.clear(context);
|
|
3460
|
+
|
|
3461
|
+
usePostProcess = environmentState.usePostProcess = postProcess.ready;
|
|
3462
|
+
environmentState.usePostProcessSelected =
|
|
3463
|
+
usePostProcess && postProcess.hasSelected;
|
|
3464
|
+
}
|
|
3465
|
+
|
|
3466
|
+
if (environmentState.isSunVisible && scene.sunBloom && !useWebVR) {
|
|
3467
|
+
passState.framebuffer = scene._sunPostProcess.update(passState);
|
|
3468
|
+
scene._sunPostProcess.clear(context, passState, clearColor);
|
|
3469
|
+
} else if (useGlobeDepthFramebuffer) {
|
|
3470
|
+
passState.framebuffer = view.globeDepth.framebuffer;
|
|
3471
|
+
} else if (usePostProcess) {
|
|
3472
|
+
passState.framebuffer = view.sceneFramebuffer.framebuffer;
|
|
3473
|
+
}
|
|
3474
|
+
|
|
3475
|
+
if (defined(passState.framebuffer)) {
|
|
3476
|
+
clear.execute(context, passState);
|
|
3477
|
+
}
|
|
3478
|
+
|
|
3479
|
+
const useInvertClassification = (environmentState.useInvertClassification =
|
|
3480
|
+
!picking && defined(passState.framebuffer) && scene.invertClassification);
|
|
3481
|
+
if (useInvertClassification) {
|
|
3482
|
+
let depthFramebuffer;
|
|
3483
|
+
if (scene.frameState.invertClassificationColor.alpha === 1.0) {
|
|
3484
|
+
if (environmentState.useGlobeDepthFramebuffer) {
|
|
3485
|
+
depthFramebuffer = view.globeDepth.framebuffer;
|
|
3486
|
+
}
|
|
3487
|
+
}
|
|
3488
|
+
|
|
3489
|
+
if (defined(depthFramebuffer) || context.depthTexture) {
|
|
3490
|
+
scene._invertClassification.previousFramebuffer = depthFramebuffer;
|
|
3491
|
+
scene._invertClassification.update(
|
|
3492
|
+
context,
|
|
3493
|
+
scene.msaaSamples,
|
|
3494
|
+
view.globeDepth.colorFramebufferManager
|
|
3495
|
+
);
|
|
3496
|
+
scene._invertClassification.clear(context, passState);
|
|
3497
|
+
|
|
3498
|
+
if (scene.frameState.invertClassificationColor.alpha < 1.0 && useOIT) {
|
|
3499
|
+
const command = scene._invertClassification.unclassifiedCommand;
|
|
3500
|
+
const derivedCommands = command.derivedCommands;
|
|
3501
|
+
derivedCommands.oit = oit.createDerivedCommands(
|
|
3502
|
+
command,
|
|
3503
|
+
context,
|
|
3504
|
+
derivedCommands.oit
|
|
3505
|
+
);
|
|
3506
|
+
}
|
|
3507
|
+
} else {
|
|
3508
|
+
environmentState.useInvertClassification = false;
|
|
3509
|
+
}
|
|
3510
|
+
}
|
|
3511
|
+
|
|
3512
|
+
if (scene._globeTranslucencyState.translucent) {
|
|
3513
|
+
view.globeTranslucencyFramebuffer.updateAndClear(
|
|
3514
|
+
scene._hdr,
|
|
3515
|
+
view.viewport,
|
|
3516
|
+
context,
|
|
3517
|
+
passState
|
|
3518
|
+
);
|
|
3519
|
+
}
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3522
|
+
/**
|
|
3523
|
+
* @private
|
|
3524
|
+
*/
|
|
3525
|
+
Scene.prototype.resolveFramebuffers = function (passState) {
|
|
3526
|
+
const context = this._context;
|
|
3527
|
+
const environmentState = this._environmentState;
|
|
3528
|
+
const view = this._view;
|
|
3529
|
+
const globeDepth = view.globeDepth;
|
|
3530
|
+
if (defined(globeDepth)) {
|
|
3531
|
+
globeDepth.prepareColorTextures(context);
|
|
3532
|
+
}
|
|
3533
|
+
|
|
3534
|
+
const useOIT = environmentState.useOIT;
|
|
3535
|
+
const useGlobeDepthFramebuffer = environmentState.useGlobeDepthFramebuffer;
|
|
3536
|
+
const usePostProcess = environmentState.usePostProcess;
|
|
3537
|
+
|
|
3538
|
+
const defaultFramebuffer = environmentState.originalFramebuffer;
|
|
3539
|
+
const globeFramebuffer = useGlobeDepthFramebuffer
|
|
3540
|
+
? globeDepth.colorFramebufferManager
|
|
3541
|
+
: undefined;
|
|
3542
|
+
const sceneFramebuffer = view.sceneFramebuffer._colorFramebuffer;
|
|
3543
|
+
const idFramebuffer = view.sceneFramebuffer.idFramebuffer;
|
|
3544
|
+
|
|
3545
|
+
if (useOIT) {
|
|
3546
|
+
passState.framebuffer = usePostProcess
|
|
3547
|
+
? sceneFramebuffer.framebuffer
|
|
3548
|
+
: defaultFramebuffer;
|
|
3549
|
+
view.oit.execute(context, passState);
|
|
3550
|
+
}
|
|
3551
|
+
|
|
3552
|
+
const translucentTileClassification = view.translucentTileClassification;
|
|
3553
|
+
if (
|
|
3554
|
+
translucentTileClassification.hasTranslucentDepth &&
|
|
3555
|
+
translucentTileClassification.isSupported()
|
|
3556
|
+
) {
|
|
3557
|
+
translucentTileClassification.execute(this, passState);
|
|
3558
|
+
}
|
|
3559
|
+
|
|
3560
|
+
if (usePostProcess) {
|
|
3561
|
+
view.sceneFramebuffer.prepareColorTextures(context);
|
|
3562
|
+
let inputFramebuffer = sceneFramebuffer;
|
|
3563
|
+
if (useGlobeDepthFramebuffer && !useOIT) {
|
|
3564
|
+
inputFramebuffer = globeFramebuffer;
|
|
3565
|
+
}
|
|
3566
|
+
|
|
3567
|
+
const postProcess = this.postProcessStages;
|
|
3568
|
+
const colorTexture = inputFramebuffer.getColorTexture(0);
|
|
3569
|
+
const idTexture = idFramebuffer.getColorTexture(0);
|
|
3570
|
+
const depthTexture = defaultValue(
|
|
3571
|
+
globeFramebuffer,
|
|
3572
|
+
sceneFramebuffer
|
|
3573
|
+
).getDepthStencilTexture();
|
|
3574
|
+
postProcess.execute(context, colorTexture, depthTexture, idTexture);
|
|
3575
|
+
postProcess.copy(context, defaultFramebuffer);
|
|
3576
|
+
}
|
|
3577
|
+
|
|
3578
|
+
if (!useOIT && !usePostProcess && useGlobeDepthFramebuffer) {
|
|
3579
|
+
passState.framebuffer = defaultFramebuffer;
|
|
3580
|
+
globeDepth.executeCopyColor(context, passState);
|
|
3581
|
+
}
|
|
3582
|
+
};
|
|
3583
|
+
|
|
3584
|
+
function callAfterRenderFunctions(scene) {
|
|
3585
|
+
// Functions are queued up during primitive update and executed here in case
|
|
3586
|
+
// the function modifies scene state that should remain constant over the frame.
|
|
3587
|
+
const functions = scene._frameState.afterRender;
|
|
3588
|
+
for (let i = 0, length = functions.length; i < length; ++i) {
|
|
3589
|
+
const shouldRequestRender = functions[i]();
|
|
3590
|
+
if (shouldRequestRender) {
|
|
3591
|
+
scene.requestRender();
|
|
3592
|
+
}
|
|
3593
|
+
}
|
|
3594
|
+
|
|
3595
|
+
functions.length = 0;
|
|
3596
|
+
}
|
|
3597
|
+
|
|
3598
|
+
function getGlobeHeight(scene) {
|
|
3599
|
+
const globe = scene._globe;
|
|
3600
|
+
const camera = scene.camera;
|
|
3601
|
+
const cartographic = camera.positionCartographic;
|
|
3602
|
+
if (defined(globe) && globe.show && defined(cartographic)) {
|
|
3603
|
+
return globe.getHeight(cartographic);
|
|
3604
|
+
}
|
|
3605
|
+
return undefined;
|
|
3606
|
+
}
|
|
3607
|
+
|
|
3608
|
+
function isCameraUnderground(scene) {
|
|
3609
|
+
const camera = scene.camera;
|
|
3610
|
+
const mode = scene._mode;
|
|
3611
|
+
const globe = scene.globe;
|
|
3612
|
+
const cameraController = scene._screenSpaceCameraController;
|
|
3613
|
+
const cartographic = camera.positionCartographic;
|
|
3614
|
+
|
|
3615
|
+
if (!defined(cartographic)) {
|
|
3616
|
+
return false;
|
|
3617
|
+
}
|
|
3618
|
+
|
|
3619
|
+
if (!cameraController.onMap() && cartographic.height < 0.0) {
|
|
3620
|
+
// The camera can go off the map while in Columbus View.
|
|
3621
|
+
// Make a best guess as to whether it's underground by checking if its height is less than zero.
|
|
3622
|
+
return true;
|
|
3623
|
+
}
|
|
3624
|
+
|
|
3625
|
+
if (
|
|
3626
|
+
!defined(globe) ||
|
|
3627
|
+
!globe.show ||
|
|
3628
|
+
mode === SceneMode.SCENE2D ||
|
|
3629
|
+
mode === SceneMode.MORPHING
|
|
3630
|
+
) {
|
|
3631
|
+
return false;
|
|
3632
|
+
}
|
|
3633
|
+
|
|
3634
|
+
const globeHeight = scene._globeHeight;
|
|
3635
|
+
return defined(globeHeight) && cartographic.height < globeHeight;
|
|
3636
|
+
}
|
|
3637
|
+
|
|
3638
|
+
/**
|
|
3639
|
+
* @private
|
|
3640
|
+
*/
|
|
3641
|
+
Scene.prototype.initializeFrame = function () {
|
|
3642
|
+
// Destroy released shaders and textures once every 120 frames to avoid thrashing the cache
|
|
3643
|
+
if (this._shaderFrameCount++ === 120) {
|
|
3644
|
+
this._shaderFrameCount = 0;
|
|
3645
|
+
this._context.shaderCache.destroyReleasedShaderPrograms();
|
|
3646
|
+
this._context.textureCache.destroyReleasedTextures();
|
|
3647
|
+
}
|
|
3648
|
+
|
|
3649
|
+
this._tweens.update();
|
|
3650
|
+
|
|
3651
|
+
this._globeHeight = getGlobeHeight(this);
|
|
3652
|
+
this._cameraUnderground = isCameraUnderground(this);
|
|
3653
|
+
this._globeTranslucencyState.update(this);
|
|
3654
|
+
|
|
3655
|
+
this._screenSpaceCameraController.update();
|
|
3656
|
+
if (defined(this._deviceOrientationCameraController)) {
|
|
3657
|
+
this._deviceOrientationCameraController.update();
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3660
|
+
this.camera.update(this._mode);
|
|
3661
|
+
this.camera._updateCameraChanged();
|
|
3662
|
+
};
|
|
3663
|
+
|
|
3664
|
+
function updateDebugShowFramesPerSecond(scene, renderedThisFrame) {
|
|
3665
|
+
if (scene.debugShowFramesPerSecond) {
|
|
3666
|
+
if (!defined(scene._performanceDisplay)) {
|
|
3667
|
+
const performanceContainer = document.createElement("div");
|
|
3668
|
+
performanceContainer.className =
|
|
3669
|
+
"cesium-performanceDisplay-defaultContainer";
|
|
3670
|
+
const container = scene._canvas.parentNode;
|
|
3671
|
+
container.appendChild(performanceContainer);
|
|
3672
|
+
const performanceDisplay = new PerformanceDisplay({
|
|
3673
|
+
container: performanceContainer,
|
|
3674
|
+
});
|
|
3675
|
+
scene._performanceDisplay = performanceDisplay;
|
|
3676
|
+
scene._performanceContainer = performanceContainer;
|
|
3677
|
+
}
|
|
3678
|
+
|
|
3679
|
+
scene._performanceDisplay.throttled = scene.requestRenderMode;
|
|
3680
|
+
scene._performanceDisplay.update(renderedThisFrame);
|
|
3681
|
+
} else if (defined(scene._performanceDisplay)) {
|
|
3682
|
+
scene._performanceDisplay =
|
|
3683
|
+
scene._performanceDisplay && scene._performanceDisplay.destroy();
|
|
3684
|
+
scene._performanceContainer.parentNode.removeChild(
|
|
3685
|
+
scene._performanceContainer
|
|
3686
|
+
);
|
|
3687
|
+
}
|
|
3688
|
+
}
|
|
3689
|
+
|
|
3690
|
+
function prePassesUpdate(scene) {
|
|
3691
|
+
scene._jobScheduler.resetBudgets();
|
|
3692
|
+
|
|
3693
|
+
const frameState = scene._frameState;
|
|
3694
|
+
const primitives = scene.primitives;
|
|
3695
|
+
primitives.prePassesUpdate(frameState);
|
|
3696
|
+
|
|
3697
|
+
if (defined(scene.globe)) {
|
|
3698
|
+
scene.globe.update(frameState);
|
|
3699
|
+
}
|
|
3700
|
+
|
|
3701
|
+
scene._picking.update();
|
|
3702
|
+
frameState.creditDisplay.update();
|
|
3703
|
+
}
|
|
3704
|
+
|
|
3705
|
+
function postPassesUpdate(scene) {
|
|
3706
|
+
const frameState = scene._frameState;
|
|
3707
|
+
const primitives = scene.primitives;
|
|
3708
|
+
primitives.postPassesUpdate(frameState);
|
|
3709
|
+
|
|
3710
|
+
RequestScheduler.update();
|
|
3711
|
+
}
|
|
3712
|
+
|
|
3713
|
+
const scratchBackgroundColor = new Color();
|
|
3714
|
+
|
|
3715
|
+
function render(scene) {
|
|
3716
|
+
const frameState = scene._frameState;
|
|
3717
|
+
|
|
3718
|
+
const context = scene.context;
|
|
3719
|
+
const us = context.uniformState;
|
|
3720
|
+
|
|
3721
|
+
const view = scene._defaultView;
|
|
3722
|
+
scene._view = view;
|
|
3723
|
+
|
|
3724
|
+
scene.updateFrameState();
|
|
3725
|
+
frameState.passes.render = true;
|
|
3726
|
+
frameState.passes.postProcess = scene.postProcessStages.hasSelected;
|
|
3727
|
+
frameState.tilesetPassState = renderTilesetPassState;
|
|
3728
|
+
|
|
3729
|
+
let backgroundColor = defaultValue(scene.backgroundColor, Color.BLACK);
|
|
3730
|
+
if (scene._hdr) {
|
|
3731
|
+
backgroundColor = Color.clone(backgroundColor, scratchBackgroundColor);
|
|
3732
|
+
backgroundColor.red = Math.pow(backgroundColor.red, scene.gamma);
|
|
3733
|
+
backgroundColor.green = Math.pow(backgroundColor.green, scene.gamma);
|
|
3734
|
+
backgroundColor.blue = Math.pow(backgroundColor.blue, scene.gamma);
|
|
3735
|
+
}
|
|
3736
|
+
frameState.backgroundColor = backgroundColor;
|
|
3737
|
+
|
|
3738
|
+
scene.fog.update(frameState);
|
|
3739
|
+
|
|
3740
|
+
us.update(frameState);
|
|
3741
|
+
|
|
3742
|
+
const shadowMap = scene.shadowMap;
|
|
3743
|
+
if (defined(shadowMap) && shadowMap.enabled) {
|
|
3744
|
+
if (!defined(scene.light) || scene.light instanceof SunLight) {
|
|
3745
|
+
// Negate the sun direction so that it is from the Sun, not to the Sun
|
|
3746
|
+
Cartesian3.negate(us.sunDirectionWC, scene._shadowMapCamera.direction);
|
|
3747
|
+
} else {
|
|
3748
|
+
Cartesian3.clone(scene.light.direction, scene._shadowMapCamera.direction);
|
|
3749
|
+
}
|
|
3750
|
+
frameState.shadowMaps.push(shadowMap);
|
|
3751
|
+
}
|
|
3752
|
+
|
|
3753
|
+
scene._computeCommandList.length = 0;
|
|
3754
|
+
scene._overlayCommandList.length = 0;
|
|
3755
|
+
|
|
3756
|
+
const viewport = view.viewport;
|
|
3757
|
+
viewport.x = 0;
|
|
3758
|
+
viewport.y = 0;
|
|
3759
|
+
viewport.width = context.drawingBufferWidth;
|
|
3760
|
+
viewport.height = context.drawingBufferHeight;
|
|
3761
|
+
|
|
3762
|
+
const passState = view.passState;
|
|
3763
|
+
passState.framebuffer = undefined;
|
|
3764
|
+
passState.blendingEnabled = undefined;
|
|
3765
|
+
passState.scissorTest = undefined;
|
|
3766
|
+
passState.viewport = BoundingRectangle.clone(viewport, passState.viewport);
|
|
3767
|
+
|
|
3768
|
+
if (defined(scene.globe)) {
|
|
3769
|
+
scene.globe.beginFrame(frameState);
|
|
3770
|
+
}
|
|
3771
|
+
|
|
3772
|
+
scene.updateEnvironment();
|
|
3773
|
+
scene.updateAndExecuteCommands(passState, backgroundColor);
|
|
3774
|
+
scene.resolveFramebuffers(passState);
|
|
3775
|
+
|
|
3776
|
+
passState.framebuffer = undefined;
|
|
3777
|
+
executeOverlayCommands(scene, passState);
|
|
3778
|
+
|
|
3779
|
+
if (defined(scene.globe)) {
|
|
3780
|
+
scene.globe.endFrame(frameState);
|
|
3781
|
+
|
|
3782
|
+
if (!scene.globe.tilesLoaded) {
|
|
3783
|
+
scene._renderRequested = true;
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3787
|
+
context.endFrame();
|
|
3788
|
+
}
|
|
3789
|
+
|
|
3790
|
+
function tryAndCatchError(scene, functionToExecute) {
|
|
3791
|
+
try {
|
|
3792
|
+
functionToExecute(scene);
|
|
3793
|
+
} catch (error) {
|
|
3794
|
+
scene._renderError.raiseEvent(scene, error);
|
|
3795
|
+
|
|
3796
|
+
if (scene.rethrowRenderErrors) {
|
|
3797
|
+
throw error;
|
|
3798
|
+
}
|
|
3799
|
+
}
|
|
3800
|
+
}
|
|
3801
|
+
|
|
3802
|
+
function updateMostDetailedRayPicks(scene) {
|
|
3803
|
+
return scene._picking.updateMostDetailedRayPicks(scene);
|
|
3804
|
+
}
|
|
3805
|
+
|
|
3806
|
+
/**
|
|
3807
|
+
* Update and render the scene. It is usually not necessary to call this function
|
|
3808
|
+
* directly because {@link CesiumWidget} will do it automatically.
|
|
3809
|
+
* @param {JulianDate} [time] The simulation time at which to render.
|
|
3810
|
+
*/
|
|
3811
|
+
Scene.prototype.render = function (time) {
|
|
3812
|
+
/**
|
|
3813
|
+
*
|
|
3814
|
+
* Pre passes update. Execute any pass invariant code that should run before the passes here.
|
|
3815
|
+
*
|
|
3816
|
+
*/
|
|
3817
|
+
this._preUpdate.raiseEvent(this, time);
|
|
3818
|
+
|
|
3819
|
+
const frameState = this._frameState;
|
|
3820
|
+
frameState.newFrame = false;
|
|
3821
|
+
|
|
3822
|
+
if (!defined(time)) {
|
|
3823
|
+
time = JulianDate.now();
|
|
3824
|
+
}
|
|
3825
|
+
|
|
3826
|
+
// Determine if shouldRender
|
|
3827
|
+
const cameraChanged = this._view.checkForCameraUpdates(this);
|
|
3828
|
+
let shouldRender =
|
|
3829
|
+
!this.requestRenderMode ||
|
|
3830
|
+
this._renderRequested ||
|
|
3831
|
+
cameraChanged ||
|
|
3832
|
+
this._logDepthBufferDirty ||
|
|
3833
|
+
this._hdrDirty ||
|
|
3834
|
+
this.mode === SceneMode.MORPHING;
|
|
3835
|
+
if (
|
|
3836
|
+
!shouldRender &&
|
|
3837
|
+
defined(this.maximumRenderTimeChange) &&
|
|
3838
|
+
defined(this._lastRenderTime)
|
|
3839
|
+
) {
|
|
3840
|
+
const difference = Math.abs(
|
|
3841
|
+
JulianDate.secondsDifference(this._lastRenderTime, time)
|
|
3842
|
+
);
|
|
3843
|
+
shouldRender = shouldRender || difference > this.maximumRenderTimeChange;
|
|
3844
|
+
}
|
|
3845
|
+
|
|
3846
|
+
if (shouldRender) {
|
|
3847
|
+
this._lastRenderTime = JulianDate.clone(time, this._lastRenderTime);
|
|
3848
|
+
this._renderRequested = false;
|
|
3849
|
+
this._logDepthBufferDirty = false;
|
|
3850
|
+
this._hdrDirty = false;
|
|
3851
|
+
|
|
3852
|
+
const frameNumber = CesiumMath.incrementWrap(
|
|
3853
|
+
frameState.frameNumber,
|
|
3854
|
+
15000000.0,
|
|
3855
|
+
1.0
|
|
3856
|
+
);
|
|
3857
|
+
updateFrameNumber(this, frameNumber, time);
|
|
3858
|
+
frameState.newFrame = true;
|
|
3859
|
+
}
|
|
3860
|
+
|
|
3861
|
+
tryAndCatchError(this, prePassesUpdate);
|
|
3862
|
+
|
|
3863
|
+
/**
|
|
3864
|
+
*
|
|
3865
|
+
* Passes update. Add any passes here
|
|
3866
|
+
*
|
|
3867
|
+
*/
|
|
3868
|
+
if (this.primitives.show) {
|
|
3869
|
+
tryAndCatchError(this, updateMostDetailedRayPicks);
|
|
3870
|
+
tryAndCatchError(this, updatePreloadPass);
|
|
3871
|
+
tryAndCatchError(this, updatePreloadFlightPass);
|
|
3872
|
+
if (!shouldRender) {
|
|
3873
|
+
tryAndCatchError(this, updateRequestRenderModeDeferCheckPass);
|
|
3874
|
+
}
|
|
3875
|
+
}
|
|
3876
|
+
|
|
3877
|
+
this._postUpdate.raiseEvent(this, time);
|
|
3878
|
+
|
|
3879
|
+
if (shouldRender) {
|
|
3880
|
+
this._preRender.raiseEvent(this, time);
|
|
3881
|
+
frameState.creditDisplay.beginFrame();
|
|
3882
|
+
tryAndCatchError(this, render);
|
|
3883
|
+
}
|
|
3884
|
+
|
|
3885
|
+
/**
|
|
3886
|
+
*
|
|
3887
|
+
* Post passes update. Execute any pass invariant code that should run after the passes here.
|
|
3888
|
+
*
|
|
3889
|
+
*/
|
|
3890
|
+
updateDebugShowFramesPerSecond(this, shouldRender);
|
|
3891
|
+
tryAndCatchError(this, postPassesUpdate);
|
|
3892
|
+
|
|
3893
|
+
// Often used to trigger events (so don't want in trycatch) that the user might be subscribed to. Things like the tile load events, ready promises, etc.
|
|
3894
|
+
// We don't want those events to resolve during the render loop because the events might add new primitives
|
|
3895
|
+
callAfterRenderFunctions(this);
|
|
3896
|
+
|
|
3897
|
+
if (shouldRender) {
|
|
3898
|
+
this._postRender.raiseEvent(this, time);
|
|
3899
|
+
frameState.creditDisplay.endFrame();
|
|
3900
|
+
}
|
|
3901
|
+
};
|
|
3902
|
+
|
|
3903
|
+
/**
|
|
3904
|
+
* Update and render the scene. Always forces a new render frame regardless of whether a render was
|
|
3905
|
+
* previously requested.
|
|
3906
|
+
* @param {JulianDate} [time] The simulation time at which to render.
|
|
3907
|
+
*
|
|
3908
|
+
* @private
|
|
3909
|
+
*/
|
|
3910
|
+
Scene.prototype.forceRender = function (time) {
|
|
3911
|
+
this._renderRequested = true;
|
|
3912
|
+
this.render(time);
|
|
3913
|
+
};
|
|
3914
|
+
|
|
3915
|
+
/**
|
|
3916
|
+
* Requests a new rendered frame when {@link Scene#requestRenderMode} is set to <code>true</code>.
|
|
3917
|
+
* The render rate will not exceed the {@link CesiumWidget#targetFrameRate}.
|
|
3918
|
+
*
|
|
3919
|
+
* @see Scene#requestRenderMode
|
|
3920
|
+
*/
|
|
3921
|
+
Scene.prototype.requestRender = function () {
|
|
3922
|
+
this._renderRequested = true;
|
|
3923
|
+
};
|
|
3924
|
+
|
|
3925
|
+
/**
|
|
3926
|
+
* @private
|
|
3927
|
+
*/
|
|
3928
|
+
Scene.prototype.clampLineWidth = function (width) {
|
|
3929
|
+
return Math.max(
|
|
3930
|
+
ContextLimits.minimumAliasedLineWidth,
|
|
3931
|
+
Math.min(width, ContextLimits.maximumAliasedLineWidth)
|
|
3932
|
+
);
|
|
3933
|
+
};
|
|
3934
|
+
|
|
3935
|
+
/**
|
|
3936
|
+
* Returns an object with a `primitive` property that contains the first (top) primitive in the scene
|
|
3937
|
+
* at a particular window coordinate or undefined if nothing is at the location. Other properties may
|
|
3938
|
+
* potentially be set depending on the type of primitive and may be used to further identify the picked object.
|
|
3939
|
+
* <p>
|
|
3940
|
+
* When a feature of a 3D Tiles tileset is picked, <code>pick</code> returns a {@link Cesium3DTileFeature} object.
|
|
3941
|
+
* </p>
|
|
3942
|
+
*
|
|
3943
|
+
* @example
|
|
3944
|
+
* // On mouse over, color the feature yellow.
|
|
3945
|
+
* handler.setInputAction(function(movement) {
|
|
3946
|
+
* const feature = scene.pick(movement.endPosition);
|
|
3947
|
+
* if (feature instanceof Cesium.Cesium3DTileFeature) {
|
|
3948
|
+
* feature.color = Cesium.Color.YELLOW;
|
|
3949
|
+
* }
|
|
3950
|
+
* }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
3951
|
+
*
|
|
3952
|
+
* @param {Cartesian2} windowPosition Window coordinates to perform picking on.
|
|
3953
|
+
* @param {Number} [width=3] Width of the pick rectangle.
|
|
3954
|
+
* @param {Number} [height=3] Height of the pick rectangle.
|
|
3955
|
+
* @returns {Object} Object containing the picked primitive.
|
|
3956
|
+
*/
|
|
3957
|
+
Scene.prototype.pick = function (windowPosition, width, height) {
|
|
3958
|
+
return this._picking.pick(this, windowPosition, width, height);
|
|
3959
|
+
};
|
|
3960
|
+
|
|
3961
|
+
/**
|
|
3962
|
+
* Returns the cartesian position reconstructed from the depth buffer and window position.
|
|
3963
|
+
* The returned position is in world coordinates. Used internally by camera functions to
|
|
3964
|
+
* prevent conversion to projected 2D coordinates and then back.
|
|
3965
|
+
* <p>
|
|
3966
|
+
* Set {@link Scene#pickTranslucentDepth} to <code>true</code> to include the depth of
|
|
3967
|
+
* translucent primitives; otherwise, this essentially picks through translucent primitives.
|
|
3968
|
+
* </p>
|
|
3969
|
+
*
|
|
3970
|
+
* @private
|
|
3971
|
+
*
|
|
3972
|
+
* @param {Cartesian2} windowPosition Window coordinates to perform picking on.
|
|
3973
|
+
* @param {Cartesian3} [result] The object on which to restore the result.
|
|
3974
|
+
* @returns {Cartesian3} The cartesian position in world coordinates.
|
|
3975
|
+
*
|
|
3976
|
+
* @exception {DeveloperError} Picking from the depth buffer is not supported. Check pickPositionSupported.
|
|
3977
|
+
*/
|
|
3978
|
+
Scene.prototype.pickPositionWorldCoordinates = function (
|
|
3979
|
+
windowPosition,
|
|
3980
|
+
result
|
|
3981
|
+
) {
|
|
3982
|
+
return this._picking.pickPositionWorldCoordinates(
|
|
3983
|
+
this,
|
|
3984
|
+
windowPosition,
|
|
3985
|
+
result
|
|
3986
|
+
);
|
|
3987
|
+
};
|
|
3988
|
+
|
|
3989
|
+
/**
|
|
3990
|
+
* Returns the cartesian position reconstructed from the depth buffer and window position.
|
|
3991
|
+
* <p>
|
|
3992
|
+
* The position reconstructed from the depth buffer in 2D may be slightly different from those
|
|
3993
|
+
* reconstructed in 3D and Columbus view. This is caused by the difference in the distribution
|
|
3994
|
+
* of depth values of perspective and orthographic projection.
|
|
3995
|
+
* </p>
|
|
3996
|
+
* <p>
|
|
3997
|
+
* Set {@link Scene#pickTranslucentDepth} to <code>true</code> to include the depth of
|
|
3998
|
+
* translucent primitives; otherwise, this essentially picks through translucent primitives.
|
|
3999
|
+
* </p>
|
|
4000
|
+
*
|
|
4001
|
+
* @param {Cartesian2} windowPosition Window coordinates to perform picking on.
|
|
4002
|
+
* @param {Cartesian3} [result] The object on which to restore the result.
|
|
4003
|
+
* @returns {Cartesian3} The cartesian position.
|
|
4004
|
+
*
|
|
4005
|
+
* @exception {DeveloperError} Picking from the depth buffer is not supported. Check pickPositionSupported.
|
|
4006
|
+
*/
|
|
4007
|
+
Scene.prototype.pickPosition = function (windowPosition, result) {
|
|
4008
|
+
return this._picking.pickPosition(this, windowPosition, result);
|
|
4009
|
+
};
|
|
4010
|
+
|
|
4011
|
+
/**
|
|
4012
|
+
* Returns a list of objects, each containing a `primitive` property, for all primitives at
|
|
4013
|
+
* a particular window coordinate position. Other properties may also be set depending on the
|
|
4014
|
+
* type of primitive and may be used to further identify the picked object. The primitives in
|
|
4015
|
+
* the list are ordered by their visual order in the scene (front to back).
|
|
4016
|
+
*
|
|
4017
|
+
* @param {Cartesian2} windowPosition Window coordinates to perform picking on.
|
|
4018
|
+
* @param {Number} [limit] If supplied, stop drilling after collecting this many picks.
|
|
4019
|
+
* @param {Number} [width=3] Width of the pick rectangle.
|
|
4020
|
+
* @param {Number} [height=3] Height of the pick rectangle.
|
|
4021
|
+
* @returns {Array.<*>} Array of objects, each containing 1 picked primitives.
|
|
4022
|
+
*
|
|
4023
|
+
* @exception {DeveloperError} windowPosition is undefined.
|
|
4024
|
+
*
|
|
4025
|
+
* @example
|
|
4026
|
+
* const pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0));
|
|
4027
|
+
*
|
|
4028
|
+
* @see Scene#pick
|
|
4029
|
+
*/
|
|
4030
|
+
Scene.prototype.drillPick = function (windowPosition, limit, width, height) {
|
|
4031
|
+
return this._picking.drillPick(this, windowPosition, limit, width, height);
|
|
4032
|
+
};
|
|
4033
|
+
|
|
4034
|
+
function updatePreloadPass(scene) {
|
|
4035
|
+
const frameState = scene._frameState;
|
|
4036
|
+
preloadTilesetPassState.camera = frameState.camera;
|
|
4037
|
+
preloadTilesetPassState.cullingVolume = frameState.cullingVolume;
|
|
4038
|
+
|
|
4039
|
+
const primitives = scene.primitives;
|
|
4040
|
+
primitives.updateForPass(frameState, preloadTilesetPassState);
|
|
4041
|
+
}
|
|
4042
|
+
|
|
4043
|
+
function updatePreloadFlightPass(scene) {
|
|
4044
|
+
const frameState = scene._frameState;
|
|
4045
|
+
const camera = frameState.camera;
|
|
4046
|
+
if (!camera.canPreloadFlight()) {
|
|
4047
|
+
return;
|
|
4048
|
+
}
|
|
4049
|
+
|
|
4050
|
+
preloadFlightTilesetPassState.camera = scene.preloadFlightCamera;
|
|
4051
|
+
preloadFlightTilesetPassState.cullingVolume =
|
|
4052
|
+
scene.preloadFlightCullingVolume;
|
|
4053
|
+
|
|
4054
|
+
const primitives = scene.primitives;
|
|
4055
|
+
primitives.updateForPass(frameState, preloadFlightTilesetPassState);
|
|
4056
|
+
}
|
|
4057
|
+
|
|
4058
|
+
function updateRequestRenderModeDeferCheckPass(scene) {
|
|
4059
|
+
// Check if any ignored requests are ready to go (to wake rendering up again)
|
|
4060
|
+
scene.primitives.updateForPass(
|
|
4061
|
+
scene._frameState,
|
|
4062
|
+
requestRenderModeDeferCheckPassState
|
|
4063
|
+
);
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
/**
|
|
4067
|
+
* Returns an object containing the first object intersected by the ray and the position of intersection,
|
|
4068
|
+
* or <code>undefined</code> if there were no intersections. The intersected object has a <code>primitive</code>
|
|
4069
|
+
* property that contains the intersected primitive. Other properties may be set depending on the type of primitive
|
|
4070
|
+
* and may be used to further identify the picked object. The ray must be given in world coordinates.
|
|
4071
|
+
* <p>
|
|
4072
|
+
* This function only picks globe tiles and 3D Tiles that are rendered in the current view. Picks all other
|
|
4073
|
+
* primitives regardless of their visibility.
|
|
4074
|
+
* </p>
|
|
4075
|
+
*
|
|
4076
|
+
* @private
|
|
4077
|
+
*
|
|
4078
|
+
* @param {Ray} ray The ray.
|
|
4079
|
+
* @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.
|
|
4080
|
+
* @param {Number} [width=0.1] Width of the intersection volume in meters.
|
|
4081
|
+
* @returns {Object} An object containing the object and position of the first intersection.
|
|
4082
|
+
*
|
|
4083
|
+
* @exception {DeveloperError} Ray intersections are only supported in 3D mode.
|
|
4084
|
+
*/
|
|
4085
|
+
Scene.prototype.pickFromRay = function (ray, objectsToExclude, width) {
|
|
4086
|
+
return this._picking.pickFromRay(this, ray, objectsToExclude, width);
|
|
4087
|
+
};
|
|
4088
|
+
|
|
4089
|
+
/**
|
|
4090
|
+
* Returns a list of objects, each containing the object intersected by the ray and the position of intersection.
|
|
4091
|
+
* The intersected object has a <code>primitive</code> property that contains the intersected primitive. Other
|
|
4092
|
+
* properties may also be set depending on the type of primitive and may be used to further identify the picked object.
|
|
4093
|
+
* The primitives in the list are ordered by first intersection to last intersection. The ray must be given in
|
|
4094
|
+
* world coordinates.
|
|
4095
|
+
* <p>
|
|
4096
|
+
* This function only picks globe tiles and 3D Tiles that are rendered in the current view. Picks all other
|
|
4097
|
+
* primitives regardless of their visibility.
|
|
4098
|
+
* </p>
|
|
4099
|
+
*
|
|
4100
|
+
* @private
|
|
4101
|
+
*
|
|
4102
|
+
* @param {Ray} ray The ray.
|
|
4103
|
+
* @param {Number} [limit=Number.MAX_VALUE] If supplied, stop finding intersections after this many intersections.
|
|
4104
|
+
* @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.
|
|
4105
|
+
* @param {Number} [width=0.1] Width of the intersection volume in meters.
|
|
4106
|
+
* @returns {Object[]} List of objects containing the object and position of each intersection.
|
|
4107
|
+
*
|
|
4108
|
+
* @exception {DeveloperError} Ray intersections are only supported in 3D mode.
|
|
4109
|
+
*/
|
|
4110
|
+
Scene.prototype.drillPickFromRay = function (
|
|
4111
|
+
ray,
|
|
4112
|
+
limit,
|
|
4113
|
+
objectsToExclude,
|
|
4114
|
+
width
|
|
4115
|
+
) {
|
|
4116
|
+
return this._picking.drillPickFromRay(
|
|
4117
|
+
this,
|
|
4118
|
+
ray,
|
|
4119
|
+
limit,
|
|
4120
|
+
objectsToExclude,
|
|
4121
|
+
width
|
|
4122
|
+
);
|
|
4123
|
+
};
|
|
4124
|
+
|
|
4125
|
+
/**
|
|
4126
|
+
* Initiates an asynchronous {@link Scene#pickFromRay} request using the maximum level of detail for 3D Tilesets
|
|
4127
|
+
* regardless of visibility.
|
|
4128
|
+
*
|
|
4129
|
+
* @private
|
|
4130
|
+
*
|
|
4131
|
+
* @param {Ray} ray The ray.
|
|
4132
|
+
* @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.
|
|
4133
|
+
* @param {Number} [width=0.1] Width of the intersection volume in meters.
|
|
4134
|
+
* @returns {Promise.<Object>} A promise that resolves to an object containing the object and position of the first intersection.
|
|
4135
|
+
*
|
|
4136
|
+
* @exception {DeveloperError} Ray intersections are only supported in 3D mode.
|
|
4137
|
+
*/
|
|
4138
|
+
Scene.prototype.pickFromRayMostDetailed = function (
|
|
4139
|
+
ray,
|
|
4140
|
+
objectsToExclude,
|
|
4141
|
+
width
|
|
4142
|
+
) {
|
|
4143
|
+
return this._picking.pickFromRayMostDetailed(
|
|
4144
|
+
this,
|
|
4145
|
+
ray,
|
|
4146
|
+
objectsToExclude,
|
|
4147
|
+
width
|
|
4148
|
+
);
|
|
4149
|
+
};
|
|
4150
|
+
|
|
4151
|
+
/**
|
|
4152
|
+
* Initiates an asynchronous {@link Scene#drillPickFromRay} request using the maximum level of detail for 3D Tilesets
|
|
4153
|
+
* regardless of visibility.
|
|
4154
|
+
*
|
|
4155
|
+
* @private
|
|
4156
|
+
*
|
|
4157
|
+
* @param {Ray} ray The ray.
|
|
4158
|
+
* @param {Number} [limit=Number.MAX_VALUE] If supplied, stop finding intersections after this many intersections.
|
|
4159
|
+
* @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.
|
|
4160
|
+
* @param {Number} [width=0.1] Width of the intersection volume in meters.
|
|
4161
|
+
* @returns {Promise.<Object[]>} A promise that resolves to a list of objects containing the object and position of each intersection.
|
|
4162
|
+
*
|
|
4163
|
+
* @exception {DeveloperError} Ray intersections are only supported in 3D mode.
|
|
4164
|
+
*/
|
|
4165
|
+
Scene.prototype.drillPickFromRayMostDetailed = function (
|
|
4166
|
+
ray,
|
|
4167
|
+
limit,
|
|
4168
|
+
objectsToExclude,
|
|
4169
|
+
width
|
|
4170
|
+
) {
|
|
4171
|
+
return this._picking.drillPickFromRayMostDetailed(
|
|
4172
|
+
this,
|
|
4173
|
+
ray,
|
|
4174
|
+
limit,
|
|
4175
|
+
objectsToExclude,
|
|
4176
|
+
width
|
|
4177
|
+
);
|
|
4178
|
+
};
|
|
4179
|
+
|
|
4180
|
+
/**
|
|
4181
|
+
* Returns the height of scene geometry at the given cartographic position or <code>undefined</code> if there was no
|
|
4182
|
+
* scene geometry to sample height from. The height of the input position is ignored. May be used to clamp objects to
|
|
4183
|
+
* the globe, 3D Tiles, or primitives in the scene.
|
|
4184
|
+
* <p>
|
|
4185
|
+
* This function only samples height from globe tiles and 3D Tiles that are rendered in the current view. Samples height
|
|
4186
|
+
* from all other primitives regardless of their visibility.
|
|
4187
|
+
* </p>
|
|
4188
|
+
*
|
|
4189
|
+
* @param {Cartographic} position The cartographic position to sample height from.
|
|
4190
|
+
* @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not sample height from.
|
|
4191
|
+
* @param {Number} [width=0.1] Width of the intersection volume in meters.
|
|
4192
|
+
* @returns {Number} The height. This may be <code>undefined</code> if there was no scene geometry to sample height from.
|
|
4193
|
+
*
|
|
4194
|
+
* @example
|
|
4195
|
+
* const position = new Cesium.Cartographic(-1.31968, 0.698874);
|
|
4196
|
+
* const height = viewer.scene.sampleHeight(position);
|
|
4197
|
+
* console.log(height);
|
|
4198
|
+
*
|
|
4199
|
+
* @see Scene#clampToHeight
|
|
4200
|
+
* @see Scene#clampToHeightMostDetailed
|
|
4201
|
+
* @see Scene#sampleHeightMostDetailed
|
|
4202
|
+
*
|
|
4203
|
+
* @exception {DeveloperError} sampleHeight is only supported in 3D mode.
|
|
4204
|
+
* @exception {DeveloperError} sampleHeight requires depth texture support. Check sampleHeightSupported.
|
|
4205
|
+
*/
|
|
4206
|
+
Scene.prototype.sampleHeight = function (position, objectsToExclude, width) {
|
|
4207
|
+
return this._picking.sampleHeight(this, position, objectsToExclude, width);
|
|
4208
|
+
};
|
|
4209
|
+
|
|
4210
|
+
/**
|
|
4211
|
+
* Clamps the given cartesian position to the scene geometry along the geodetic surface normal. Returns the
|
|
4212
|
+
* clamped position or <code>undefined</code> if there was no scene geometry to clamp to. May be used to clamp
|
|
4213
|
+
* objects to the globe, 3D Tiles, or primitives in the scene.
|
|
4214
|
+
* <p>
|
|
4215
|
+
* This function only clamps to globe tiles and 3D Tiles that are rendered in the current view. Clamps to
|
|
4216
|
+
* all other primitives regardless of their visibility.
|
|
4217
|
+
* </p>
|
|
4218
|
+
*
|
|
4219
|
+
* @param {Cartesian3} cartesian The cartesian position.
|
|
4220
|
+
* @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not clamp to.
|
|
4221
|
+
* @param {Number} [width=0.1] Width of the intersection volume in meters.
|
|
4222
|
+
* @param {Cartesian3} [result] An optional object to return the clamped position.
|
|
4223
|
+
* @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. This may be <code>undefined</code> if there was no scene geometry to clamp to.
|
|
4224
|
+
*
|
|
4225
|
+
* @example
|
|
4226
|
+
* // Clamp an entity to the underlying scene geometry
|
|
4227
|
+
* const position = entity.position.getValue(Cesium.JulianDate.now());
|
|
4228
|
+
* entity.position = viewer.scene.clampToHeight(position);
|
|
4229
|
+
*
|
|
4230
|
+
* @see Scene#sampleHeight
|
|
4231
|
+
* @see Scene#sampleHeightMostDetailed
|
|
4232
|
+
* @see Scene#clampToHeightMostDetailed
|
|
4233
|
+
*
|
|
4234
|
+
* @exception {DeveloperError} clampToHeight is only supported in 3D mode.
|
|
4235
|
+
* @exception {DeveloperError} clampToHeight requires depth texture support. Check clampToHeightSupported.
|
|
4236
|
+
*/
|
|
4237
|
+
Scene.prototype.clampToHeight = function (
|
|
4238
|
+
cartesian,
|
|
4239
|
+
objectsToExclude,
|
|
4240
|
+
width,
|
|
4241
|
+
result
|
|
4242
|
+
) {
|
|
4243
|
+
return this._picking.clampToHeight(
|
|
4244
|
+
this,
|
|
4245
|
+
cartesian,
|
|
4246
|
+
objectsToExclude,
|
|
4247
|
+
width,
|
|
4248
|
+
result
|
|
4249
|
+
);
|
|
4250
|
+
};
|
|
4251
|
+
|
|
4252
|
+
/**
|
|
4253
|
+
* Initiates an asynchronous {@link Scene#sampleHeight} query for an array of {@link Cartographic} positions
|
|
4254
|
+
* using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored.
|
|
4255
|
+
* Returns a promise that is resolved when the query completes. Each point height is modified in place.
|
|
4256
|
+
* If a height cannot be determined because no geometry can be sampled at that location, or another error occurs,
|
|
4257
|
+
* the height is set to undefined.
|
|
4258
|
+
*
|
|
4259
|
+
* @param {Cartographic[]} positions The cartographic positions to update with sampled heights.
|
|
4260
|
+
* @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not sample height from.
|
|
4261
|
+
* @param {Number} [width=0.1] Width of the intersection volume in meters.
|
|
4262
|
+
* @returns {Promise.<Cartographic[]>} A promise that resolves to the provided list of positions when the query has completed.
|
|
4263
|
+
*
|
|
4264
|
+
* @example
|
|
4265
|
+
* const positions = [
|
|
4266
|
+
* new Cesium.Cartographic(-1.31968, 0.69887),
|
|
4267
|
+
* new Cesium.Cartographic(-1.10489, 0.83923)
|
|
4268
|
+
* ];
|
|
4269
|
+
* const promise = viewer.scene.sampleHeightMostDetailed(positions);
|
|
4270
|
+
* promise.then(function(updatedPosition) {
|
|
4271
|
+
* // positions[0].height and positions[1].height have been updated.
|
|
4272
|
+
* // updatedPositions is just a reference to positions.
|
|
4273
|
+
* }
|
|
4274
|
+
*
|
|
4275
|
+
* @see Scene#sampleHeight
|
|
4276
|
+
*
|
|
4277
|
+
* @exception {DeveloperError} sampleHeightMostDetailed is only supported in 3D mode.
|
|
4278
|
+
* @exception {DeveloperError} sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.
|
|
4279
|
+
*/
|
|
4280
|
+
Scene.prototype.sampleHeightMostDetailed = function (
|
|
4281
|
+
positions,
|
|
4282
|
+
objectsToExclude,
|
|
4283
|
+
width
|
|
4284
|
+
) {
|
|
4285
|
+
return this._picking.sampleHeightMostDetailed(
|
|
4286
|
+
this,
|
|
4287
|
+
positions,
|
|
4288
|
+
objectsToExclude,
|
|
4289
|
+
width
|
|
4290
|
+
);
|
|
4291
|
+
};
|
|
4292
|
+
|
|
4293
|
+
/**
|
|
4294
|
+
* Initiates an asynchronous {@link Scene#clampToHeight} query for an array of {@link Cartesian3} positions
|
|
4295
|
+
* using the maximum level of detail for 3D Tilesets in the scene. Returns a promise that is resolved when
|
|
4296
|
+
* the query completes. Each position is modified in place. If a position cannot be clamped because no geometry
|
|
4297
|
+
* can be sampled at that location, or another error occurs, the element in the array is set to undefined.
|
|
4298
|
+
*
|
|
4299
|
+
* @param {Cartesian3[]} cartesians The cartesian positions to update with clamped positions.
|
|
4300
|
+
* @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not clamp to.
|
|
4301
|
+
* @param {Number} [width=0.1] Width of the intersection volume in meters.
|
|
4302
|
+
* @returns {Promise.<Cartesian3[]>} A promise that resolves to the provided list of positions when the query has completed.
|
|
4303
|
+
*
|
|
4304
|
+
* @example
|
|
4305
|
+
* const cartesians = [
|
|
4306
|
+
* entities[0].position.getValue(Cesium.JulianDate.now()),
|
|
4307
|
+
* entities[1].position.getValue(Cesium.JulianDate.now())
|
|
4308
|
+
* ];
|
|
4309
|
+
* const promise = viewer.scene.clampToHeightMostDetailed(cartesians);
|
|
4310
|
+
* promise.then(function(updatedCartesians) {
|
|
4311
|
+
* entities[0].position = updatedCartesians[0];
|
|
4312
|
+
* entities[1].position = updatedCartesians[1];
|
|
4313
|
+
* }
|
|
4314
|
+
*
|
|
4315
|
+
* @see Scene#clampToHeight
|
|
4316
|
+
*
|
|
4317
|
+
* @exception {DeveloperError} clampToHeightMostDetailed is only supported in 3D mode.
|
|
4318
|
+
* @exception {DeveloperError} clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.
|
|
4319
|
+
*/
|
|
4320
|
+
Scene.prototype.clampToHeightMostDetailed = function (
|
|
4321
|
+
cartesians,
|
|
4322
|
+
objectsToExclude,
|
|
4323
|
+
width
|
|
4324
|
+
) {
|
|
4325
|
+
return this._picking.clampToHeightMostDetailed(
|
|
4326
|
+
this,
|
|
4327
|
+
cartesians,
|
|
4328
|
+
objectsToExclude,
|
|
4329
|
+
width
|
|
4330
|
+
);
|
|
4331
|
+
};
|
|
4332
|
+
|
|
4333
|
+
/**
|
|
4334
|
+
* Transforms a position in cartesian coordinates to canvas coordinates. This is commonly used to place an
|
|
4335
|
+
* HTML element at the same screen position as an object in the scene.
|
|
4336
|
+
*
|
|
4337
|
+
* @param {Cartesian3} position The position in cartesian coordinates.
|
|
4338
|
+
* @param {Cartesian2} [result] An optional object to return the input position transformed to canvas coordinates.
|
|
4339
|
+
* @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. This may be <code>undefined</code> if the input position is near the center of the ellipsoid.
|
|
4340
|
+
*
|
|
4341
|
+
* @example
|
|
4342
|
+
* // Output the canvas position of longitude/latitude (0, 0) every time the mouse moves.
|
|
4343
|
+
* const scene = widget.scene;
|
|
4344
|
+
* const ellipsoid = scene.globe.ellipsoid;
|
|
4345
|
+
* const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
|
|
4346
|
+
* const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
|
|
4347
|
+
* handler.setInputAction(function(movement) {
|
|
4348
|
+
* console.log(scene.cartesianToCanvasCoordinates(position));
|
|
4349
|
+
* }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
4350
|
+
*/
|
|
4351
|
+
Scene.prototype.cartesianToCanvasCoordinates = function (position, result) {
|
|
4352
|
+
return SceneTransforms.wgs84ToWindowCoordinates(this, position, result);
|
|
4353
|
+
};
|
|
4354
|
+
|
|
4355
|
+
/**
|
|
4356
|
+
* Instantly completes an active transition.
|
|
4357
|
+
*/
|
|
4358
|
+
Scene.prototype.completeMorph = function () {
|
|
4359
|
+
this._transitioner.completeMorph();
|
|
4360
|
+
};
|
|
4361
|
+
|
|
4362
|
+
/**
|
|
4363
|
+
* Asynchronously transitions the scene to 2D.
|
|
4364
|
+
* @param {Number} [duration=2.0] The amount of time, in seconds, for transition animations to complete.
|
|
4365
|
+
*/
|
|
4366
|
+
Scene.prototype.morphTo2D = function (duration) {
|
|
4367
|
+
let ellipsoid;
|
|
4368
|
+
const globe = this.globe;
|
|
4369
|
+
if (defined(globe)) {
|
|
4370
|
+
ellipsoid = globe.ellipsoid;
|
|
4371
|
+
} else {
|
|
4372
|
+
ellipsoid = this.mapProjection.ellipsoid;
|
|
4373
|
+
}
|
|
4374
|
+
duration = defaultValue(duration, 2.0);
|
|
4375
|
+
this._transitioner.morphTo2D(duration, ellipsoid);
|
|
4376
|
+
};
|
|
4377
|
+
|
|
4378
|
+
/**
|
|
4379
|
+
* Asynchronously transitions the scene to Columbus View.
|
|
4380
|
+
* @param {Number} [duration=2.0] The amount of time, in seconds, for transition animations to complete.
|
|
4381
|
+
*/
|
|
4382
|
+
Scene.prototype.morphToColumbusView = function (duration) {
|
|
4383
|
+
let ellipsoid;
|
|
4384
|
+
const globe = this.globe;
|
|
4385
|
+
if (defined(globe)) {
|
|
4386
|
+
ellipsoid = globe.ellipsoid;
|
|
4387
|
+
} else {
|
|
4388
|
+
ellipsoid = this.mapProjection.ellipsoid;
|
|
4389
|
+
}
|
|
4390
|
+
duration = defaultValue(duration, 2.0);
|
|
4391
|
+
this._transitioner.morphToColumbusView(duration, ellipsoid);
|
|
4392
|
+
};
|
|
4393
|
+
|
|
4394
|
+
/**
|
|
4395
|
+
* Asynchronously transitions the scene to 3D.
|
|
4396
|
+
* @param {Number} [duration=2.0] The amount of time, in seconds, for transition animations to complete.
|
|
4397
|
+
*/
|
|
4398
|
+
Scene.prototype.morphTo3D = function (duration) {
|
|
4399
|
+
let ellipsoid;
|
|
4400
|
+
const globe = this.globe;
|
|
4401
|
+
if (defined(globe)) {
|
|
4402
|
+
ellipsoid = globe.ellipsoid;
|
|
4403
|
+
} else {
|
|
4404
|
+
ellipsoid = this.mapProjection.ellipsoid;
|
|
4405
|
+
}
|
|
4406
|
+
duration = defaultValue(duration, 2.0);
|
|
4407
|
+
this._transitioner.morphTo3D(duration, ellipsoid);
|
|
4408
|
+
};
|
|
4409
|
+
|
|
4410
|
+
/**
|
|
4411
|
+
* Returns true if this object was destroyed; otherwise, false.
|
|
4412
|
+
* <br /><br />
|
|
4413
|
+
* If this object was destroyed, it should not be used; calling any function other than
|
|
4414
|
+
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
|
|
4415
|
+
*
|
|
4416
|
+
* @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
|
|
4417
|
+
*
|
|
4418
|
+
* @see Scene#destroy
|
|
4419
|
+
*/
|
|
4420
|
+
Scene.prototype.isDestroyed = function () {
|
|
4421
|
+
return false;
|
|
4422
|
+
};
|
|
4423
|
+
|
|
4424
|
+
/**
|
|
4425
|
+
* Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
|
|
4426
|
+
* release of WebGL resources, instead of relying on the garbage collector to destroy this object.
|
|
4427
|
+
* <br /><br />
|
|
4428
|
+
* Once an object is destroyed, it should not be used; calling any function other than
|
|
4429
|
+
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
|
|
4430
|
+
* assign the return value (<code>undefined</code>) to the object as done in the example.
|
|
4431
|
+
*
|
|
4432
|
+
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
|
|
4433
|
+
*
|
|
4434
|
+
*
|
|
4435
|
+
* @example
|
|
4436
|
+
* scene = scene && scene.destroy();
|
|
4437
|
+
*
|
|
4438
|
+
* @see Scene#isDestroyed
|
|
4439
|
+
*/
|
|
4440
|
+
Scene.prototype.destroy = function () {
|
|
4441
|
+
this._tweens.removeAll();
|
|
4442
|
+
this._computeEngine = this._computeEngine && this._computeEngine.destroy();
|
|
4443
|
+
this._screenSpaceCameraController =
|
|
4444
|
+
this._screenSpaceCameraController &&
|
|
4445
|
+
this._screenSpaceCameraController.destroy();
|
|
4446
|
+
this._deviceOrientationCameraController =
|
|
4447
|
+
this._deviceOrientationCameraController &&
|
|
4448
|
+
!this._deviceOrientationCameraController.isDestroyed() &&
|
|
4449
|
+
this._deviceOrientationCameraController.destroy();
|
|
4450
|
+
this._primitives = this._primitives && this._primitives.destroy();
|
|
4451
|
+
this._groundPrimitives =
|
|
4452
|
+
this._groundPrimitives && this._groundPrimitives.destroy();
|
|
4453
|
+
this._globe = this._globe && this._globe.destroy();
|
|
4454
|
+
this.skyBox = this.skyBox && this.skyBox.destroy();
|
|
4455
|
+
this.skyAtmosphere = this.skyAtmosphere && this.skyAtmosphere.destroy();
|
|
4456
|
+
this._debugSphere = this._debugSphere && this._debugSphere.destroy();
|
|
4457
|
+
this.sun = this.sun && this.sun.destroy();
|
|
4458
|
+
this._sunPostProcess = this._sunPostProcess && this._sunPostProcess.destroy();
|
|
4459
|
+
this._depthPlane = this._depthPlane && this._depthPlane.destroy();
|
|
4460
|
+
this._transitioner = this._transitioner && this._transitioner.destroy();
|
|
4461
|
+
this._debugFrustumPlanes =
|
|
4462
|
+
this._debugFrustumPlanes && this._debugFrustumPlanes.destroy();
|
|
4463
|
+
this._brdfLutGenerator =
|
|
4464
|
+
this._brdfLutGenerator && this._brdfLutGenerator.destroy();
|
|
4465
|
+
this._picking = this._picking && this._picking.destroy();
|
|
4466
|
+
|
|
4467
|
+
this._defaultView = this._defaultView && this._defaultView.destroy();
|
|
4468
|
+
this._view = undefined;
|
|
4469
|
+
|
|
4470
|
+
if (this._removeCreditContainer) {
|
|
4471
|
+
this._canvas.parentNode.removeChild(this._creditContainer);
|
|
4472
|
+
}
|
|
4473
|
+
|
|
4474
|
+
this.postProcessStages =
|
|
4475
|
+
this.postProcessStages && this.postProcessStages.destroy();
|
|
4476
|
+
|
|
4477
|
+
this._context = this._context && this._context.destroy();
|
|
4478
|
+
this._frameState.creditDisplay =
|
|
4479
|
+
this._frameState.creditDisplay && this._frameState.creditDisplay.destroy();
|
|
4480
|
+
|
|
4481
|
+
if (defined(this._performanceDisplay)) {
|
|
4482
|
+
this._performanceDisplay =
|
|
4483
|
+
this._performanceDisplay && this._performanceDisplay.destroy();
|
|
4484
|
+
this._performanceContainer.parentNode.removeChild(
|
|
4485
|
+
this._performanceContainer
|
|
4486
|
+
);
|
|
4487
|
+
}
|
|
4488
|
+
|
|
4489
|
+
this._removeRequestListenerCallback();
|
|
4490
|
+
this._removeTaskProcessorListenerCallback();
|
|
4491
|
+
for (let i = 0; i < this._removeGlobeCallbacks.length; ++i) {
|
|
4492
|
+
this._removeGlobeCallbacks[i]();
|
|
4493
|
+
}
|
|
4494
|
+
this._removeGlobeCallbacks.length = 0;
|
|
4495
|
+
|
|
4496
|
+
return destroyObject(this);
|
|
4497
|
+
};
|
|
4498
|
+
export default Scene;
|