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

Added shadows property to Cesium3DTileset #4386

Merged
merged 5 commits into from
Oct 3, 2016

Conversation

sumitshyamsukha
Copy link
Contributor

Fixes #4344

@lilleyse
Copy link
Contributor

@sumitshyamsukha Make sure to resolve the merge conflict. Check out #4376 (comment) for details.

@@ -303,6 +304,7 @@ define([
// actually generate commands.
this.batchTable.update(tileset, frameState);
this._model.modelMatrix = this._tile.computedTransform;
this._model.shadows = this._tileset.shadows;
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks good, except while testing I noticed that changing the shadows at run time wasn't working because the Batched3DModel3DTileContent clones the model's commands, so we need to also set the shadows for the cloned commands.

At https://github.com/AnalyticalGraphicsInc/cesium/blob/3d-tiles/Source/Scene/Cesium3DTileBatchTable.js#L785 add the following lines:

derivedCommands.originalCommand.castShadows = command.castShadows;
derivedCommands.originalCommand.receiveShadows = command.receiveShadows;
derivedCommands.back.castShadows = command.castShadows;
derivedCommands.back.receiveShadows = command.receiveShadows;
derivedCommands.front.castShadows = command.castShadows;
derivedCommands.front.receiveShadows = command.receiveShadows;

@lilleyse
Copy link
Contributor

lilleyse commented Oct 3, 2016

Tested, everything looks good!

@sumitshyamsukha Just a reminder, leave a short comment that says 'Updated' or 'Ready' to say that the PR is ready to be looked at.

@lilleyse lilleyse merged commit 3b42f6d into CesiumGS:3d-tiles Oct 3, 2016
@sumitshyamsukha
Copy link
Contributor Author

@lilleyse Sorry, will keep that in mind next time!

@@ -260,6 +260,7 @@ define([
releaseGltfJson : true, // Models are unique and will not benefit from caching so save memory
basePath : this._url,
modelMatrix : this._tile.computedTransform,
shadows: this._tileset.shadows,
Copy link
Contributor

Choose a reason for hiding this comment

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

Whitespace, please update in 3d-tiles branch.

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