Skip to content

Commit

Permalink
Merge pull request #495 from WarWithinMe/directional-light-error
Browse files Browse the repository at this point in the history
Fix directional light's shadow projection.
  • Loading branch information
willeastcott committed Jan 7, 2016
2 parents 823b002 + a0857a8 commit a8eacc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scene/forward-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ pc.extend(pc, function () {
}

// 4. Use your min and max values to create an off-center orthographic projection.
shadowCam._node.translateLocal(-(maxx + minx) * 0.5, (maxy + miny) * 0.5, maxz + (maxz - minz) * 0.25);
shadowCam._node.translateLocal((maxx + minx) * 0.5, (maxy + miny) * 0.5, maxz + (maxz - minz) * 0.25);
shadowCamWtm.copy(shadowCam._node.getWorldTransform());

shadowCam.setProjection(pc.PROJECTION_ORTHOGRAPHIC);
Expand Down

0 comments on commit a8eacc8

Please sign in to comment.