Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D Tiles doc fixes #5356

Merged
merged 5 commits into from
May 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Change Log
* `Cesium3DTileContent`
* `Cesium3DTileFeature`
* `Cesium3DTilesInspector`, `Cesium3DTilesInspectorViewModel`, and `viewerCesium3DTilesInspectorMixin`
* `Cesium3DTileColorBlendMode`

### 1.34 - 2017-06-01

Expand Down
12 changes: 6 additions & 6 deletions Source/Scene/Batched3DModel3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,25 @@ define([
/**
* Part of the {@link Cesium3DTileContent} interface.
*/
vertexMemorySizeInBytes : {
geometryByteLength : {
get : function() {
return this._model.vertexMemorySizeInBytes;
return this._model.geometryByteLength;
}
},

/**
* Part of the {@link Cesium3DTileContent} interface.
*/
textureMemorySizeInBytes : {
texturesByteLength : {
get : function() {
return this._model.textureMemorySizeInBytes;
return this._model.texturesByteLength;
}
},

/**
* Part of the {@link Cesium3DTileContent} interface.
*/
batchTableMemorySizeInBytes : {
batchTableByteLength : {
get : function() {
return this._batchTable.memorySizeInBytes;
}
Expand Down Expand Up @@ -344,7 +344,7 @@ define([
// The pick shader still needs to be patched.
content._model = new Model({
gltf : gltfView,
cull : false, // The model is already culled by the 3D tiles
cull : false, // The model is already culled by 3D Tiles
releaseGltfJson : true, // Models are unique and will not benefit from caching so save memory
basePath : basePath,
requestType : RequestType.TILES3D,
Expand Down
22 changes: 17 additions & 5 deletions Source/Scene/Cesium3DTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,15 @@ define([

/**
* A tile in a 3D Tiles tileset. When a tile is first created, its content is not loaded;
* the content is loaded on-demand when needed based on the view using
* {@link Cesium3DTile#requestContent}.
* the content is loaded on-demand when needed based on the view.
* <p>
* Do not construct this directly, instead access tiles through {@link Cesium3DTileset#tileVisible}.
* </p>
*
* @alias Cesium3DTile
* @constructor
*/
function Cesium3DTile(tileset, baseUrl, header, parent) {
function Cesium3DTile(tileset, basePath, header, parent) {
this._tileset = tileset;
this._header = header;
var contentHeader = header.content;
Expand All @@ -115,6 +114,7 @@ define([
/**
* The final computed transform of this tile
* @type {Matrix4}
* @readonly
*/
this.computedTransform = computedTransform;

Expand Down Expand Up @@ -142,7 +142,7 @@ define([

/**
* The error, in meters, introduced if this tile is rendered and its children are not.
* This is used to compute Screen-Space Error (SSE), i.e., the error measured in pixels.
* This is used to compute screen space error, i.e., the error measured in pixels.
*
* @type {Number}
* @readonly
Expand All @@ -164,6 +164,7 @@ define([
*
* @type {Cesium3DTileRefine}
* @readonly
* @private
*/
this.refine = refine;

Expand Down Expand Up @@ -197,7 +198,7 @@ define([
if (defined(contentHeader)) {
hasEmptyContent = false;
contentState = Cesium3DTileContentState.UNLOADED;
contentUrl = joinUrls(baseUrl, contentHeader.url);
contentUrl = joinUrls(basePath, contentHeader.url);
requestServer = RequestScheduler.getRequestServer(contentUrl);
} else {
content = new Empty3DTileContent(tileset, this);
Expand Down Expand Up @@ -274,13 +275,15 @@ define([
* The time in seconds after the tile's content is ready when the content expires and new content is requested.
*
* @type {Number}
* @readonly
*/
this.expireDuration = expireDuration;

/**
* The date when the content expires and new content is requested.
*
* @type {JulianDate}
* @readonly
*/
this.expireDate = expireDate;

Expand Down Expand Up @@ -380,6 +383,7 @@ define([
*
* @type {TileBoundingVolume}
* @readonly
* @private
*/
contentBoundingVolume : {
get : function() {
Expand Down Expand Up @@ -420,6 +424,8 @@ define([
*
* @type {Boolean}
* @readonly
*
* @private
*/
contentAvailable : {
get : function() {
Expand All @@ -435,6 +441,8 @@ define([
*
* @type {Boolean}
* @readonly
*
* @private
*/
contentReady : {
get : function() {
Expand All @@ -450,6 +458,8 @@ define([
*
* @type {Boolean}
* @readonly
*
* @private
*/
contentUnloaded : {
get : function() {
Expand All @@ -465,6 +475,8 @@ define([
*
* @type {Boolean}
* @readonly
*
* @private
*/
contentExpired : {
get : function() {
Expand Down
6 changes: 3 additions & 3 deletions Source/Scene/Cesium3DTileBatchTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,7 @@ define([
var commandEnd = commandList.length;
var tile = this._content._tile;
var tileset = tile._tileset;
var bivariateVisibilityTest = tileset.skipLODs && tileset._hasMixedContent && frameState.context.stencilBuffer;
var bivariateVisibilityTest = tileset.skipLevelOfDetail && tileset._hasMixedContent && frameState.context.stencilBuffer;
var styleCommandsNeeded = getStyleCommandsNeeded(this);

for (var i = commandStart; i < commandEnd; ++i) {
Expand Down Expand Up @@ -1460,7 +1460,7 @@ define([
}

batchTable._pickTexture = createTexture(batchTable, context, bytes);
content._tileset._statistics.batchTableMemorySizeInBytes += batchTable._pickTexture.sizeInBytes;
content._tileset._statistics.batchTableByteLength += batchTable._pickTexture.sizeInBytes;
}
}

Expand Down Expand Up @@ -1491,7 +1491,7 @@ define([
// Create batch texture on-demand
if (!defined(this._batchTexture)) {
this._batchTexture = createTexture(this, context, this._batchValues);
tileset._statistics.batchTableMemorySizeInBytes += this._batchTexture.sizeInBytes;
tileset._statistics.batchTableByteLength += this._batchTexture.sizeInBytes;
}

updateBatchTexture(this); // Apply per-feature show/color updates
Expand Down
36 changes: 26 additions & 10 deletions Source/Scene/Cesium3DTileColorBlendMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ define([
/**
* Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from
* the original feature, e.g. glTF material or per-point color in the tile.
*
* HIGHLIGHT multiplies the source color by the feature color
* REPLACE replaces the source color with the feature color
* MIX blends the source color and feature color together
*
* When REPLACE or MIX are used and the source color is a glTF material, the technique must assign the
* _3DTILESDIFFUSE semantic to the diffuse color parameter. Otherwise only HIGHLIGHT is supported.
*
* For example:
*
* <p>
* When <code>REPLACE</code> or <code>MIX</code> are used and the source color is a glTF material, the technique must assign the
* <code>_3DTILESDIFFUSE</code> semantic to the diffuse color parameter. Otherwise only <code>HIGHLIGHT</code> is supported.
* </p>
* <pre><code>
* "techniques": {
* "technique0": {
* "parameters": {
Expand All @@ -28,12 +23,33 @@ define([
* }
* }
* }
* </code></pre>
*
* @exports Cesium3DTileColorBlendMode
*/
var Cesium3DTileColorBlendMode = {
/**
* Multiplies the source color by the feature color.
*
* @type {Number}
* @constant
*/
HIGHLIGHT : 0,

/**
* Replaces the source color with the feature color.
*
* @type {Number}
* @constant
*/
REPLACE : 1,

/**
* Blends the source color and feature color together.
*
* @type {Number}
* @constant
*/
MIX : 2
};

Expand Down
32 changes: 19 additions & 13 deletions Source/Scene/Cesium3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ define([
*
* @alias Cesium3DTileContent
* @constructor
*
* @see Batched3DModel3DTileContent
* @see Instanced3DModel3DTileContent
* @see PointCloud3DTileContent
* @see Composite3DTileContent
* @see Tileset3DTileContent
* @see Empty3DTileContent
*/
function Cesium3DTileContent(tileset, tile, url, arrayBuffer, byteOffset) {
/**
Expand Down Expand Up @@ -57,6 +50,12 @@ define([

/**
* Gets the number of points in the tile.
* <p>
* Only applicable for tiles with Point Cloud content. This is different than {@link Cesium3DTileContent#featuresLength} which
* equals the number of groups of points as distinguished by the <code>BATCH_ID</code> feature table semantic.
* </p>
*
* @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/PointCloud/README.md#batched-points}
*
* @memberof Cesium3DTileContent.prototype
*
Expand Down Expand Up @@ -84,14 +83,14 @@ define([
},

/**
* Gets the tile's vertex memory in bytes.
* Gets the tile's geometry memory in bytes.
*
* @memberof Cesium3DTileContent.prototype
*
* @type {Number}
* @readonly
*/
vertexMemorySizeInBytes : {
geometryByteLength : {
get : function() {
DeveloperError.throwInstantiationError();
}
Expand All @@ -105,21 +104,21 @@ define([
* @type {Number}
* @readonly
*/
textureMemorySizeInBytes : {
texturesByteLength : {
get : function() {
DeveloperError.throwInstantiationError();
}
},

/**
* Gets the tile's batch table memory in bytes.
* Gets the amount of memory used by the batch table textures, in bytes.
*
* @memberof Cesium3DTileContent.prototype
*
* @type {Number}
* @readonly
*/
batchTableMemorySizeInBytes : {
batchTableByteLength : {
get : function() {
DeveloperError.throwInstantiationError();
}
Expand All @@ -129,6 +128,8 @@ define([
* Gets the array of {@link Cesium3DTileContent} objects that represent the
* content a composite's inner tiles, which can also be composites.
*
* @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/Composite/README.md}
*
* @memberof Cesium3DTileContent.prototype
*
* @type {Array}
Expand Down Expand Up @@ -226,11 +227,16 @@ define([
* Returns the {@link Cesium3DTileFeature} object for the feature with the
* given <code>batchId</code>. This object is used to get and modify the
* feature's properties.
* <p>
* Features in a tile are ordered by <code>batchId</code>, an index used to retrieve their metadata from the batch table.
* </p>
*
* @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/TileFormats/BatchTable}.
*
* @param {Number} batchId The batchId for the feature.
* @returns {Cesium3DTileFeature} The corresponding {@link Cesium3DTileFeature} object.
*
* @exception {DeveloperError} batchId must be between zero and {@link Cesium3DTileContent#featuresLength - 1}.
* @exception {DeveloperError} batchId must be between zero and {@link Cesium3DTileContent#featuresLength} - 1.
*/
Cesium3DTileContent.prototype.getFeature = function(batchId) {
DeveloperError.throwInstantiationError();
Expand Down
Loading