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

Made czm_imagerySplitPosition use absolute coordinates. Fixes #5106. #5151

Merged
merged 2 commits into from
Mar 27, 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 @@ -25,6 +25,7 @@ Change Log
* Set `projectionPicker` to `true` in the options when creating a `Viewer` to add a widget that will switch projections. [#5021](https://github.com/AnalyticalGraphicsInc/cesium/pull/5021)
* Call `switchToOrthographicFrustum` or `switchToPerspectiveFrustum` on `Camera` to change projections.
* Fix billboard, point and label clustering in 2D and Columbus view. [#5136](https://github.com/AnalyticalGraphicsInc/cesium/pull/5136)
* Fixed issues with imagerySplitPosition and the international date line in 2D mode. [#5151](https://github.com/AnalyticalGraphicsInc/cesium/pull/5151)

### 1.31 - 2017-03-01

Expand Down
2 changes: 1 addition & 1 deletion Source/Renderer/AutomaticUniforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@ define([

/**
* An automatic GLSL uniform representing the splitter position to use when rendering imagery layers with a splitter.
* This will be in the range 0.0 to 1.0 with 0.0 being the far left of the viewport and 1.0 being the far right of the viewport.
* This will be in pixel coordinates relative to the canvas.
*
* @alias czm_imagerySplitPosition
* @glslUniform
Expand Down
3 changes: 2 additions & 1 deletion Source/Renderer/UniformState.js
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,8 @@ define([
this._frameState = frameState;
this._temeToPseudoFixed = Transforms.computeTemeToPseudoFixedMatrix(frameState.time, this._temeToPseudoFixed);

this._imagerySplitPosition = frameState.imagerySplitPosition;
// Convert the relative imagerySplitPosition to absolute pixel coordinates
this._imagerySplitPosition = frameState.imagerySplitPosition * canvas.clientWidth;
var fov = camera.frustum.fov;
var viewport = this._viewport;
var pixelSizePerMeter;
Expand Down
2 changes: 1 addition & 1 deletion Source/Shaders/GlobeFS.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ vec4 sampleAndBlend(
float alpha = value.a;

#ifdef APPLY_SPLIT
float splitPosition = czm_imagerySplitPosition * czm_viewport.z;
float splitPosition = czm_imagerySplitPosition;
// Split to the left
if (split < 0.0 && gl_FragCoord.x > splitPosition) {
alpha = 0.0;
Expand Down