@playcanvas/web-components 0.12.0 → 0.13.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.
Files changed (95) hide show
  1. package/README.md +1 -1
  2. package/dist/app.d.cts +281 -0
  3. package/dist/app.d.ts +61 -3
  4. package/dist/asset.d.cts +224 -0
  5. package/dist/asset.d.ts +8 -2
  6. package/dist/async-element.d.cts +103 -0
  7. package/dist/async-element.d.ts +6 -4
  8. package/dist/colors.d.cts +1 -0
  9. package/dist/components/button-component.d.cts +186 -0
  10. package/dist/components/button-component.d.ts +1 -1
  11. package/dist/components/camera-component.d.cts +253 -0
  12. package/dist/components/camera-component.d.ts +1 -1
  13. package/dist/components/collision-component.d.cts +73 -0
  14. package/dist/components/collision-component.d.ts +1 -1
  15. package/dist/components/component.d.cts +82 -0
  16. package/dist/components/component.d.ts +1 -1
  17. package/dist/components/element-component.d.cts +316 -0
  18. package/dist/components/element-component.d.ts +1 -1
  19. package/dist/components/gsplat-component.d.cts +108 -0
  20. package/dist/components/gsplat-component.d.ts +1 -1
  21. package/dist/components/layoutchild-component.d.cts +110 -0
  22. package/dist/components/layoutchild-component.d.ts +1 -1
  23. package/dist/components/layoutgroup-component.d.cts +136 -0
  24. package/dist/components/layoutgroup-component.d.ts +1 -1
  25. package/dist/components/light-component.d.cts +264 -0
  26. package/dist/components/light-component.d.ts +1 -1
  27. package/dist/components/listener-component.d.cts +20 -0
  28. package/dist/components/listener-component.d.ts +1 -1
  29. package/dist/components/particlesystem-component.d.cts +52 -0
  30. package/dist/components/particlesystem-component.d.ts +1 -1
  31. package/dist/components/render-component.d.cts +76 -0
  32. package/dist/components/render-component.d.ts +1 -1
  33. package/dist/components/rigidbody-component.d.cts +88 -0
  34. package/dist/components/rigidbody-component.d.ts +1 -1
  35. package/dist/components/screen-component.d.cts +70 -0
  36. package/dist/components/screen-component.d.ts +1 -1
  37. package/dist/components/script-component.d.cts +163 -0
  38. package/dist/components/script-component.d.ts +1 -1
  39. package/dist/components/script.d.cts +94 -0
  40. package/dist/components/script.d.ts +1 -1
  41. package/dist/components/scrollbar-component.d.cts +69 -0
  42. package/dist/components/scrollbar-component.d.ts +1 -1
  43. package/dist/components/scrollview-component.d.cts +178 -0
  44. package/dist/components/scrollview-component.d.ts +1 -1
  45. package/dist/components/sound-component.d.cts +108 -0
  46. package/dist/components/sound-component.d.ts +1 -1
  47. package/dist/components/sound-slot.d.cts +134 -0
  48. package/dist/components/sound-slot.d.ts +2 -2
  49. package/dist/custom-elements.json +80 -22
  50. package/dist/entity-base.d.cts +67 -0
  51. package/dist/entity-base.d.ts +2 -2
  52. package/dist/entity.d.cts +131 -0
  53. package/dist/entity.d.ts +1 -1
  54. package/dist/index.d.cts +79 -0
  55. package/dist/index.d.ts +33 -33
  56. package/dist/loading-bar.d.cts +35 -0
  57. package/dist/material.d.cts +1011 -0
  58. package/dist/model.d.cts +72 -0
  59. package/dist/model.d.ts +1 -1
  60. package/dist/module.d.cts +29 -0
  61. package/dist/module.d.ts +16 -10
  62. package/dist/node.d.cts +253 -0
  63. package/dist/node.d.ts +1 -1
  64. package/dist/parse.d.cts +147 -0
  65. package/dist/pwc.cjs +285 -92
  66. package/dist/pwc.cjs.map +1 -1
  67. package/dist/pwc.js +286 -93
  68. package/dist/pwc.js.map +1 -1
  69. package/dist/pwc.min.js +1 -1
  70. package/dist/pwc.min.js.map +1 -1
  71. package/dist/pwc.min.mjs +1 -1
  72. package/dist/pwc.min.mjs.map +1 -1
  73. package/dist/pwc.mjs +286 -93
  74. package/dist/pwc.mjs.map +1 -1
  75. package/dist/scene.d.cts +117 -0
  76. package/dist/scene.d.ts +1 -1
  77. package/dist/sky.d.cts +121 -0
  78. package/dist/sky.d.ts +1 -1
  79. package/dist/vscode.html-custom-data.json +3 -3
  80. package/dist/web-types.json +42 -6
  81. package/package.json +16 -7
  82. package/src/app.ts +211 -49
  83. package/src/asset.ts +34 -2
  84. package/src/async-element.ts +4 -2
  85. package/src/components/button-component.ts +7 -7
  86. package/src/components/element-component.ts +7 -7
  87. package/src/components/gsplat-component.ts +3 -3
  88. package/src/components/particlesystem-component.ts +7 -8
  89. package/src/components/script-component.ts +2 -2
  90. package/src/components/sound-slot.ts +2 -2
  91. package/src/loading-bar.ts +2 -2
  92. package/src/material.ts +2 -2
  93. package/src/model.ts +2 -5
  94. package/src/module.ts +39 -20
  95. package/src/sky.ts +2 -3
@@ -0,0 +1,1011 @@
1
+ import { Color, StandardMaterial, Vec2 } from 'playcanvas';
2
+ type BlendType = 'none' | 'normal' | 'additive' | 'additive-alpha' | 'premultiplied' | 'multiplicative' | 'multiplicative-2x' | 'screen' | 'min' | 'max' | 'subtractive';
3
+ type CullMode = 'none' | 'back' | 'front' | 'front-and-back';
4
+ type FresnelModel = 'none' | 'schlick';
5
+ type OccludeSpecular = 'none' | 'ao' | 'gloss-dependent';
6
+ type OpacityDither = 'none' | 'bayer8' | 'bluenoise' | 'ignnoise';
7
+ type ColorChannel = 'r' | 'g' | 'b' | 'a' | 'rgb';
8
+ type ScalarChannel = 'r' | 'g' | 'b' | 'a';
9
+ /**
10
+ * The MaterialElement interface provides properties and methods for manipulating
11
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-material/ | `<pc-material>`} elements.
12
+ * The MaterialElement interface also inherits the properties and methods of the
13
+ * {@link HTMLElement} interface.
14
+ *
15
+ * A `pc-material` must be a direct child of `pc-app` — elements placed elsewhere log a warning
16
+ * and never create a material. Elements inserted while the application is already running are
17
+ * created on insertion.
18
+ *
19
+ * The element is metal/rough by default: unlike a bare `StandardMaterial` it enables the metalness
20
+ * workflow, which is what the `metalness-*` attributes assume and what glTF means by PBR. It also
21
+ * defaults `metalness` to 0 rather than the engine's 1, because those two defaults have to be
22
+ * chosen together - the engine's 1 is unreachable under its own `useMetalness` of false, and with
23
+ * the workflow on it would make every material fully metallic, so `<pc-material diffuse="crimson">`
24
+ * would render as dark tinted reflections of an environment that may not exist rather than as a
25
+ * crimson surface. `metalness="1"` remains one attribute away.
26
+ *
27
+ * The `roughness` and `roughness-map` attributes are aliases for `gloss` and `gloss-map` that
28
+ * additionally invert the gloss channel; do not mix the two families on one element.
29
+ *
30
+ * The two aliases are documented here rather than on an accessor, because they resolve to the
31
+ * `gloss` properties and would otherwise inherit gloss's description - which reads inverted.
32
+ *
33
+ * @attribute {number} roughness - The roughness of the material, from 0 (shiny) to 1 (rough). An
34
+ * alias for `gloss` that also inverts it, so do not combine it with the `gloss` attributes.
35
+ * @attribute {string} roughness-map - The id of the `pc-asset` to use as the roughness map. An
36
+ * alias for `gloss-map` that also inverts the gloss channel, so do not combine it with the `gloss`
37
+ * attributes.
38
+ */
39
+ declare class MaterialElement extends HTMLElement {
40
+ private _alphaTest;
41
+ private _alphaToCoverage;
42
+ private _aoIntensity;
43
+ private _aoMap;
44
+ private _aoMapChannel;
45
+ private _aoMapOffset;
46
+ private _aoMapRotation;
47
+ private _aoMapTiling;
48
+ private _aoMapUv;
49
+ private _blendType;
50
+ private _bumpiness;
51
+ private _cull;
52
+ private _depthBias;
53
+ private _depthTest;
54
+ private _depthWrite;
55
+ private _diffuse;
56
+ private _diffuseMap;
57
+ private _diffuseMapChannel;
58
+ private _diffuseMapOffset;
59
+ private _diffuseMapRotation;
60
+ private _diffuseMapTiling;
61
+ private _diffuseMapUv;
62
+ private _emissive;
63
+ private _emissiveIntensity;
64
+ private _emissiveMap;
65
+ private _emissiveMapChannel;
66
+ private _emissiveMapOffset;
67
+ private _emissiveMapRotation;
68
+ private _emissiveMapTiling;
69
+ private _emissiveMapUv;
70
+ private _enableGGXSpecular;
71
+ private _fresnelModel;
72
+ private _gloss;
73
+ private _glossInvert;
74
+ private _glossMap;
75
+ private _glossMapChannel;
76
+ private _glossMapOffset;
77
+ private _glossMapRotation;
78
+ private _glossMapTiling;
79
+ private _glossMapUv;
80
+ private _heightMap;
81
+ private _heightMapChannel;
82
+ private _heightMapFactor;
83
+ private _heightMapOffset;
84
+ private _heightMapRotation;
85
+ private _heightMapTiling;
86
+ private _heightMapUv;
87
+ private _metalness;
88
+ private _metalnessMap;
89
+ private _metalnessMapChannel;
90
+ private _metalnessMapOffset;
91
+ private _metalnessMapRotation;
92
+ private _metalnessMapTiling;
93
+ private _metalnessMapUv;
94
+ private _normalMap;
95
+ private _normalMapOffset;
96
+ private _normalMapRotation;
97
+ private _normalMapTiling;
98
+ private _normalMapUv;
99
+ private _occludeDirect;
100
+ private _occludeSpecular;
101
+ private _opacity;
102
+ private _opacityDither;
103
+ private _opacityFadesSpecular;
104
+ private _opacityMap;
105
+ private _opacityMapChannel;
106
+ private _opacityMapOffset;
107
+ private _opacityMapRotation;
108
+ private _opacityMapTiling;
109
+ private _opacityMapUv;
110
+ private _slopeDepthBias;
111
+ private _specular;
112
+ private _specularityFactor;
113
+ private _twoSidedLighting;
114
+ private _useFog;
115
+ private _useLighting;
116
+ private _useMetalness;
117
+ private _useMetalnessSpecularColor;
118
+ private _useSkybox;
119
+ private _useTonemap;
120
+ /**
121
+ * Pending `load` handlers, one per texture slot. A slot's handler is torn down when the slot is
122
+ * reassigned or the element disconnects, so a late-arriving asset can never write a texture the
123
+ * element no longer wants.
124
+ */
125
+ private _mapHandles;
126
+ private _updateScheduled;
127
+ private _glossConflictWarned;
128
+ /**
129
+ * The material. `null` until the containing application has created it — an element present
130
+ * at startup has its material once the application is ready.
131
+ */
132
+ material: StandardMaterial | null;
133
+ connectedCallback(): Promise<void>;
134
+ disconnectedCallback(): void;
135
+ /**
136
+ * Coalesces `material.update()` across a burst of attribute or property writes, so that setting
137
+ * a dozen attributes in one parse costs one update rather than a dozen.
138
+ */
139
+ private _scheduleUpdate;
140
+ /**
141
+ * Warns when a `roughness-*` attribute is combined with one that carries the opposite
142
+ * interpretation of the same value. They write the same engine properties but disagree about
143
+ * whether the channel is inverted, so the result would depend on attribute order rather than
144
+ * on intent.
145
+ *
146
+ * Called from both families rather than only from the roughness branches, because the two
147
+ * orderings are equally wrong and only one of them would otherwise be caught. The conflict is
148
+ * a property of the element rather than of any one write - and an upgrading element already
149
+ * has all of its attributes, so every branch would otherwise report the same clash - so the
150
+ * warning latches and reports once per episode, clearing when the clash is resolved.
151
+ */
152
+ private _warnGlossConflict;
153
+ /**
154
+ * Points a texture slot at the resource of a `pc-asset`, waiting for the asset to load when it
155
+ * has not already. An empty id clears the slot.
156
+ *
157
+ * @param id - The id of the `pc-asset`, or an empty string to clear the slot.
158
+ * @param slot - The material property to write.
159
+ */
160
+ private _setMap;
161
+ /**
162
+ * @param slot - The material property to write.
163
+ * @param texture - The loaded texture, applied with its sampler state untouched - anisotropy
164
+ * and friends belong to the `pc-asset`'s texture options.
165
+ */
166
+ private _applyMap;
167
+ /**
168
+ * Sets the alpha test reference value. Fragments with an opacity below this value are discarded.
169
+ * @param value - The alpha test reference value.
170
+ */
171
+ set alphaTest(value: number);
172
+ /**
173
+ * Gets the alpha test reference value.
174
+ * @returns The alpha test reference value.
175
+ */
176
+ get alphaTest(): number;
177
+ /**
178
+ * Sets whether to use alpha to coverage, which resolves transparency using multisampling.
179
+ * @param value - The alpha to coverage flag.
180
+ */
181
+ set alphaToCoverage(value: boolean);
182
+ /**
183
+ * Gets whether to use alpha to coverage.
184
+ * @returns The alpha to coverage flag.
185
+ */
186
+ get alphaToCoverage(): boolean;
187
+ /**
188
+ * Sets the strength of the ambient occlusion map, from 0 to 1.
189
+ * @param value - The ambient occlusion intensity.
190
+ */
191
+ set aoIntensity(value: number);
192
+ /**
193
+ * Gets the strength of the ambient occlusion map.
194
+ * @returns The ambient occlusion intensity.
195
+ */
196
+ get aoIntensity(): number;
197
+ /**
198
+ * Sets the id of the `pc-asset` to use as the ambient occlusion map.
199
+ * @param value - The asset id.
200
+ */
201
+ set aoMap(value: string);
202
+ /**
203
+ * Gets the id of the `pc-asset` used as the ambient occlusion map.
204
+ * @returns The asset id.
205
+ */
206
+ get aoMap(): string;
207
+ /**
208
+ * Sets the color channel of the ambient occlusion map to sample.
209
+ * @param value - The channel.
210
+ */
211
+ set aoMapChannel(value: ScalarChannel);
212
+ /**
213
+ * Gets the color channel of the ambient occlusion map to sample.
214
+ * @returns The channel.
215
+ */
216
+ get aoMapChannel(): ScalarChannel;
217
+ /**
218
+ * Sets the 2D offset of the ambient occlusion map.
219
+ * @param value - The offset.
220
+ */
221
+ set aoMapOffset(value: Vec2);
222
+ /**
223
+ * Gets the 2D offset of the ambient occlusion map.
224
+ * @returns The offset.
225
+ */
226
+ get aoMapOffset(): Vec2;
227
+ /**
228
+ * Sets the 2D rotation of the ambient occlusion map, in degrees.
229
+ * @param value - The rotation.
230
+ */
231
+ set aoMapRotation(value: number);
232
+ /**
233
+ * Gets the 2D rotation of the ambient occlusion map.
234
+ * @returns The rotation.
235
+ */
236
+ get aoMapRotation(): number;
237
+ /**
238
+ * Sets the 2D tiling of the ambient occlusion map.
239
+ * @param value - The tiling.
240
+ */
241
+ set aoMapTiling(value: Vec2);
242
+ /**
243
+ * Gets the 2D tiling of the ambient occlusion map.
244
+ * @returns The tiling.
245
+ */
246
+ get aoMapTiling(): Vec2;
247
+ /**
248
+ * Sets the UV channel the ambient occlusion map samples.
249
+ * @param value - The UV channel.
250
+ */
251
+ set aoMapUv(value: number);
252
+ /**
253
+ * Gets the UV channel the ambient occlusion map samples.
254
+ * @returns The UV channel.
255
+ */
256
+ get aoMapUv(): number;
257
+ /**
258
+ * Sets how the material is blended with the scene behind it.
259
+ * @param value - The blend type.
260
+ */
261
+ set blendType(value: BlendType);
262
+ /**
263
+ * Gets how the material is blended with the scene behind it.
264
+ * @returns The blend type.
265
+ */
266
+ get blendType(): BlendType;
267
+ /**
268
+ * Sets the strength of the normal map, where 0 is flat and 1 is the map's full effect.
269
+ * @param value - The bumpiness.
270
+ */
271
+ set bumpiness(value: number);
272
+ /**
273
+ * Gets the strength of the normal map.
274
+ * @returns The bumpiness.
275
+ */
276
+ get bumpiness(): number;
277
+ /**
278
+ * Sets which faces of a mesh are culled.
279
+ * @param value - The cull mode.
280
+ */
281
+ set cull(value: CullMode);
282
+ /**
283
+ * Gets which faces of a mesh are culled.
284
+ * @returns The cull mode.
285
+ */
286
+ get cull(): CullMode;
287
+ /**
288
+ * Sets the offset applied to the depth of a fragment, used to resolve z-fighting.
289
+ * @param value - The depth bias.
290
+ */
291
+ set depthBias(value: number);
292
+ /**
293
+ * Gets the offset applied to the depth of a fragment.
294
+ * @returns The depth bias.
295
+ */
296
+ get depthBias(): number;
297
+ /**
298
+ * Sets whether fragments are tested against the depth buffer.
299
+ * @param value - The depth test flag.
300
+ */
301
+ set depthTest(value: boolean);
302
+ /**
303
+ * Gets whether fragments are tested against the depth buffer.
304
+ * @returns The depth test flag.
305
+ */
306
+ get depthTest(): boolean;
307
+ /**
308
+ * Sets whether fragments write to the depth buffer.
309
+ * @param value - The depth write flag.
310
+ */
311
+ set depthWrite(value: boolean);
312
+ /**
313
+ * Gets whether fragments write to the depth buffer.
314
+ * @returns The depth write flag.
315
+ */
316
+ get depthWrite(): boolean;
317
+ /**
318
+ * Sets the diffuse color of the material. With the metalness workflow this doubles as the
319
+ * specular color where the surface is metallic.
320
+ * @param value - The diffuse color.
321
+ */
322
+ set diffuse(value: Color);
323
+ /**
324
+ * Gets the diffuse color of the material.
325
+ * @returns The diffuse color.
326
+ */
327
+ get diffuse(): Color;
328
+ /**
329
+ * Sets the id of the `pc-asset` to use as the diffuse map.
330
+ * @param value - The asset id.
331
+ */
332
+ set diffuseMap(value: string);
333
+ /**
334
+ * Gets the id of the `pc-asset` used as the diffuse map.
335
+ * @returns The asset id.
336
+ */
337
+ get diffuseMap(): string;
338
+ /**
339
+ * Sets the color channels of the diffuse map to sample.
340
+ * @param value - The channels.
341
+ */
342
+ set diffuseMapChannel(value: ColorChannel);
343
+ /**
344
+ * Gets the color channels of the diffuse map to sample.
345
+ * @returns The channels.
346
+ */
347
+ get diffuseMapChannel(): ColorChannel;
348
+ /**
349
+ * Sets the 2D offset of the diffuse map.
350
+ * @param value - The offset.
351
+ */
352
+ set diffuseMapOffset(value: Vec2);
353
+ /**
354
+ * Gets the 2D offset of the diffuse map.
355
+ * @returns The offset.
356
+ */
357
+ get diffuseMapOffset(): Vec2;
358
+ /**
359
+ * Sets the 2D rotation of the diffuse map, in degrees.
360
+ * @param value - The rotation.
361
+ */
362
+ set diffuseMapRotation(value: number);
363
+ /**
364
+ * Gets the 2D rotation of the diffuse map.
365
+ * @returns The rotation.
366
+ */
367
+ get diffuseMapRotation(): number;
368
+ /**
369
+ * Sets the 2D tiling of the diffuse map.
370
+ * @param value - The tiling.
371
+ */
372
+ set diffuseMapTiling(value: Vec2);
373
+ /**
374
+ * Gets the 2D tiling of the diffuse map.
375
+ * @returns The tiling.
376
+ */
377
+ get diffuseMapTiling(): Vec2;
378
+ /**
379
+ * Sets the UV channel the diffuse map samples.
380
+ * @param value - The UV channel.
381
+ */
382
+ set diffuseMapUv(value: number);
383
+ /**
384
+ * Gets the UV channel the diffuse map samples.
385
+ * @returns The UV channel.
386
+ */
387
+ get diffuseMapUv(): number;
388
+ /**
389
+ * Sets the emissive color of the material, which is added to the lit result.
390
+ * @param value - The emissive color.
391
+ */
392
+ set emissive(value: Color);
393
+ /**
394
+ * Gets the emissive color of the material.
395
+ * @returns The emissive color.
396
+ */
397
+ get emissive(): Color;
398
+ /**
399
+ * Sets the multiplier applied to the emissive color and map.
400
+ * @param value - The emissive intensity.
401
+ */
402
+ set emissiveIntensity(value: number);
403
+ /**
404
+ * Gets the multiplier applied to the emissive color and map.
405
+ * @returns The emissive intensity.
406
+ */
407
+ get emissiveIntensity(): number;
408
+ /**
409
+ * Sets the id of the `pc-asset` to use as the emissive map.
410
+ * @param value - The asset id.
411
+ */
412
+ set emissiveMap(value: string);
413
+ /**
414
+ * Gets the id of the `pc-asset` used as the emissive map.
415
+ * @returns The asset id.
416
+ */
417
+ get emissiveMap(): string;
418
+ /**
419
+ * Sets the color channels of the emissive map to sample.
420
+ * @param value - The channels.
421
+ */
422
+ set emissiveMapChannel(value: ColorChannel);
423
+ /**
424
+ * Gets the color channels of the emissive map to sample.
425
+ * @returns The channels.
426
+ */
427
+ get emissiveMapChannel(): ColorChannel;
428
+ /**
429
+ * Sets the 2D offset of the emissive map.
430
+ * @param value - The offset.
431
+ */
432
+ set emissiveMapOffset(value: Vec2);
433
+ /**
434
+ * Gets the 2D offset of the emissive map.
435
+ * @returns The offset.
436
+ */
437
+ get emissiveMapOffset(): Vec2;
438
+ /**
439
+ * Sets the 2D rotation of the emissive map, in degrees.
440
+ * @param value - The rotation.
441
+ */
442
+ set emissiveMapRotation(value: number);
443
+ /**
444
+ * Gets the 2D rotation of the emissive map.
445
+ * @returns The rotation.
446
+ */
447
+ get emissiveMapRotation(): number;
448
+ /**
449
+ * Sets the 2D tiling of the emissive map.
450
+ * @param value - The tiling.
451
+ */
452
+ set emissiveMapTiling(value: Vec2);
453
+ /**
454
+ * Gets the 2D tiling of the emissive map.
455
+ * @returns The tiling.
456
+ */
457
+ get emissiveMapTiling(): Vec2;
458
+ /**
459
+ * Sets the UV channel the emissive map samples.
460
+ * @param value - The UV channel.
461
+ */
462
+ set emissiveMapUv(value: number);
463
+ /**
464
+ * Gets the UV channel the emissive map samples.
465
+ * @returns The UV channel.
466
+ */
467
+ get emissiveMapUv(): number;
468
+ /**
469
+ * Sets whether to use the GGX specular model, which supports anisotropy.
470
+ * @param value - The GGX specular flag.
471
+ */
472
+ set enableGGXSpecular(value: boolean);
473
+ /**
474
+ * Gets whether to use the GGX specular model.
475
+ * @returns The GGX specular flag.
476
+ */
477
+ get enableGGXSpecular(): boolean;
478
+ /**
479
+ * Sets the Fresnel model used for specular reflections at grazing angles.
480
+ * @param value - The Fresnel model.
481
+ */
482
+ set fresnelModel(value: FresnelModel);
483
+ /**
484
+ * Gets the Fresnel model used for specular reflections at grazing angles.
485
+ * @returns The Fresnel model.
486
+ */
487
+ get fresnelModel(): FresnelModel;
488
+ /**
489
+ * Sets the glossiness of the material, from 0 (rough) to 1 (shiny). See also `roughness`.
490
+ * @param value - The gloss.
491
+ */
492
+ set gloss(value: number);
493
+ /**
494
+ * Gets the glossiness of the material.
495
+ * @returns The gloss.
496
+ */
497
+ get gloss(): number;
498
+ /**
499
+ * Sets whether the gloss value and map are inverted, which makes the material treat them as
500
+ * roughness. Setting `roughness` or `roughness-map` enables this automatically.
501
+ * @param value - The gloss invert flag.
502
+ */
503
+ set glossInvert(value: boolean);
504
+ /**
505
+ * Gets whether the gloss value and map are inverted.
506
+ * @returns The gloss invert flag.
507
+ */
508
+ get glossInvert(): boolean;
509
+ /**
510
+ * Sets the id of the `pc-asset` to use as the gloss map. See also `roughnessMap`.
511
+ * @param value - The asset id.
512
+ */
513
+ set glossMap(value: string);
514
+ /**
515
+ * Gets the id of the `pc-asset` used as the gloss map.
516
+ * @returns The asset id.
517
+ */
518
+ get glossMap(): string;
519
+ /**
520
+ * Sets the color channel of the gloss map to sample.
521
+ * @param value - The channel.
522
+ */
523
+ set glossMapChannel(value: ScalarChannel);
524
+ /**
525
+ * Gets the color channel of the gloss map to sample.
526
+ * @returns The channel.
527
+ */
528
+ get glossMapChannel(): ScalarChannel;
529
+ /**
530
+ * Sets the 2D offset of the gloss map.
531
+ * @param value - The offset.
532
+ */
533
+ set glossMapOffset(value: Vec2);
534
+ /**
535
+ * Gets the 2D offset of the gloss map.
536
+ * @returns The offset.
537
+ */
538
+ get glossMapOffset(): Vec2;
539
+ /**
540
+ * Sets the 2D rotation of the gloss map, in degrees.
541
+ * @param value - The rotation.
542
+ */
543
+ set glossMapRotation(value: number);
544
+ /**
545
+ * Gets the 2D rotation of the gloss map.
546
+ * @returns The rotation.
547
+ */
548
+ get glossMapRotation(): number;
549
+ /**
550
+ * Sets the 2D tiling of the gloss map.
551
+ * @param value - The tiling.
552
+ */
553
+ set glossMapTiling(value: Vec2);
554
+ /**
555
+ * Gets the 2D tiling of the gloss map.
556
+ * @returns The tiling.
557
+ */
558
+ get glossMapTiling(): Vec2;
559
+ /**
560
+ * Sets the UV channel the gloss map samples.
561
+ * @param value - The UV channel.
562
+ */
563
+ set glossMapUv(value: number);
564
+ /**
565
+ * Gets the UV channel the gloss map samples.
566
+ * @returns The UV channel.
567
+ */
568
+ get glossMapUv(): number;
569
+ /**
570
+ * Sets the id of the `pc-asset` to use as the height map, which drives parallax mapping.
571
+ * @param value - The asset id.
572
+ */
573
+ set heightMap(value: string);
574
+ /**
575
+ * Gets the id of the `pc-asset` used as the height map.
576
+ * @returns The asset id.
577
+ */
578
+ get heightMap(): string;
579
+ /**
580
+ * Sets the color channel of the height map to sample.
581
+ * @param value - The channel.
582
+ */
583
+ set heightMapChannel(value: ScalarChannel);
584
+ /**
585
+ * Gets the color channel of the height map to sample.
586
+ * @returns The channel.
587
+ */
588
+ get heightMapChannel(): ScalarChannel;
589
+ /**
590
+ * Sets the strength of the parallax effect driven by the height map.
591
+ * @param value - The height map factor.
592
+ */
593
+ set heightMapFactor(value: number);
594
+ /**
595
+ * Gets the strength of the parallax effect driven by the height map.
596
+ * @returns The height map factor.
597
+ */
598
+ get heightMapFactor(): number;
599
+ /**
600
+ * Sets the 2D offset of the height map.
601
+ * @param value - The offset.
602
+ */
603
+ set heightMapOffset(value: Vec2);
604
+ /**
605
+ * Gets the 2D offset of the height map.
606
+ * @returns The offset.
607
+ */
608
+ get heightMapOffset(): Vec2;
609
+ /**
610
+ * Sets the 2D rotation of the height map, in degrees.
611
+ * @param value - The rotation.
612
+ */
613
+ set heightMapRotation(value: number);
614
+ /**
615
+ * Gets the 2D rotation of the height map.
616
+ * @returns The rotation.
617
+ */
618
+ get heightMapRotation(): number;
619
+ /**
620
+ * Sets the 2D tiling of the height map.
621
+ * @param value - The tiling.
622
+ */
623
+ set heightMapTiling(value: Vec2);
624
+ /**
625
+ * Gets the 2D tiling of the height map.
626
+ * @returns The tiling.
627
+ */
628
+ get heightMapTiling(): Vec2;
629
+ /**
630
+ * Sets the UV channel the height map samples.
631
+ * @param value - The UV channel.
632
+ */
633
+ set heightMapUv(value: number);
634
+ /**
635
+ * Gets the UV channel the height map samples.
636
+ * @returns The UV channel.
637
+ */
638
+ get heightMapUv(): number;
639
+ /**
640
+ * Sets how metallic the surface is, from 0 (dielectric) to 1 (metal).
641
+ * @param value - The metalness.
642
+ */
643
+ set metalness(value: number);
644
+ /**
645
+ * Gets how metallic the surface is.
646
+ * @returns The metalness.
647
+ */
648
+ get metalness(): number;
649
+ /**
650
+ * Sets the id of the `pc-asset` to use as the metalness map.
651
+ * @param value - The asset id.
652
+ */
653
+ set metalnessMap(value: string);
654
+ /**
655
+ * Gets the id of the `pc-asset` used as the metalness map.
656
+ * @returns The asset id.
657
+ */
658
+ get metalnessMap(): string;
659
+ /**
660
+ * Sets the color channel of the metalness map to sample.
661
+ * @param value - The channel.
662
+ */
663
+ set metalnessMapChannel(value: ScalarChannel);
664
+ /**
665
+ * Gets the color channel of the metalness map to sample.
666
+ * @returns The channel.
667
+ */
668
+ get metalnessMapChannel(): ScalarChannel;
669
+ /**
670
+ * Sets the 2D offset of the metalness map.
671
+ * @param value - The offset.
672
+ */
673
+ set metalnessMapOffset(value: Vec2);
674
+ /**
675
+ * Gets the 2D offset of the metalness map.
676
+ * @returns The offset.
677
+ */
678
+ get metalnessMapOffset(): Vec2;
679
+ /**
680
+ * Sets the 2D rotation of the metalness map, in degrees.
681
+ * @param value - The rotation.
682
+ */
683
+ set metalnessMapRotation(value: number);
684
+ /**
685
+ * Gets the 2D rotation of the metalness map.
686
+ * @returns The rotation.
687
+ */
688
+ get metalnessMapRotation(): number;
689
+ /**
690
+ * Sets the 2D tiling of the metalness map.
691
+ * @param value - The tiling.
692
+ */
693
+ set metalnessMapTiling(value: Vec2);
694
+ /**
695
+ * Gets the 2D tiling of the metalness map.
696
+ * @returns The tiling.
697
+ */
698
+ get metalnessMapTiling(): Vec2;
699
+ /**
700
+ * Sets the UV channel the metalness map samples.
701
+ * @param value - The UV channel.
702
+ */
703
+ set metalnessMapUv(value: number);
704
+ /**
705
+ * Gets the UV channel the metalness map samples.
706
+ * @returns The UV channel.
707
+ */
708
+ get metalnessMapUv(): number;
709
+ /**
710
+ * Sets the id of the `pc-asset` to use as the normal map.
711
+ * @param value - The asset id.
712
+ */
713
+ set normalMap(value: string);
714
+ /**
715
+ * Gets the id of the `pc-asset` used as the normal map.
716
+ * @returns The asset id.
717
+ */
718
+ get normalMap(): string;
719
+ /**
720
+ * Sets the 2D offset of the normal map.
721
+ * @param value - The offset.
722
+ */
723
+ set normalMapOffset(value: Vec2);
724
+ /**
725
+ * Gets the 2D offset of the normal map.
726
+ * @returns The offset.
727
+ */
728
+ get normalMapOffset(): Vec2;
729
+ /**
730
+ * Sets the 2D rotation of the normal map, in degrees.
731
+ * @param value - The rotation.
732
+ */
733
+ set normalMapRotation(value: number);
734
+ /**
735
+ * Gets the 2D rotation of the normal map.
736
+ * @returns The rotation.
737
+ */
738
+ get normalMapRotation(): number;
739
+ /**
740
+ * Sets the 2D tiling of the normal map.
741
+ * @param value - The tiling.
742
+ */
743
+ set normalMapTiling(value: Vec2);
744
+ /**
745
+ * Gets the 2D tiling of the normal map.
746
+ * @returns The tiling.
747
+ */
748
+ get normalMapTiling(): Vec2;
749
+ /**
750
+ * Sets the UV channel the normal map samples.
751
+ * @param value - The UV channel.
752
+ */
753
+ set normalMapUv(value: number);
754
+ /**
755
+ * Gets the UV channel the normal map samples.
756
+ * @returns The UV channel.
757
+ */
758
+ get normalMapUv(): number;
759
+ /**
760
+ * Sets whether ambient occlusion also attenuates direct lighting.
761
+ * @param value - The occlude direct flag.
762
+ */
763
+ set occludeDirect(value: boolean);
764
+ /**
765
+ * Gets whether ambient occlusion also attenuates direct lighting.
766
+ * @returns The occlude direct flag.
767
+ */
768
+ get occludeDirect(): boolean;
769
+ /**
770
+ * Sets how specular reflections are occluded.
771
+ * @param value - The specular occlusion mode.
772
+ */
773
+ set occludeSpecular(value: OccludeSpecular);
774
+ /**
775
+ * Gets how specular reflections are occluded.
776
+ * @returns The specular occlusion mode.
777
+ */
778
+ get occludeSpecular(): OccludeSpecular;
779
+ /**
780
+ * Sets the opacity of the material, from 0 (transparent) to 1 (opaque), which requires a
781
+ * `blend-type` other than `none` to have any visible effect.
782
+ * @param value - The opacity.
783
+ */
784
+ set opacity(value: number);
785
+ /**
786
+ * Gets the opacity of the material, which requires a `blend-type` other than `none` to have
787
+ * any visible effect.
788
+ * @returns The opacity.
789
+ */
790
+ get opacity(): number;
791
+ /**
792
+ * Sets the dithering used to render opacity, which approximates transparency without blending.
793
+ * @param value - The dither mode.
794
+ */
795
+ set opacityDither(value: OpacityDither);
796
+ /**
797
+ * Gets the dithering used to render opacity.
798
+ * @returns The dither mode.
799
+ */
800
+ get opacityDither(): OpacityDither;
801
+ /**
802
+ * Sets whether specular highlights fade out as the material becomes transparent.
803
+ * @param value - The opacity fades specular flag.
804
+ */
805
+ set opacityFadesSpecular(value: boolean);
806
+ /**
807
+ * Gets whether specular highlights fade out as the material becomes transparent.
808
+ * @returns The opacity fades specular flag.
809
+ */
810
+ get opacityFadesSpecular(): boolean;
811
+ /**
812
+ * Sets the id of the `pc-asset` to use as the opacity map.
813
+ * @param value - The asset id.
814
+ */
815
+ set opacityMap(value: string);
816
+ /**
817
+ * Gets the id of the `pc-asset` used as the opacity map.
818
+ * @returns The asset id.
819
+ */
820
+ get opacityMap(): string;
821
+ /**
822
+ * Sets the color channel of the opacity map to sample.
823
+ * @param value - The channel.
824
+ */
825
+ set opacityMapChannel(value: ScalarChannel);
826
+ /**
827
+ * Gets the color channel of the opacity map to sample.
828
+ * @returns The channel.
829
+ */
830
+ get opacityMapChannel(): ScalarChannel;
831
+ /**
832
+ * Sets the 2D offset of the opacity map.
833
+ * @param value - The offset.
834
+ */
835
+ set opacityMapOffset(value: Vec2);
836
+ /**
837
+ * Gets the 2D offset of the opacity map.
838
+ * @returns The offset.
839
+ */
840
+ get opacityMapOffset(): Vec2;
841
+ /**
842
+ * Sets the 2D rotation of the opacity map, in degrees.
843
+ * @param value - The rotation.
844
+ */
845
+ set opacityMapRotation(value: number);
846
+ /**
847
+ * Gets the 2D rotation of the opacity map.
848
+ * @returns The rotation.
849
+ */
850
+ get opacityMapRotation(): number;
851
+ /**
852
+ * Sets the 2D tiling of the opacity map.
853
+ * @param value - The tiling.
854
+ */
855
+ set opacityMapTiling(value: Vec2);
856
+ /**
857
+ * Gets the 2D tiling of the opacity map.
858
+ * @returns The tiling.
859
+ */
860
+ get opacityMapTiling(): Vec2;
861
+ /**
862
+ * Sets the UV channel the opacity map samples.
863
+ * @param value - The UV channel.
864
+ */
865
+ set opacityMapUv(value: number);
866
+ /**
867
+ * Gets the UV channel the opacity map samples.
868
+ * @returns The UV channel.
869
+ */
870
+ get opacityMapUv(): number;
871
+ /**
872
+ * Sets the roughness of the material, from 0 (shiny) to 1 (rough). This is an alias for `gloss`
873
+ * that also inverts the gloss channel, so do not combine it with the `gloss` attributes.
874
+ * @param value - The roughness.
875
+ */
876
+ set roughness(value: number);
877
+ /**
878
+ * Gets the roughness of the material.
879
+ * @returns The roughness.
880
+ */
881
+ get roughness(): number;
882
+ /**
883
+ * Sets the id of the `pc-asset` to use as the roughness map. This is an alias for `glossMap`
884
+ * that also inverts the gloss channel, so do not combine it with the `gloss` attributes.
885
+ * @param value - The asset id.
886
+ */
887
+ set roughnessMap(value: string);
888
+ /**
889
+ * Gets the id of the `pc-asset` used as the roughness map.
890
+ * @returns The asset id.
891
+ */
892
+ get roughnessMap(): string;
893
+ /**
894
+ * Sets the depth offset applied in proportion to a surface's slope, used to resolve z-fighting.
895
+ * @param value - The slope depth bias.
896
+ */
897
+ set slopeDepthBias(value: number);
898
+ /**
899
+ * Gets the depth offset applied in proportion to a surface's slope.
900
+ * @returns The slope depth bias.
901
+ */
902
+ get slopeDepthBias(): number;
903
+ /**
904
+ * Sets the specular color of the material, which applies only when the metalness workflow is
905
+ * disabled or `use-metalness-specular-color` is enabled.
906
+ * @param value - The specular color.
907
+ */
908
+ set specular(value: Color);
909
+ /**
910
+ * Gets the specular color of the material, which applies only when the metalness workflow is
911
+ * disabled or `use-metalness-specular-color` is enabled.
912
+ * @returns The specular color.
913
+ */
914
+ get specular(): Color;
915
+ /**
916
+ * Sets the strength of specular reflections at direct angles, from 0 to 1, which applies only
917
+ * when `use-metalness-specular-color` is enabled.
918
+ * @param value - The specularity factor.
919
+ */
920
+ set specularityFactor(value: number);
921
+ /**
922
+ * Gets the strength of specular reflections at direct angles, which applies only when
923
+ * `use-metalness-specular-color` is enabled.
924
+ * @returns The specularity factor.
925
+ */
926
+ get specularityFactor(): number;
927
+ /**
928
+ * Sets whether back faces are lit as though their normals were flipped.
929
+ * @param value - The two sided lighting flag.
930
+ */
931
+ set twoSidedLighting(value: boolean);
932
+ /**
933
+ * Gets whether back faces are lit as though their normals were flipped.
934
+ * @returns The two sided lighting flag.
935
+ */
936
+ get twoSidedLighting(): boolean;
937
+ /**
938
+ * Sets whether the material is affected by scene fog.
939
+ * @param value - The use fog flag.
940
+ */
941
+ set useFog(value: boolean);
942
+ /**
943
+ * Gets whether the material is affected by scene fog.
944
+ * @returns The use fog flag.
945
+ */
946
+ get useFog(): boolean;
947
+ /**
948
+ * Sets whether the material is affected by scene lights. When disabled the material renders
949
+ * unlit, using the diffuse color and map alone.
950
+ * @param value - The use lighting flag.
951
+ */
952
+ set useLighting(value: boolean);
953
+ /**
954
+ * Gets whether the material is affected by scene lights.
955
+ * @returns The use lighting flag.
956
+ */
957
+ get useLighting(): boolean;
958
+ /**
959
+ * Sets whether to use the metalness workflow rather than the older specular workflow. Unlike a
960
+ * bare `StandardMaterial` this defaults to `true`, because the `metalness-*` attributes have no
961
+ * effect without it.
962
+ * @param value - The use metalness flag.
963
+ */
964
+ set useMetalness(value: boolean);
965
+ /**
966
+ * Gets whether to use the metalness workflow.
967
+ * @returns The use metalness flag.
968
+ */
969
+ get useMetalness(): boolean;
970
+ /**
971
+ * Sets whether the specular color tints reflections while the metalness workflow is in use.
972
+ * @param value - The use metalness specular color flag.
973
+ */
974
+ set useMetalnessSpecularColor(value: boolean);
975
+ /**
976
+ * Gets whether the specular color tints reflections while the metalness workflow is in use.
977
+ * @returns The use metalness specular color flag.
978
+ */
979
+ get useMetalnessSpecularColor(): boolean;
980
+ /**
981
+ * Sets whether the material is lit by the scene's skybox.
982
+ * @param value - The use skybox flag.
983
+ */
984
+ set useSkybox(value: boolean);
985
+ /**
986
+ * Gets whether the material is lit by the scene's skybox.
987
+ * @returns The use skybox flag.
988
+ */
989
+ get useSkybox(): boolean;
990
+ /**
991
+ * Sets whether the camera's tone mapping is applied to the material.
992
+ * @param value - The use tonemap flag.
993
+ */
994
+ set useTonemap(value: boolean);
995
+ /**
996
+ * Gets whether the camera's tone mapping is applied to the material.
997
+ * @returns The use tonemap flag.
998
+ */
999
+ get useTonemap(): boolean;
1000
+ /**
1001
+ * Returns the {@link StandardMaterial} created by the `<pc-material>` element with the given
1002
+ * `id`, or `undefined` if there is no such element or its material has not been created yet.
1003
+ *
1004
+ * @param id - The `id` of the `<pc-material>` element.
1005
+ * @returns The material, or `undefined`.
1006
+ */
1007
+ static get(id: string): StandardMaterial | null | undefined;
1008
+ static get observedAttributes(): string[];
1009
+ attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
1010
+ }
1011
+ export { MaterialElement };