-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Added shadows property to Cesium3DTileset #4386
Conversation
@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; |
There was a problem hiding this comment.
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;
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 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, |
There was a problem hiding this comment.
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.
Fixes #4344