-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Fix #11940 : add VerticalExaggeration option to models #12141
Conversation
…been rendered on the map, verticalExaggeration != 1.0 and allowVerticalExaggeration was set to false, it would still exaggerate. Capture state and reset model.
…ually implemented. Fixed accordingly.
Thank you for the pull request, @timeichfeld-msa! Welcome to the Cesium community! In order for us to review your PR, please complete the following steps:
Review Pull Request Guidelines to make sure your PR gets accepted quickly. |
Hi @timeichfeld-msa, thanks for the PR! I can confirm we now have a CLA on file for you. We will review this PR shortly! @jjhembd Can you please add your thoughts? |
Hi @timeichfeld-msa, many thanks for this contribution! We have had several users asking for it. I just have one comment about the default: I think it would be better for
|
Hi Jeshurun, Understood, makes sense. I can make those changes. Please let me know about the protobufjs/dist/minimal/protobuf.js error and guidance if I need to take a look. Thanks much, |
@timeichfeld-msa The protobufjs error is being addressed in #12144. The only action needed on your end will be to merge in the |
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.
Thanks @timeichfeld-msa! I added a few quick observations for now. I can look more carefully next week.
The tests are showing a few failures. Can you please check these? See the Testing Guide for details on how to run the tests on your machine.
@@ -123,6 +123,7 @@ import pickModel from "./pickModel.js"; | |||
* @privateParam {boolean} [options.show=true] Whether or not to render the model. | |||
* @privateParam {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the model from model to world coordinates. | |||
* @privateParam {number} [options.scale=1.0] A uniform scale applied to this model. | |||
* @privateParam {boolean} [options.allowVerticalExaggeration=false] Allows the model to participate in vertical exaggeration. |
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.
I think we will also want this class to default to true
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.
complete.
set: function (value) { | ||
if (value !== this._allowVerticalExaggeration) { | ||
this.resetDrawCommands(); | ||
//this._verticalExaggerationDirty = true; |
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.
I assume we can drop this commented line?
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.
removed
@@ -199,7 +199,8 @@ ModelRuntimePrimitive.prototype.configurePipeline = function (frameState) { | |||
const mode = frameState.mode; | |||
const use2D = | |||
mode !== SceneMode.SCENE3D && !frameState.scene3DOnly && model._projectTo2D; | |||
const exaggerateTerrain = frameState.verticalExaggeration !== 1.0; | |||
const exaggerateTerrain = |
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.
Can we rename this variable to exaggerationOn
or something like that? The leftover "terrain" naming looks like an oversight from the previous change to verticalExaggeration
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.
complete
@@ -2748,6 +2791,7 @@ Model.prototype.destroyModelResources = function () { | |||
* @param {boolean} [options.show=true] Whether or not to render the model. | |||
* @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the model from model to world coordinates. | |||
* @param {number} [options.scale=1.0] A uniform scale applied to this model. | |||
* @param {boolean} [options.allowVerticalExaggeration=false] Allows the model to participate in Vertical Exaggeration |
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.
Another place to change the default
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.
complete
@jjhembd
|
Hi @timeichfeld-msa, thanks for the update! I pushed a small change to your branch which changes the naming slightly to align with our existing properties. I also fixed and added some additional specs. I noticed #11936 and #11974 are still indeed issues, but those is out of the scope of this PR. @jjhembd Can you do a final review and merge if happy (after the 1.121 release is complete)? |
Thanks @timeichfeld-msa! |
Description
added allowVerticalExaggeration configuration to models:
This is currently defaulted to false.
Models should not exaggerate with the terrain unless specified to do so.
Issue number and link
Turn off vertical exaggeration for some Models in the Scene Fixes #11940
Testing plan
in a local Local Sandcastle instance.
Set allowVerticalExaggeration = true and run Cesium
Set allowVerticalExaggeration = false and run Cesium
Run the following code.
Author checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change