From 88714a54c6358b502543ac287e7644fca34895d4 Mon Sep 17 00:00:00 2001 From: Mr F Date: Thu, 25 Jun 2015 18:58:01 +0300 Subject: [PATCH] clamp shadow map resolution to max --- src/scene/scene_light.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/scene/scene_light.js b/src/scene/scene_light.js index ae192dd3958..4c1425eabfb 100644 --- a/src/scene/scene_light.js +++ b/src/scene/scene_light.js @@ -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; },