Skip to content

Commit

Permalink
Fix sun flickering when picking.
Browse files Browse the repository at this point in the history
  • Loading branch information
bagnell committed May 13, 2013
1 parent d851a54 commit 6d7bb52
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Source/Scene/SunPostProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@ define([
size.y = sunSize;

var scissorRectangle = scissorTestBoundingRectangle;
scissorRectangle.x = sunPositionWC.x - size.x * 0.5;
scissorRectangle.y = sunPositionWC.y - size.y * 0.5;
scissorRectangle.width = size.x;
scissorRectangle.height = size.y;
scissorRectangle.x = Math.max(sunPositionWC.x - size.x * 0.5, 0.0);
scissorRectangle.y = Math.max(sunPositionWC.y - size.y * 0.5, 0.0);
scissorRectangle.width = Math.min(size.x, width);
scissorRectangle.height = Math.min(size.y, height);

this._blendCommand.renderState = context.createRenderState({
viewport : viewport,
Expand All @@ -360,10 +360,10 @@ define([
size.x *= downSampleWidth / width;
size.y *= downSampleHeight / height;

scissorRectangle.x = sunPositionWC.x - size.x * 0.5;
scissorRectangle.y = sunPositionWC.y - size.y * 0.5;
scissorRectangle.width = size.x;
scissorRectangle.height = size.y;
scissorRectangle.x = Math.max(sunPositionWC.x - size.x * 0.5, 0.0);
scissorRectangle.y = Math.max(sunPositionWC.y - size.y * 0.5, 0.0);
scissorRectangle.width = Math.min(size.x, width);
scissorRectangle.height = Math.min(size.y, height);

var renderState = context.createRenderState({
viewport : viewport,
Expand Down

0 comments on commit 6d7bb52

Please sign in to comment.