Skip to content

Commit

Permalink
Merge pull request CesiumGS#1459 from AnalyticalGraphicsInc/multifrustum
Browse files Browse the repository at this point in the history
Fix translucent multifrustum artifact
  • Loading branch information
pjcozzi committed Feb 26, 2014
2 parents 6cb5ada + 20ffb5b commit 3eaa679
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Beta Releases
* View-dependent imagery source attribution is now added to the `CreditDisplay` by the `BingMapsImageryProvider`.
* `BingMapsImageryProvider` now uses HTTPS by default for metadata and tiles when the document is loaded over HTTPS.
* `RequestErrorEvent` now includes the headers that were returned with the error response.
* Fix multifrustum translucent rendering artifact.
* Added `CesiumInspector` widget for graphics debugging. In Cesium Viewer, it is enabled by using the query parameter `inspector=true`.
* Fixed `WallGeometry` bug that failed by removing positions that were less close together by less than 6 decimal places. [#1483](https://github.com/AnalyticalGraphicsInc/cesium/pull/1483)
* `DynamicEllipse`, `DynamicPolygon`, and `DynamicEllipsoid` now have properties matching their geometry counterpart, i.e. `EllipseGeometry`, `EllipseOutlineGeometry`, etc. These properties are also available in CZML.
Expand Down
13 changes: 8 additions & 5 deletions Source/Scene/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,6 @@ define([
var curNear = Math.max(near, Math.pow(farToNearRatio, m) * near);
var curFar = Math.min(far, farToNearRatio * curNear);

if (m !== 0) {
// Avoid tearing artifacts between adjacent frustums
curNear *= 0.99;
}

var frustumCommands = frustumCommandsList[m];
if (!defined(frustumCommands)) {
frustumCommands = frustumCommandsList[m] = new FrustumCommands(curNear, curFar);
Expand Down Expand Up @@ -836,6 +831,11 @@ define([
frustum.near = frustumCommands.near;
frustum.far = frustumCommands.far;

if (index !== 0) {
// Avoid tearing artifacts between adjacent frustums
frustum.near *= 0.99;
}

us.updateFrustum(frustum);

var j;
Expand All @@ -845,6 +845,9 @@ define([
executeCommand(commands[j], scene, context, passState);
}

frustum.near = frustumCommands.near;
us.updateFrustum(frustum);

commands = frustumCommands.translucentCommands;
length = commands.length = frustumCommands.translucentIndex;
for (j = 0; j < length; ++j) {
Expand Down

0 comments on commit 3eaa679

Please sign in to comment.