Skip to content

Commit

Permalink
Merge pull request #336 from guycalledfrank/clampsmapres
Browse files Browse the repository at this point in the history
clamp shadow map resolution to max
  • Loading branch information
guycalledfrank committed Jun 25, 2015
2 parents 4903b6b + 88714a5 commit 6d5dde1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/scene/scene_light.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,12 @@ pc.extend(pc, function () {
* @param {Number} resolution The pixel width and height of the shadow map
*/
setShadowResolution: function (resolution) {
var device = pc.Application.getApplication().graphicsDevice;
if (this._type===pc.LIGHTTYPE_POINT) {
resolution = Math.min(resolution, device.maxCubeMapSize);
} else {
resolution = Math.min(resolution, device.maxTextureSize);
}
this._shadowResolution = resolution;
},

Expand Down

0 comments on commit 6d5dde1

Please sign in to comment.