Incompatible updates
- In the next version , That is to say Cesium 1.92, Third party Library
when.jsWill be native Promise API Instead of .Cesium.whenWill be abandoned , And will be removed in the next version . About how to upgrade , Please refer to the personal comments below , I reprinted the official guidance document . - Fixed when Scene When there is no rendering ( for example css Set style to none) Method for obtaining ray of camera object (
camera.getPickRay()) Thrown exception , This function will return undefined 了 .
newly added
- by WebGL 2.0 add to MSAA( Multisampling anti aliasing ) Support . You can create Viewer Time transfer
msaaSamplesOptions , It can also be used.Scene.msaaSamplesAttribute control . - Now? ,glTF By default, the model uses
ModelExperimentalArchitecture processing . - stay
ModelExpertimentalSwitching back clipping is supported in the architecture . - towards Viewer and Scene Class
depthPlaneEllipsoidOffset, To solve the strange rendering problem under the ellipsoid plane - stay
ModelExperimentalThe architecture supportsdebugColorTiles - stay
ModelExperimentalShadow is supported in the architecture - Added... To all matrix classes
packArrayandunpackArrayMethod Add some affine transformation help functions to the matrix class
- Matrix2:
setScale、setUniformScale、setRotation、getRotation、multiplyByUniformScale - Matrix3:
setScale、setUniformScale、setRotation、multiplyByUniformScale - Matrix4:
setUniformScale、setRotation、getRotation、fromRotation
- Matrix2:
- by
AxisAlignedBoundBoxClass addfromCornersMethod - by
BoundingSphereClass addfromTransformationMethod - by
OrientedBoundingBoxClass addfromTransformation、computeCOrners、computeTransformationMethod - by
RectangleClass addsubsectionMethod - glTF The copyright information will be marked in the copyright area
- by 3D Tiles Add an option , It can determine whether the copyright information of the data set is displayed on the screen
- Changed the copyright collation to the frequency of occurrence
Problem fix
- Fixed the use of
ModelExperimentalThe model of the architecture will not update the scope ball when updating its model matrix - Fixed in Safari Browser FeatureID Artifact of texture
- Fixed the use of
ModelExpertimentalThe opaque model of the architecture uses a translucent shader , But the error of not rendering correctly
Personal comments
① MSAA
MSAA Not to mention , It is recommended that all machines with good conditions be operated , coordination FXAA Improve the display effect .
const viewer = new Viewer('cesiumContainer', {
msaaSamples: 4 // 1, 2, 4, 8, Default 1, The higher the effect, the better , The more you eat
})
viewer.postProcessStages.fxaa.enabled = trueWhat's the difference between them ?
- msaa Occurs before the end of the pipeline , To be exact, it is the multi sampling of the elements in the rasterization stage , Output to render buffer , Then draw it on the screen
- fxaa Occurs in the post-treatment stage after the end of the pipeline , The rendered results are processed by image algorithm
MSAA stay WebGL 2.0 Only then ,WebGPU Native supports . at present WebGPU Not yet mature ,WebGL 2.0 A while ago, it has just fully adapted to all mainstream browsers , therefore Cesium Anti aliasing effect MSAA Function support is relatively slow .
② The camera takes rays
The return value type of the function that gets the ray has now changed
const ray = viewer.camera.getPickRay() // Ray or undefined③ ModelExperimental
In the experiment Model, It's about the original Model Class schema upgrade , This is to adapt to a more powerful glTF, And for the next generation 3D Tiles To prepare the .
expect 2022 This new structure will be regularized in .
④ gradually ES6
Careful friends may have observed , The source code has put var Switch to let/const Declare variables . In the next version (1.92),CesiumJS Plan to integrate third-party asynchronous libraries when.js Replace with ES6 Native Promise Realization . however , Distance source code is completely used async/await It is estimated that there is still a way to go .
About migration Cesium.when, That's what officials say :
- Remove all used
Cesium.whenCode for Cesium.deferInstead ofwhen.deferPromise.allInstead ofwhen.join- stay Promise Chain call ,
catchInstead ofotherwise,finallyInstead ofalways; If you useasync/awaitinstead of Promise chain , Then there's no need to change
besides , We also hope that the official team will complete ES6 Of class、 Conversion of template string .









