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

Add wireframe debug option for 3D Tilesets #4844

Merged
merged 4 commits into from
Jan 11, 2017

Conversation

austinEng
Copy link
Contributor

No description provided.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jan 10, 2017

Looks good at quick glance!

@lilleyse please review and merge.

Copy link
Contributor

@lilleyse lilleyse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job @austinEng, just these comments.

}
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be combined with updateDerivedCommandsShadows and the function renamed to just updateDerivedCommands.

@@ -939,6 +941,27 @@ defineSuite([
});
});

it('debugWireframe', function() {
// More precise test is in Cesium3DTileBatchTableSpec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this comment.

scene.renderForSpecs();
var commands = scene.frameState.commandList;
var i;
for (i = 0; i < commands.length; ++i) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically we factor out commands.length to its own variable for a slight performance gain. It won't matter for tests, but is a good habit for consistency purposes.

@@ -343,6 +343,10 @@ define([
this.batchTable.setAllColor(color);
};

Batched3DModel3DTileContent.prototype.applyWireframe = function(enabled) {
this._model.debugWireframe = enabled;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding this function to every content type, it would be shorter to model debugWireframe after how shadows are set in Instanced3DModel3DTileContent and Batched3DModel3DTileContent.

It looks like you modeled it after applyDebugSettings. The reason that one is its own function is because it can be a quite heavy operation (this.batchTable.setAllColor(color);) that we wouldn't want to call every frame. For the case of shadows and debugWireframe though there is hardly any impact to do the simple updates every frame.

@austinEng
Copy link
Contributor Author

Updated. Thanks for pointing out why we update for debugColorizeTiles more conservatively.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jan 11, 2017

@austinEng in the future when you open a pull request, please include a comment like "Fixes #3830" so that reviewers can easily check out the issue and GitHub will automatically close it when the PR is merged (unless the issue includes a tasklist with unchecked items).

Copy link
Contributor

@lilleyse lilleyse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New changes look good, just minor cleanup comments.

@@ -342,7 +343,7 @@ define([
color = enabled ? color : Color.WHITE;
this.batchTable.setAllColor(color);
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Un-indent

@@ -325,6 +325,7 @@ define([
this._debugViewerRequestVolume = undefined;
this._debugColor = new Color.fromRandom({ alpha : 1.0 });
this._debugColorizeTiles = false;
this._debugWireframe = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line.

@@ -123,6 +123,7 @@ define([
*/
Tileset3DTileContent.prototype.applyDebugSettings = function(enabled, color) {
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty line.

@austinEng
Copy link
Contributor Author

Updated

@lilleyse
Copy link
Contributor

Thanks!

@lilleyse lilleyse merged commit 421f117 into CesiumGS:3d-tiles Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants