Skip to content

Commit

Permalink
clamp shadow map resolution to max
Browse files Browse the repository at this point in the history
  • Loading branch information
guycalledfrank committed Jun 25, 2015
1 parent 7cdfef0 commit 88714a5
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 88714a5

Please sign in to comment.