Skip to content

Commit

Permalink
Merge branch 'master' into highp-batch-tables-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
likangning93 committed Apr 29, 2020
2 parents 0eafb46 + ecdea14 commit 586a6ef
Show file tree
Hide file tree
Showing 41 changed files with 2,454 additions and 91 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.glsl]
indent_size = 4
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"slevesque.shader",
"cesium.gltf-vscode"
]
Expand Down
8 changes: 2 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
"files.associations": {
"*.czml": "json"
},
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.detectIndentation": false,
"eslint.enable": true,
"javascript.format.insertSpaceAfterCommaDelimiter": true,
"javascript.format.insertSpaceAfterSemicolonInForStatements": true,
Expand All @@ -33,5 +28,6 @@
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"javascript.format.placeOpenBraceOnNewLineForFunctions": false,
"javascript.format.placeOpenBraceOnNewLineForControlBlocks": false
"javascript.format.placeOpenBraceOnNewLineForControlBlocks": false,
"glTF.defaultV2Engine": "Cesium"
}
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@

- Added `Scene.cameraUnderground` for checking whether the camera is underneath the globe. [#8765](https://github.com/CesiumGS/cesium/pull/8765)
- Added `RequestScheduler` to the public API; this allows users to have more control over the requests made by CesiumJS. [#8384](https://github.com/CesiumGS/cesium/issues/8384)
- Added support for high-quality edges on solid geometry in glTF models. [#8776](https://github.com/CesiumGS/cesium/pull/8776)

##### Fixes :wrench:

- Fixed several problems with polylines when the logarithmic depth buffer is enabled, which is the default on most systems. [#8706](https://github.com/CesiumGS/cesium/pull/8706)
- Fixed an issue with glTF skinning support where an optional property `skeleton` was considered required by Cesium. [#8175](https://github.com/CesiumGS/cesium/issues/8175)
- Fixed an issue with clamping of non-looped glTF animations. Subscribers to animation `update` events should expect one additional event firing as an animation stops. [#7387](https://github.com/CesiumGS/cesium/issues/7387)
- Fixed a bug with very long view ranges requiring multiple frustums even with the logarithmic depth buffer enabled. Previously, such scenes could resolve depth incorrectly. [#8727](https://github.com/CesiumGS/cesium/pull/8727)
- Fixed a bug where the elevation contour material's alpha was not being applied. [#8749](https://github.com/CesiumGS/cesium/pull/8749)
- Fix potential memory leak when destroying `CesiumWidget` instances.
- Geometry instance floats now work for high precision floats on newer iOS devices. [#8805](https://github.com/CesiumGS/cesium/pull/8805)

### 1.68.0 - 2020-04-01
Expand All @@ -26,6 +29,7 @@

- Added basic underground rendering support. When the camera is underground the globe will be rendered as a solid surface and underground entities will not be culled. [#8572](https://github.com/AnalyticalGraphicsInc/cesium/pull/8572)
- The `CesiumUnminified` build now includes sourcemaps. [#8572](https://github.com/CesiumGS/cesium/pull/8659)
- Added glTF `STEP` animation interpolation. [#8786](https://github.com/CesiumGS/cesium/pull/8786)
- Added the ability to edit CesiumJS shaders on-the-fly using the [SpectorJS](https://spector.babylonjs.com/) Shader Editor. [#8608](https://github.com/CesiumGS/cesium/pull/8608)

##### Fixes :wrench:
Expand Down
1 change: 0 additions & 1 deletion Documentation/Contributors/BuildGuide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ Here's the full set of scripts and what they do.
- `eslint-watch` - A never-ending task that watches your file system for changes to Cesium and runs ESLint on any changed source files.
- `clean` - Removes all generated build artifacts.
- `cloc` - Runs [CLOC](https://github.com/AlDanial/cloc) to count the lines of code on the Source and Specs directories. This requires [Perl](http://www.perl.org/) to execute.
- `sortRequires` - Alphabetically sorts the list of required modules in every `js` file. It also makes sure that the top of every source file uses the same formatting.
- **Testing scripts** -- build and run the unit tests
- `test` - Runs all tests with [Karma](http://karma-runner.github.io/0.13/index.html) using the default browser specified in the Karma config file.
- `test-all` - Runs all tests with Karma using all browsers installed on the current system.
Expand Down
20 changes: 0 additions & 20 deletions Documentation/Contributors/CodingGuide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -887,26 +887,6 @@ It is usually obvious what directory a file belongs in. When it isn't, the decis

Modules (files) should only reference modules in the same level or a lower level of the stack. For example, a module in `Scene` can use modules in `Scene`, `Renderer`, and `Core`, but not in `DataSources` or `Widgets`.

- Modules in `define` statements should be in alphabetical order. This can be done automatically with `npm run sortRequires`, see the [Build Guide](../BuildGuide/README.md). For example, the modules required by `Scene/ModelAnimation.js` are:

```javascript
define([
"../Core/defaultValue",
"../Core/Event",
"../Core/JulianDate",
"./ModelAnimationLoop",
"./ModelAnimationState",
], function (
defaultValue,
Event,
JulianDate,
ModelAnimationLoop,
ModelAnimationState
) {
/* ... */
});
```

- WebGL resources need to be explicitly deleted so classes that contain them (and classes that contain these classes, and so on) have `destroy` and `isDestroyed` functions, e.g.,

```javascript
Expand Down
56 changes: 25 additions & 31 deletions Documentation/Contributors/TestingGuide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,14 @@ Tests are written in JavaScript using Jasmine. It is important to realize that t
Here is a stripped down version of the tests:

```javascript
define(["Core/Cartesian3"], function (Cartesian3) {
"use strict";

describe("Cartesian3", function () {
it("construct with default values", function () {
var cartesian = new Cartesian3();
expect(cartesian.x).toEqual(0.0);
expect(cartesian.y).toEqual(0.0);
expect(cartesian.z).toEqual(0.0);
});
import { Cartesian3 } from "../../Source/Cesium.js";

describe("Cartesian3", function () {
it("construct with default values", function () {
var cartesian = new Cartesian3();
expect(cartesian.x).toEqual(0.0);
expect(cartesian.y).toEqual(0.0);
expect(cartesian.z).toEqual(0.0);
});
});
```
Expand Down Expand Up @@ -724,30 +722,26 @@ This test is more cohesive and easier to debug than if it were written using a _
As mentioned above, some tests are in the `'WebGL'` category. To assign a category to a suite, pass the category to `describe`.

```javascript
define(["Scene/DebugModelMatrixPrimitive", "Specs/createScene"], function (
DebugModelMatrixPrimitive,
createScene
) {
"use strict";

describe(
"Scene/DebugModelMatrixPrimitive",
function () {
var scene;
import { DebugModelMatrixPrimitive } from "../../Source/Cesium.js";
import createScene from "../createScene.js";

beforeAll(function () {
scene = createScene();
});
describe(
"Scene/DebugModelMatrixPrimitive",
function () {
var scene;

afterAll(function () {
scene.destroyForSpecs();
});
beforeAll(function () {
scene = createScene();
});

// ...
},
"WebGL"
);
});
afterAll(function () {
scene.destroyForSpecs();
});

// ...
},
"WebGL"
);
```

CesiumJS uses a customized `describe` function that wraps Jasmine describe calls and provides the category capability.
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/WallGeometryLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import PolylinePipeline from "./PolylinePipeline.js";
import WindingOrder from "./WindingOrder.js";

/**
* private
* @private
*/
var WallGeometryLibrary = {};

Expand Down
1 change: 1 addition & 0 deletions Source/Renderer/ClearCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import defaultValue from "../Core/defaultValue.js";
* Represents a command to the renderer for clearing a framebuffer.
*
* @private
* @constructor
*/
function ClearCommand(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
Expand Down
1 change: 1 addition & 0 deletions Source/Renderer/ComputeCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Pass from "./Pass.js";
* Represents a command to the renderer for GPU Compute (using old-school GPGPU).
*
* @private
* @constructor
*/
function ComputeCommand(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
Expand Down
1 change: 1 addition & 0 deletions Source/Renderer/Context.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ function getExtension(gl, names) {

/**
* @private
* @constructor
*/
function Context(canvas, options) {
// this check must use typeof, not defined, because defined doesn't work with undeclared variables.
Expand Down
1 change: 1 addition & 0 deletions Source/Renderer/Framebuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function attachRenderbuffer(framebuffer, attachment, renderbuffer) {
* });
*
* @private
* @constructor
*/
function Framebuffer(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
Expand Down
1 change: 1 addition & 0 deletions Source/Renderer/PassState.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* in a command being executed.
*
* @private
* @constructor
*/
function PassState(context) {
/**
Expand Down
26 changes: 26 additions & 0 deletions Source/Renderer/Texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,32 @@ function Texture(options) {
pixelDatatype,
arrayBufferView
);

if (defined(source.mipLevels)) {
var mipWidth = width;
var mipHeight = height;
for (var i = 0; i < source.mipLevels.length; ++i) {
mipWidth = Math.floor(mipWidth / 2) | 0;
if (mipWidth < 1) {
mipWidth = 1;
}
mipHeight = Math.floor(mipHeight / 2) | 0;
if (mipHeight < 1) {
mipHeight = 1;
}
gl.texImage2D(
textureTarget,
i + 1,
internalFormat,
mipWidth,
mipHeight,
0,
pixelFormat,
pixelDatatype,
source.mipLevels[i]
);
}
}
}
} else if (defined(source.framebuffer)) {
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
Expand Down
1 change: 1 addition & 0 deletions Source/Renderer/UniformState.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import SunLight from "../Scene/SunLight.js";

/**
* @private
* @constructor
*/
function UniformState() {
/**
Expand Down
13 changes: 13 additions & 0 deletions Source/Renderer/createUniform.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import RuntimeError from "../Core/RuntimeError.js";

/**
* @private
* @constructor
*/
function createUniform(gl, activeUniform, uniformName, location) {
switch (activeUniform.type) {
Expand Down Expand Up @@ -56,6 +57,7 @@ function createUniform(gl, activeUniform, uniformName, location) {

/**
* @private
* @constructor
*/
function UniformFloat(gl, activeUniform, uniformName, location) {
/**
Expand All @@ -82,6 +84,7 @@ UniformFloat.prototype.set = function () {

/**
* @private
* @constructor
*/
function UniformFloatVec2(gl, activeUniform, uniformName, location) {
/**
Expand Down Expand Up @@ -109,6 +112,7 @@ UniformFloatVec2.prototype.set = function () {

/**
* @private
* @constructor
*/
function UniformFloatVec3(gl, activeUniform, uniformName, location) {
/**
Expand Down Expand Up @@ -150,6 +154,7 @@ UniformFloatVec3.prototype.set = function () {

/**
* @private
* @constructor
*/
function UniformFloatVec4(gl, activeUniform, uniformName, location) {
/**
Expand Down Expand Up @@ -191,6 +196,7 @@ UniformFloatVec4.prototype.set = function () {

/**
* @private
* @constructor
*/
function UniformSampler(gl, activeUniform, uniformName, location) {
/**
Expand Down Expand Up @@ -225,6 +231,7 @@ UniformSampler.prototype._setSampler = function (textureUnitIndex) {

/**
* @private
* @constructor
*/
function UniformInt(gl, activeUniform, uniformName, location) {
/**
Expand All @@ -250,6 +257,7 @@ UniformInt.prototype.set = function () {
///////////////////////////////////////////////////////////////////////////
/**
* @private
* @constructor
*/
function UniformIntVec2(gl, activeUniform, uniformName, location) {
/**
Expand All @@ -276,6 +284,7 @@ UniformIntVec2.prototype.set = function () {
///////////////////////////////////////////////////////////////////////////
/**
* @private
* @constructor
*/
function UniformIntVec3(gl, activeUniform, uniformName, location) {
/**
Expand All @@ -302,6 +311,7 @@ UniformIntVec3.prototype.set = function () {
///////////////////////////////////////////////////////////////////////////
/**
* @private
* @constructor
*/
function UniformIntVec4(gl, activeUniform, uniformName, location) {
/**
Expand Down Expand Up @@ -330,6 +340,7 @@ UniformIntVec4.prototype.set = function () {
var scratchUniformArray = new Float32Array(4);
/**
* @private
* @constructor
*/
function UniformMat2(gl, activeUniform, uniformName, location) {
/**
Expand Down Expand Up @@ -359,6 +370,7 @@ UniformMat2.prototype.set = function () {
var scratchMat3Array = new Float32Array(9);
/**
* @private
* @constructor
*/
function UniformMat3(gl, activeUniform, uniformName, location) {
/**
Expand Down Expand Up @@ -388,6 +400,7 @@ UniformMat3.prototype.set = function () {
var scratchMat4Array = new Float32Array(16);
/**
* @private
* @constructor
*/
function UniformMat4(gl, activeUniform, uniformName, location) {
/**
Expand Down
Loading

0 comments on commit 586a6ef

Please sign in to comment.