@lightningjs/blits 1.21.1 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.22.0
4
+
5
+ _3 mar 2025_
6
+
7
+ - Added default value for `createImageBitmapSupport` to `auto`
8
+ - Added advanced launch settings
9
+
3
10
  ## v1.21.1
4
11
 
5
12
  _28 feb 2025_
@@ -128,7 +128,7 @@ export default Blits.Component('Gold', {
128
128
  }
129
129
  ```
130
130
 
131
- It is also possible to keep track of the entire progress of a transition. Every frametick during a transition (ideally once every 1.6ms), the renderer reports the progress of the transition. You can hook into this event by specifying a `progress` key on the transition configuration object, with a function to excute.
131
+ It is also possible to keep track of the entire progress of a transition. Every frametick during a transition (ideally once every 16ms), the renderer reports the progress of the transition. You can hook into this event by specifying a `progress` key on the transition configuration object, with a function to excute.
132
132
 
133
133
  This function is executed _every_ frametick, and receives the current progress and the previous progress as its arguments. The progress is indicated as a value between `0` and `1`, where 0 means start and 1 means finished.
134
134
 
package/index.d.ts CHANGED
@@ -18,7 +18,7 @@
18
18
  // blits file type reference
19
19
  /// <reference path="./blits.d.ts" />
20
20
 
21
- import {type ShaderEffect as RendererShaderEffect, type WebGlCoreShader} from '@lightningjs/renderer'
21
+ import {type ShaderEffect as RendererShaderEffect, type WebGlCoreShader, type RendererMainSettings} from '@lightningjs/renderer'
22
22
 
23
23
  declare module '@lightningjs/blits' {
24
24
 
@@ -824,13 +824,13 @@ declare module '@lightningjs/blits' {
824
824
  *
825
825
  * @default `0.8`
826
826
  */
827
- target?: 0.8,
827
+ target?: number,
828
828
  /**
829
829
  * Interval at which regular texture cleanups occur (in `ms`)
830
830
  *
831
831
  * @default `5000`
832
832
  */
833
- cleanupInterval?: 5000,
833
+ cleanupInterval?: number,
834
834
  /**
835
835
  * Baseline GPU memory usage of the App (in `mb`), without rendering any
836
836
  * textures. This value will be used as a basis when calculating
@@ -839,7 +839,7 @@ declare module '@lightningjs/blits' {
839
839
  *
840
840
  * @default `25`
841
841
  */
842
- baseline?: 25,
842
+ baseline?: number,
843
843
  /**
844
844
  * Whether or not the max threshold should be considered
845
845
  * as a strict number that can not be exceeded in any way
@@ -850,7 +850,7 @@ declare module '@lightningjs/blits' {
850
850
  *
851
851
  * @default false
852
852
  */
853
- strict?: false,
853
+ strict?: boolean,
854
854
  },
855
855
  /**
856
856
  * Defines which mode the renderer should operate in: `webgl` or `canvas`
@@ -886,7 +886,14 @@ declare module '@lightningjs/blits' {
886
886
  *
887
887
  * Defaults to `10`
888
888
  */
889
- textureProcessingTimeLimit?: number
889
+ textureProcessingTimeLimit?: number,
890
+ /**
891
+ * Advanced renderer settings to override Blits launch settings, or configure
892
+ * settings that are not officially exposed in Blits yet
893
+ *
894
+ * @important if you dont know what you're doing here, you probably shouldn't be doing it!
895
+ */
896
+ advanced?: Partial<RendererMainSettings>
890
897
  }
891
898
 
892
899
  interface State {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "1.21.1",
3
+ "version": "1.22.0",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.js",
6
6
  "exports": {
@@ -66,28 +66,32 @@ const textureMemorySettings = (settings) => {
66
66
  export default (App, target, settings = {}) => {
67
67
  renderer = new RendererMain(
68
68
  {
69
- appWidth: settings.w || 1920,
70
- appHeight: settings.h || 1080,
71
- fpsUpdateInterval: settings.fpsInterval || 1000,
72
- devicePhysicalPixelRatio:
73
- RENDER_QUALITIES[settings.renderQuality] || settings.renderQuality || 1,
74
- deviceLogicalPixelRatio:
75
- settings.pixelRatio ||
76
- SCREEN_RESOLUTIONS[settings.screenResolution] ||
77
- SCREEN_RESOLUTIONS[window.innerHeight] ||
78
- 1,
79
- numImageWorkers:
80
- 'webWorkersLimit' in settings
81
- ? settings.webWorkersLimit
82
- : window.navigator.hardwareConcurrency || 2,
83
- clearColor: (settings.canvasColor && colors.normalize(settings.canvasColor)) || 0x00000000,
84
- inspector: settings.inspector === true ? Inspector : undefined,
85
- boundsMargin: settings.viewportMargin || 0,
86
- renderEngine: renderEngine(settings),
87
- fontEngines: textRenderEngines(settings),
88
- canvas: settings.canvas,
89
- textureProcessingTimeLimit: settings.textureProcessingTimeLimit,
90
- textureMemory: textureMemorySettings(settings),
69
+ ...{
70
+ appWidth: settings.w || 1920,
71
+ appHeight: settings.h || 1080,
72
+ fpsUpdateInterval: settings.fpsInterval || 1000,
73
+ devicePhysicalPixelRatio:
74
+ RENDER_QUALITIES[settings.renderQuality] || settings.renderQuality || 1,
75
+ deviceLogicalPixelRatio:
76
+ settings.pixelRatio ||
77
+ SCREEN_RESOLUTIONS[settings.screenResolution] ||
78
+ SCREEN_RESOLUTIONS[window.innerHeight] ||
79
+ 1,
80
+ numImageWorkers:
81
+ 'webWorkersLimit' in settings
82
+ ? settings.webWorkersLimit
83
+ : window.navigator.hardwareConcurrency || 2,
84
+ clearColor: (settings.canvasColor && colors.normalize(settings.canvasColor)) || 0x00000000,
85
+ inspector: settings.inspector === true ? Inspector : undefined,
86
+ boundsMargin: settings.viewportMargin || 0,
87
+ renderEngine: renderEngine(settings),
88
+ fontEngines: textRenderEngines(settings),
89
+ canvas: settings.canvas,
90
+ textureProcessingTimeLimit: settings.textureProcessingTimeLimit,
91
+ textureMemory: textureMemorySettings(settings),
92
+ createImageBitmapSupport: 'auto',
93
+ },
94
+ ...(settings.advanced || {}),
91
95
  },
92
96
  target
93
97
  )