@dreamcomposer/engine-types 0.0.16 → 0.0.17-next.1

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/Layer.d.ts CHANGED
@@ -22,11 +22,15 @@ export interface Layer {
22
22
  */
23
23
  visible?: boolean;
24
24
  /**
25
- * A url that points to the texture of the layer.
26
- *
27
- * Must be in the PNG format.
25
+ * A URL that points to the texture of the layer.
26
+ * For non PNG images the file format must be specified either in the URL itself or via a TexturUrl and TexturUrlCollection object
28
27
  */
29
- textureUrl: string | Blob;
28
+ textureUrl:
29
+ | string
30
+ | TextureUrl
31
+ | CompressedTextureUrlCollection
32
+ | Blob
33
+ | TextureBlob;
30
34
  /**
31
35
  * Whether or not the layer is overprinted with the texture.
32
36
  *
@@ -88,7 +92,7 @@ export interface PatternEmbossingConfiguration {
88
92
  sizePx: [number, number];
89
93
 
90
94
  /**
91
- * PPI of the texture
95
+ * PPI of the textureforcedExtension
92
96
  */
93
97
  ppi: number;
94
98
 
@@ -98,6 +102,73 @@ export interface PatternEmbossingConfiguration {
98
102
  offset?: [number, number];
99
103
  }
100
104
 
105
+ export interface TextureUrl {
106
+ /**
107
+ * The public url of the texture
108
+ */
109
+ url: string;
110
+ /**
111
+ * Define the file extension of the texture.
112
+ * This is only necessary, if the url does not contain the extension itself (e.g. ".png", "-dxt.ktx")
113
+ */
114
+ fileExtension?: string;
115
+ /**
116
+ * Define the texture compression that is stored inside (e.g. "dxt", "etc1", "astc")
117
+ * Currently comporessed textures are only supported inside a .ktx file
118
+ */
119
+ textureCompressionFormat?: string;
120
+ }
121
+ export interface TextureBlob {
122
+ /**
123
+ * The texture itself as an Blob
124
+ */
125
+ blob: Blob;
126
+ /**
127
+ * Define the file extension of the texture (e.g. ".png", ".jpg", ".ktx")
128
+ */
129
+ fileExtension?: string;
130
+ /**
131
+ * Define the texture compression that is stored inside (e.g. "dxt", "etc1", "astc")
132
+ * Currently comporessed textures are only supported inside a .ktx file
133
+ */
134
+ textureCompressionFormat?: string;
135
+ }
136
+
137
+ /**
138
+ * A collection of URLs for a single texture in diffrent compression formats
139
+ */
140
+ export interface CompressedTextureUrlCollection {
141
+ /**
142
+ * The URL, that is used, if the GPU does not support any of the provied compression formats.
143
+ * Must be referencing to a PNG image
144
+ */
145
+ fallbackURL: string;
146
+ /**
147
+ * URL that points to an ASTC compressed textur in a KTX file format
148
+ */
149
+ astcKtxURL?: string;
150
+ /**
151
+ * URL that points to an ATC compressed textur in a KTX file format
152
+ */
153
+ atcKtxURL?: string;
154
+ /**
155
+ * URL that points to an DXT3 or DXT5 compressed textur in a KTX file format
156
+ */
157
+ dxtKtxURL?: string;
158
+ /**
159
+ * URL that points to an ETC-1 compressed textur in a KTX file format
160
+ */
161
+ etc1KtxURL?: string;
162
+ /**
163
+ * URL that points to an ETC-2 compressed textur in a KTX file format
164
+ */
165
+ etc2KtxURL?: string;
166
+ /**
167
+ * URL that points to an PVRTC compressed textur in a KTX file format
168
+ */
169
+ pvrtcKtxURL?: string;
170
+ }
171
+
101
172
  export type TextureOverride<T> = Record<
102
173
  string,
103
174
  Partial<T> | Record<string, Partial<T>>
@@ -1,9 +1,14 @@
1
1
  import { FromEngineMessage } from "../post-messages";
2
2
 
3
+ export interface EngineReadyEvent {
4
+ ready: boolean;
5
+ supportedCompressedTextureFormats: string[];
6
+ }
7
+
3
8
  /**
4
9
  * A message that gets send by the engine when it's ready to receive commands.
5
10
  * You must not send any messages before receiving this message.
6
11
  */
7
12
  export interface EngineReadyMessage extends FromEngineMessage<"engine-ready"> {
8
- payload: boolean;
13
+ payload: EngineReadyEvent;
9
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamcomposer/engine-types",
3
- "version": "0.0.16",
3
+ "version": "0.0.17-next.1",
4
4
  "description": "The type definitions for messages from and to the engine",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -8,7 +8,7 @@
8
8
  "**/*.ts"
9
9
  ],
10
10
  "devDependencies": {
11
- "@babylonjs/core": "5.0.0-alpha.58",
11
+ "@babylonjs/core": "5.8.2",
12
12
  "prettier": "^2.5.1",
13
13
  "typescript": "^4.4.4"
14
14
  },
@@ -4,7 +4,8 @@ import { ToEngineMessage } from "../post-messages";
4
4
  /**
5
5
  * A message to set the mesh skeleton states
6
6
  */
7
- export interface SetSkeletonStatesMessage extends ToEngineMessage<"set-skeleton-states"> {
7
+ export interface SetSkeletonStatesMessage
8
+ extends ToEngineMessage<"set-skeleton-states"> {
8
9
  payload: {
9
10
  /**
10
11
  * The skeleton states. The key is the name of the skeleton from the mesh.