Config.render.maxTextures is a new game config setting that allows you to control how many texture units will be used in WebGL.

This commit is contained in:
Richard Davey 2020-07-15 16:51:40 +01:00
parent 95ded9c8b3
commit 477b847f13
2 changed files with 7 additions and 1 deletions

View file

@ -396,7 +396,12 @@ var Config = new Class({
/**
* @const {integer} Phaser.Core.Config#batchSize - The default WebGL Batch size.
*/
this.batchSize = GetValue(renderConfig, 'batchSize', 2000);
this.batchSize = GetValue(renderConfig, 'batchSize', 4096);
/**
* @const {integer} Phaser.Core.Config#maxTextures - When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8.
*/
this.maxTextures = GetValue(renderConfig, 'maxTextures', -1);
/**
* @const {integer} Phaser.Core.Config#maxLights - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager.

View file

@ -14,5 +14,6 @@
* @property {string} [powerPreference='default'] - "high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use.
* @property {integer} [batchSize=2000] - The default WebGL batch size.
* @property {integer} [maxLights=10] - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager.
* @property {integer} [maxTextures=-1] - When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8.
* @property {string} [mipmapFilter='LINEAR'] - The mipmap magFilter to be used when creating WebGL textures.
*/