@rings-webgpu/core 1.0.11 → 1.0.12

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.
@@ -2120,7 +2120,7 @@
2120
2120
  }
2121
2121
 
2122
2122
  var __defProp$2 = Object.defineProperty;
2123
- var __decorateClass$j = (decorators, target, key, kind) => {
2123
+ var __decorateClass$m = (decorators, target, key, kind) => {
2124
2124
  var result = void 0 ;
2125
2125
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
2126
2126
  if (decorator = decorators[i])
@@ -2223,10 +2223,10 @@
2223
2223
  return struct.__size;
2224
2224
  }
2225
2225
  };
2226
- __decorateClass$j([
2226
+ __decorateClass$m([
2227
2227
  NonSerialize
2228
2228
  ], _Struct.prototype, "__refection");
2229
- __decorateClass$j([
2229
+ __decorateClass$m([
2230
2230
  NonSerialize
2231
2231
  ], _Struct.prototype, "__size");
2232
2232
  let Struct = _Struct;
@@ -5032,18 +5032,20 @@ fn dir_to_faceId(pt:vec3<f32>) -> i32 {
5032
5032
  }
5033
5033
  }
5034
5034
 
5035
- let VertexAttributes_vert = `
5035
+ let VertexAttributes_vert = (
5036
+ /*wgsl*/
5037
+ `
5036
5038
  var<private> PI: f32 = 3.14159265359;
5037
5039
  #if USE_METAHUMAN
5038
5040
  ${MorphTarget_shader.getMorphTargetShaderBinding(3, 0)}
5039
- ${SkeletonAnimation_shader.groupBindingAndFunctions(3, 2)}
5041
+ ${SkeletonAnimation_shader.groupBindingAndFunctions(3, 2)}
5040
5042
  #else
5041
5043
  #if USE_MORPHTARGETS
5042
5044
  ${MorphTarget_shader.getMorphTargetShaderBinding(3, 0)}
5043
5045
  #endif
5044
5046
 
5045
5047
  #if USE_SKELETON
5046
- ${SkeletonAnimation_shader.groupBindingAndFunctions(3, 0)}
5048
+ ${SkeletonAnimation_shader.groupBindingAndFunctions(3, 0)}
5047
5049
  #endif
5048
5050
  #endif
5049
5051
 
@@ -5078,6 +5080,10 @@ fn dir_to_faceId(pt:vec3<f32>) -> i32 {
5078
5080
  #endif
5079
5081
  #endif
5080
5082
  #else
5083
+ #if USE_TANGENT
5084
+ @location(auto) TANGENT: vec4<f32>,
5085
+ #endif
5086
+
5081
5087
  #if USE_SKELETON
5082
5088
  #if USE_TANGENT
5083
5089
  @location(auto) joints0: vec4<f32>,
@@ -5124,6 +5130,7 @@ fn dir_to_faceId(pt:vec3<f32>) -> i32 {
5124
5130
  #if USE_TANGENT
5125
5131
  @location(auto) varying_Tangent: vec4<f32>,
5126
5132
  #endif
5133
+
5127
5134
 
5128
5135
  @builtin(position) member: vec4<f32>
5129
5136
  };
@@ -5173,23 +5180,24 @@ fn dir_to_faceId(pt:vec3<f32>) -> i32 {
5173
5180
  clipPosition.z = log2Depth(clipPosition.w, globalUniform.near, globalUniform.far);
5174
5181
  #endif
5175
5182
 
5176
- ORI_CameraWorldDir = normalize(ORI_CAMERAMATRIX[3].xyz - worldPos.xyz);
5183
+ ORI_CameraWorldDir = normalize(ORI_CAMERAMATRIX[3].xyz - worldPos.xyz) ;
5177
5184
 
5178
- ORI_VertexOut.index = f32(vertex.index);
5185
+ ORI_VertexOut.index = f32(vertex.index) ;
5179
5186
 
5180
- ORI_VertexOut.varying_UV0 = vertex.uv.xy;
5187
+ ORI_VertexOut.varying_UV0 = vertex.uv.xy ;
5181
5188
 
5182
5189
  ORI_VertexOut.varying_UV1 = vertex.TEXCOORD_1.xy;
5183
5190
 
5184
- ORI_VertexOut.varying_ViewPos = viewPosition;
5185
- ORI_VertexOut.varying_Clip = clipPosition;
5186
- ORI_VertexOut.varying_WPos = worldPos;
5191
+ ORI_VertexOut.varying_ViewPos = viewPosition ;
5192
+ ORI_VertexOut.varying_Clip = clipPosition ;
5193
+ ORI_VertexOut.varying_WPos = worldPos ;
5187
5194
  ORI_VertexOut.varying_WPos.w = f32(vertex.index);
5188
- ORI_VertexOut.varying_WNormal = normalize(ORI_NORMALMATRIX * vertexNormal.xyz);
5195
+ ORI_VertexOut.varying_WNormal = normalize(ORI_NORMALMATRIX * vertexNormal.xyz) ;
5189
5196
 
5190
- ORI_VertexOut.member = clipPosition;
5197
+ ORI_VertexOut.member = clipPosition ;
5191
5198
  }
5192
- `;
5199
+ `
5200
+ );
5193
5201
 
5194
5202
  let VideoUniform_frag = `
5195
5203
  struct MaterialUniform {
@@ -5308,68 +5316,90 @@ var<uniform> materialUniform: MaterialUniform;
5308
5316
  `
5309
5317
  );
5310
5318
 
5311
- let Common_frag = `
5312
- #include "GlobalUniform"
5313
- #include "FragmentVarying"
5314
- #include "FragmentOutput"
5315
- #include "ShadingInput"
5316
- #include "ColorUtil_frag"
5317
- #include "BitUtil"
5318
-
5319
- var<private> ORI_FragmentOutput: FragmentOutput;
5320
- var<private> ORI_VertexVarying: FragmentVarying;
5321
- var<private> ORI_ShadingInput: ShadingInput;
5322
- var<private> viewDir:vec3<f32>;
5323
- var<private> modelIndex:u32;
5319
+ let Common_frag = (
5320
+ /*wgsl*/
5321
+ `
5322
+ #include "GlobalUniform"
5323
+ #include "FragmentVarying"
5324
+ #include "FragmentOutput"
5325
+ #include "ShadingInput"
5326
+ #include "ColorUtil_frag"
5327
+ #include "BitUtil"
5324
5328
 
5325
- @fragment
5326
- fn FragMain( vertex_varying:FragmentVarying ) -> FragmentOutput {
5327
- modelIndex = u32(round(vertex_varying.index));
5328
- ORI_VertexVarying = vertex_varying;
5329
- ORI_VertexVarying.vWorldNormal = normalize(vertex_varying.vWorldNormal);
5329
+ var<private> ORI_FragmentOutput: FragmentOutput;
5330
+ var<private> ORI_VertexVarying: FragmentVarying;
5331
+ var<private> ORI_ShadingInput: ShadingInput;
5332
+ var<private> viewDir:vec3<f32>;
5333
+ var<private> modelIndex:u32;
5334
+
5335
+ @fragment
5336
+ fn FragMain( vertex_varying:FragmentVarying ) -> FragmentOutput {
5330
5337
  ORI_FragmentOutput.color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
5331
- viewDir = normalize(globalUniform.CameraPos.xyz - ORI_VertexVarying.vWorldPos.xyz);
5332
- frag();
5338
+ ORI_VertexVarying = vertex_varying;
5339
+ ORI_VertexVarying.vWorldNormal = normalize(vertex_varying.vWorldNormal);
5340
+ ORI_FragmentOutput.color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
5341
+ viewDir = normalize(globalUniform.CameraPos.xyz - ORI_VertexVarying.vWorldPos.xyz) ;
5333
5342
 
5334
- #if USE_DEBUG
5335
- debugFragmentOut();
5336
- #endif
5343
+ frag();
5344
+
5345
+ #if USE_DEBUG
5346
+ debugFragmentOut();
5347
+ #endif
5337
5348
 
5338
- #if USE_OUTDEPTH
5339
- #if USE_LOGDEPTH
5340
- ORI_FragmentOutput.out_depth = log2DepthFixPersp(ORI_VertexVarying.fragPosition.w, globalUniform.near, globalUniform.far);
5341
- #else
5342
- ORI_FragmentOutput.out_depth = ORI_ShadingInput.FragDepth;
5343
- #endif
5344
- #endif
5349
+ #if USE_DEFAULTFRAGOUT
5350
+ // let finalMatrix = globalUniform.projMat * globalUniform.viewMat ;
5351
+ // let nMat = mat3x3<f32>(finalMatrix[0].xyz,finalMatrix[1].xyz,finalMatrix[2].xyz) ;
5352
+ // let ORI_NORMALMATRIX = transpose(inverse( nMat ));
5353
+ // var vNormal = normalize(ORI_NORMALMATRIX * (ORI_VertexVarying.vWorldNormal));
5354
+
5355
+ // let gBuffer = packNHMDGBuffer(
5356
+ // ORI_VertexVarying.fragCoord.z,
5357
+ // ORI_ShadingInput.BaseColor.rgb,
5358
+ // ORI_ShadingInput.BaseColor.rgb,
5359
+ // vec3f(ORI_ShadingInput.Roughness,ORI_ShadingInput.Metallic,ORI_ShadingInput.AmbientOcclusion),
5360
+ // ORI_ShadingInput.Normal,
5361
+ // ORI_ShadingInput.Opacity
5362
+ // ) ;
5363
+ #endif
5345
5364
 
5346
- return ORI_FragmentOutput;
5347
- }
5365
+ #if USE_OUTDEPTH
5366
+ #if USE_LOGDEPTH
5367
+ ORI_FragmentOutput.out_depth = log2DepthFixPersp(ORI_VertexVarying.fragPosition.w, globalUniform.near, globalUniform.far);
5368
+ #else
5369
+ ORI_FragmentOutput.out_depth = ORI_ShadingInput.FragDepth ;
5370
+ #endif
5371
+ #endif
5348
5372
 
5349
- fn packNHMDGBuffer(depth:f32, albedo:vec3f,hdrLighting:vec3f,rmao:vec3f,normal:vec3f,alpha:f32) -> vec4f {
5350
- var gBuffer : vec4f;
5351
- var octUVNormal = (octEncode(normalize( (normal) )) + 1.0) * 0.5;
5352
- var yc = f32(r11g11b9_to_float(vec3f(octUVNormal,rmao.r)));
5353
- #if USE_CASTREFLECTION
5354
- var rgbm = EncodeRGBM(hdrLighting);
5355
- var zc = f32(pack4x8unorm(vec4f(rgbm.rgb,0.0))) ;
5356
- var wc = f32(pack4x8unorm(vec4f(rmao.rg,rgbm.a,0.0)));
5357
- #else
5358
- var zc = f32(vec4fToFloat_7bits(vec4f(albedo.rgb,alpha)));
5359
- var wc = f32(r22g8_to_float(vec2f(f32(modelIndex)/f_r22g8.r,rmao.g)));
5360
- #endif
5373
+ return ORI_FragmentOutput ;
5374
+ }
5361
5375
 
5362
- gBuffer.x = depth ;
5363
- gBuffer.y = yc;
5364
- gBuffer.z = zc;
5365
- gBuffer.w = wc;
5366
- return gBuffer;
5367
- }
5368
5376
 
5369
- fn transformUV( uv:vec2f , offsetScale:vec4f ) -> vec2f{
5370
- return uv * offsetScale.zw + offsetScale.xy;
5371
- }
5372
- `;
5377
+ fn packNHMDGBuffer(depth:f32, albedo:vec3f,hdrLighting:vec3f,rmao:vec3f,normal:vec3f,alpha:f32) -> vec4f {
5378
+ var gBuffer : vec4f ;
5379
+ var octUVNormal = (octEncode(normalize( (normal) )) + 1.0) * 0.5 ;
5380
+ var yc = f32(r11g11b9_to_float(vec3f(octUVNormal,rmao.r))) ;
5381
+ #if USE_CASTREFLECTION
5382
+ var rgbm = EncodeRGBM(hdrLighting);
5383
+ var zc = f32(pack4x8unorm(vec4f(rgbm.rgb,0.0))) ;
5384
+ var wc = f32(pack4x8unorm(vec4f(rmao.rg,rgbm.a,0.0)));
5385
+ #else
5386
+ var zc = f32(vec4fToFloat_7bits(vec4f(albedo.rgb,alpha)));
5387
+ var wc = f32(r22g8_to_float(vec2f(f32(modelIndex)/f_r22g8.r,rmao.g)));
5388
+ #endif
5389
+
5390
+ gBuffer.x = depth ;
5391
+ gBuffer.y = yc ;
5392
+ gBuffer.z = zc ;
5393
+ gBuffer.w = wc ;
5394
+ return gBuffer ;
5395
+ }
5396
+
5397
+ fn transformUV( uv:vec2f , offsetScale:vec4f ) -> vec2f{
5398
+ return uv * offsetScale.zw + offsetScale.xy ;
5399
+ }
5400
+
5401
+ `
5402
+ );
5373
5403
 
5374
5404
  let Common_vert = (
5375
5405
  /*wgsl*/
@@ -5739,6 +5769,7 @@ var<uniform> materialUniform: MaterialUniform;
5739
5769
  let FragmentOutput = `
5740
5770
  #if USE_CASTREFLECTION
5741
5771
  struct FragmentOutput {
5772
+ @location(auto) color: vec4<f32>,
5742
5773
  @location(auto) gBuffer: vec4<f32>,
5743
5774
  #if USE_OUTDEPTH
5744
5775
  @builtin(frag_depth) out_depth: f32
@@ -9532,6 +9563,186 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
9532
9563
  }
9533
9564
  `;
9534
9565
 
9566
+ const FatLine_VS = (
9567
+ /* wgsl */
9568
+ `
9569
+ #include "GlobalUniform"
9570
+
9571
+ // Instance attributes stored in storage buffer
9572
+ // Extended with prevDir and nextDir for Line Join support
9573
+ struct InstanceData {
9574
+ start: vec3<f32>,
9575
+ _padding1: f32,
9576
+ end: vec3<f32>,
9577
+ _padding2: f32,
9578
+ colorStart: vec3<f32>,
9579
+ _padding3: f32,
9580
+ colorEnd: vec3<f32>,
9581
+ _padding4: f32,
9582
+ };
9583
+
9584
+ struct VertexInput {
9585
+ @builtin(instance_index) instanceIndex: u32,
9586
+ @location(0) position: vec3<f32>, // Quad vertices
9587
+ @location(1) uv: vec2<f32>, // UV coordinates
9588
+ };
9589
+
9590
+ struct VertexOutput {
9591
+ @builtin(position) position: vec4<f32>,
9592
+ @location(0) vUv: vec2<f32>,
9593
+ @location(1) vColor: vec3<f32>,
9594
+ };
9595
+
9596
+ struct MaterialUniform {
9597
+ baseColor: vec4<f32>,
9598
+ lineWidth: f32,
9599
+ opacity: f32,
9600
+ resolution: vec2<f32>,
9601
+ modelMatrix: mat4x4<f32>,
9602
+ };
9603
+
9604
+ @group(1) @binding(0) var<uniform> materialUniform: MaterialUniform;
9605
+ @group(1) @binding(1) var<storage, read> instances: array<InstanceData>;
9606
+
9607
+ @vertex
9608
+ fn VertMain(input: VertexInput) -> VertexOutput {
9609
+ var output: VertexOutput;
9610
+
9611
+ let instance = instances[input.instanceIndex];
9612
+
9613
+ // Transform from local space to world space, then to view space
9614
+ let start_world = materialUniform.modelMatrix * vec4<f32>(instance.start, 1.0);
9615
+ let end_world = materialUniform.modelMatrix * vec4<f32>(instance.end, 1.0);
9616
+
9617
+ let start_view = globalUniform.viewMat * start_world;
9618
+ let end_view = globalUniform.viewMat * end_world;
9619
+
9620
+ // Project to clip space
9621
+ var clip_start = globalUniform.projMat * start_view;
9622
+ var clip_end = globalUniform.projMat * end_view;
9623
+
9624
+ // Perspective division to NDC space
9625
+ let ndc_start = clip_start.xyz / clip_start.w;
9626
+ let ndc_end = clip_end.xyz / clip_end.w;
9627
+
9628
+ // Calculate screen-space direction
9629
+ var dir = ndc_end.xy - ndc_start.xy;
9630
+
9631
+ // Account for aspect ratio
9632
+ let aspect = materialUniform.resolution.x / materialUniform.resolution.y;
9633
+ dir.x *= aspect;
9634
+ dir = normalize(dir);
9635
+
9636
+ // Calculate perpendicular offset
9637
+ var offset = vec2<f32>(dir.y, -dir.x);
9638
+
9639
+ // Undo aspect ratio adjustment for both dir and offset
9640
+ dir.x /= aspect;
9641
+ offset.x /= aspect;
9642
+
9643
+ // Flip offset direction based on position.x
9644
+ if (input.position.x < 0.0) {
9645
+ offset *= -1.0;
9646
+ }
9647
+
9648
+ // Handle endcaps
9649
+ if (input.position.y < 0.0) {
9650
+ offset += -dir;
9651
+ } else if (input.position.y > 1.0) {
9652
+ offset += dir;
9653
+ }
9654
+
9655
+ // Apply line width
9656
+ offset *= materialUniform.lineWidth;
9657
+ offset /= materialUniform.resolution.y; // Convert to clip space
9658
+
9659
+ // Select start or end point
9660
+ var clip = select(clip_end, clip_start, input.position.y < 0.5);
9661
+
9662
+ // Shift the depth of the projected points so the line segments
9663
+ // overlap neatly and face the camera properly (billboard effect)
9664
+ let clipPose = select(ndc_end, ndc_start, input.position.y < 0.5);
9665
+ clip.z = clipPose.z * clip.w;
9666
+
9667
+ // Perspective correction
9668
+ offset *= clip.w;
9669
+ clip.x += offset.x;
9670
+ clip.y += offset.y;
9671
+
9672
+ output.position = clip;
9673
+ output.vUv = input.uv;
9674
+ output.vColor = select(instance.colorEnd, instance.colorStart, input.position.y < 0.5);
9675
+
9676
+ return output;
9677
+ }
9678
+ `
9679
+ );
9680
+ const FatLine_FS = (
9681
+ /* wgsl */
9682
+ `
9683
+ struct FragmentOutput {
9684
+ @location(0) color: vec4<f32>,
9685
+ @location(1) gBuffer: vec4<f32>,
9686
+ };
9687
+
9688
+ struct VertexOutput {
9689
+ @builtin(position) position: vec4<f32>,
9690
+ @location(0) vUv: vec2<f32>,
9691
+ @location(1) vColor: vec3<f32>,
9692
+ };
9693
+
9694
+ struct MaterialUniform {
9695
+ baseColor: vec4<f32>,
9696
+ lineWidth: f32,
9697
+ opacity: f32,
9698
+ resolution: vec2<f32>,
9699
+ modelMatrix: mat4x4<f32>,
9700
+ };
9701
+
9702
+ @group(1) @binding(0) var<uniform> materialUniform: MaterialUniform;
9703
+
9704
+ @fragment
9705
+ fn FragMain(input: VertexOutput) -> FragmentOutput {
9706
+ var output: FragmentOutput;
9707
+
9708
+ var alpha = materialUniform.opacity;
9709
+
9710
+ // Round endcap rendering with anti-aliasing
9711
+ let a = input.vUv.x;
9712
+ let b = select(input.vUv.y - 1.0, input.vUv.y + 1.0, input.vUv.y > 0.0);
9713
+ let len2 = a * a + b * b;
9714
+
9715
+ // Calculate derivative (must be in uniform control flow)
9716
+ let dlen = fwidth(len2);
9717
+
9718
+ // Round endcap rendering - simple approach
9719
+ if (abs(input.vUv.y) > 1.0) {
9720
+ // Determine circle center: (0, 1) for top, (0, -1) for bottom
9721
+ var basePoint = select(
9722
+ vec2<f32>(0.0, -1.0), // Bottom endcap
9723
+ vec2<f32>(0.0, 1.0), // Top endcap
9724
+ input.vUv.y > 0.0
9725
+ );
9726
+
9727
+ // Distance from UV to circle center
9728
+ // var dist = length(input.vUv - basePoint);
9729
+ var dist2 = (input.vUv.x - basePoint.x) * (input.vUv.x - basePoint.x) + (input.vUv.y - basePoint.y) * (input.vUv.y - basePoint.y);
9730
+
9731
+ // Discard pixels outside circle (radius = 1.0)
9732
+ if (dist2 > 1.0) {
9733
+ discard;
9734
+ }
9735
+ }
9736
+
9737
+ let color = input.vColor * materialUniform.baseColor.rgb;
9738
+ output.color = vec4<f32>(color, alpha);
9739
+ output.gBuffer = vec4<f32>(0.0, 0.0, 0.0, 0.0); // No GBuffer data for lines
9740
+
9741
+ return output;
9742
+ }
9743
+ `
9744
+ );
9745
+
9535
9746
  class ShaderLib {
9536
9747
  static init() {
9537
9748
  ShaderLib.register("MathShader", MathShader);
@@ -9601,6 +9812,8 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
9601
9812
  );
9602
9813
  ShaderLib.register("ZPass_shader_vs", ZPassShader_vs);
9603
9814
  ShaderLib.register("ZPass_shader_fs", ZPassShader_fs);
9815
+ ShaderLib.register("FatLine_VS", FatLine_VS);
9816
+ ShaderLib.register("FatLine_FS", FatLine_FS);
9604
9817
  }
9605
9818
  static register(keyName, code) {
9606
9819
  if (!ShaderLib[keyName.toLowerCase()]) {
@@ -21687,9 +21900,9 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
21687
21900
  }
21688
21901
 
21689
21902
  var __defProp$1 = Object.defineProperty;
21690
- var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
21691
- var __decorateClass$i = (decorators, target, key, kind) => {
21692
- var result = __getOwnPropDesc$i(target, key) ;
21903
+ var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
21904
+ var __decorateClass$l = (decorators, target, key, kind) => {
21905
+ var result = __getOwnPropDesc$l(target, key) ;
21693
21906
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
21694
21907
  if (decorator = decorators[i])
21695
21908
  result = (decorator(target, key, result) ) || result;
@@ -22274,221 +22487,16 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
22274
22487
  this._combineShaderRefection = void 0;
22275
22488
  }
22276
22489
  }
22277
- __decorateClass$i([
22490
+ __decorateClass$l([
22278
22491
  EditorInspector
22279
22492
  ], RenderNode.prototype, "materials");
22280
- __decorateClass$i([
22493
+ __decorateClass$l([
22281
22494
  EditorInspector
22282
22495
  ], RenderNode.prototype, "castShadow");
22283
- __decorateClass$i([
22496
+ __decorateClass$l([
22284
22497
  EditorInspector
22285
22498
  ], RenderNode.prototype, "castGI");
22286
22499
 
22287
- class Shader {
22288
- computes;
22289
- passShader;
22290
- constructor() {
22291
- this.computes = [];
22292
- this.passShader = /* @__PURE__ */ new Map();
22293
- }
22294
- addRenderPass(renderShader, index = -1) {
22295
- let subShader = this.passShader.get(renderShader.passType) || [];
22296
- if (index == -1) {
22297
- subShader.push(renderShader);
22298
- } else {
22299
- subShader.splice(index, -1, renderShader);
22300
- }
22301
- this.passShader.set(renderShader.passType, subShader);
22302
- }
22303
- removeShader(renderShader, index = -1) {
22304
- let subShader = this.passShader.get(
22305
- renderShader.passType
22306
- );
22307
- if (subShader) {
22308
- if (index == -1) {
22309
- let index2 = subShader.indexOf(renderShader);
22310
- if (index2 != -1) {
22311
- subShader.splice(index2);
22312
- }
22313
- } else {
22314
- subShader.splice(index, 1);
22315
- }
22316
- }
22317
- }
22318
- removeShaderByIndex(passType, index = -1) {
22319
- let subShader = this.passShader.get(passType);
22320
- if (subShader) {
22321
- if (index == -1) {
22322
- this.passShader.delete(passType);
22323
- } else {
22324
- subShader.splice(index, 1);
22325
- }
22326
- }
22327
- }
22328
- getSubShaders(passType) {
22329
- return this.passShader.get(passType) || [];
22330
- }
22331
- hasSubShaders(passType) {
22332
- let subs = this.passShader.get(passType);
22333
- return subs.length > 0;
22334
- }
22335
- getDefaultShaders() {
22336
- return this.passShader.get(PassType.COLOR);
22337
- }
22338
- getDefaultColorShader() {
22339
- return this.passShader.get(PassType.COLOR)[0];
22340
- }
22341
- setDefine(arg0, arg1) {
22342
- for (const pass of this.passShader) {
22343
- for (const rd of pass[1]) {
22344
- rd.setDefine(arg0, arg1);
22345
- }
22346
- }
22347
- }
22348
- hasDefine(arg0) {
22349
- for (const pass of this.passShader) {
22350
- for (const rd of pass[1]) {
22351
- let has = rd.hasDefine(arg0);
22352
- if (has) return has;
22353
- }
22354
- }
22355
- return false;
22356
- }
22357
- deleteDefine(arg0) {
22358
- for (const pass of this.passShader) {
22359
- for (const rd of pass[1]) {
22360
- rd.deleteDefine(arg0);
22361
- }
22362
- }
22363
- }
22364
- setUniform(arg0, arg1) {
22365
- for (const pass of this.passShader) {
22366
- for (const rd of pass[1]) {
22367
- rd.setUniform(arg0, arg1);
22368
- }
22369
- }
22370
- }
22371
- setUniformFloat(arg0, arg1) {
22372
- for (const pass of this.passShader) {
22373
- for (const rd of pass[1]) {
22374
- rd.setUniformFloat(arg0, arg1);
22375
- }
22376
- }
22377
- }
22378
- setUniformVector2(arg0, arg1) {
22379
- for (const pass of this.passShader) {
22380
- for (const rd of pass[1]) {
22381
- rd.setUniformVector2(arg0, arg1);
22382
- }
22383
- }
22384
- }
22385
- setUniformVector3(arg0, arg1) {
22386
- for (const pass of this.passShader) {
22387
- for (const rd of pass[1]) {
22388
- rd.setUniformVector3(arg0, arg1);
22389
- }
22390
- }
22391
- }
22392
- setUniformVector4(arg0, arg1) {
22393
- for (const pass of this.passShader) {
22394
- for (const rd of pass[1]) {
22395
- rd.setUniformVector4(arg0, arg1);
22396
- }
22397
- }
22398
- }
22399
- setUniformColor(arg0, arg1) {
22400
- for (const pass of this.passShader) {
22401
- for (const rd of pass[1]) {
22402
- rd.setUniformColor(arg0, arg1);
22403
- }
22404
- }
22405
- }
22406
- getUniform(arg0) {
22407
- return this.getDefaultColorShader().getUniform(arg0);
22408
- }
22409
- getUniformFloat(arg0) {
22410
- return this.getDefaultColorShader().getUniformFloat(arg0);
22411
- }
22412
- getUniformVector2(arg0) {
22413
- return this.getDefaultColorShader().getUniformVector2(arg0);
22414
- }
22415
- getUniformVector3(arg0) {
22416
- return this.getDefaultColorShader().getUniformVector3(arg0);
22417
- }
22418
- getUniformVector4(arg0) {
22419
- return this.getDefaultColorShader().getUniformVector4(arg0);
22420
- }
22421
- getUniformColor(arg0) {
22422
- return this.getDefaultColorShader().getUniformColor(arg0);
22423
- }
22424
- setTexture(arg0, arg1) {
22425
- for (const pass of this.passShader) {
22426
- for (const rd of pass[1]) {
22427
- rd.setTexture(arg0, arg1);
22428
- }
22429
- }
22430
- this.setDefine(`USE_${arg0.toLocaleUpperCase()}`, true);
22431
- }
22432
- getTexture(arg0) {
22433
- return this.getDefaultColorShader().textures[arg0];
22434
- }
22435
- setUniformBuffer(arg0, arg1) {
22436
- for (const pass of this.passShader) {
22437
- for (const rd of pass[1]) {
22438
- rd.setUniformBuffer(arg0, arg1);
22439
- }
22440
- }
22441
- }
22442
- getUniformBuffer(arg0) {
22443
- return this.getDefaultColorShader().getBuffer(arg0);
22444
- }
22445
- setStorageBuffer(arg0, arg1) {
22446
- for (const pass of this.passShader) {
22447
- for (const rd of pass[1]) {
22448
- rd.setStorageBuffer(arg0, arg1);
22449
- }
22450
- }
22451
- }
22452
- getStorageBuffer(arg0) {
22453
- return this.getDefaultColorShader().getBuffer(arg0);
22454
- }
22455
- setStructStorageBuffer(arg0, arg1) {
22456
- for (const pass of this.passShader) {
22457
- for (const rd of pass[1]) {
22458
- rd.setStructStorageBuffer(arg0, arg1);
22459
- }
22460
- }
22461
- }
22462
- getStructStorageBuffer(arg0) {
22463
- return this.getDefaultColorShader().getBuffer(arg0);
22464
- }
22465
- noticeValueChange() {
22466
- for (const pass of this.passShader) {
22467
- for (const rd of pass[1]) {
22468
- rd.noticeValueChange();
22469
- }
22470
- }
22471
- }
22472
- destroy() {
22473
- this.getDefaultColorShader().destroy();
22474
- }
22475
- clone() {
22476
- let newShader = new Shader();
22477
- let sourceShaderPassList = this.getDefaultShaders();
22478
- for (const shadePass of sourceShaderPassList) {
22479
- newShader.addRenderPass(shadePass);
22480
- }
22481
- return newShader;
22482
- }
22483
- applyUniform() {
22484
- for (const pass of this.passShader) {
22485
- for (const rd of pass[1]) {
22486
- rd.applyUniform();
22487
- }
22488
- }
22489
- }
22490
- }
22491
-
22492
22500
  class Material {
22493
22501
  instanceID;
22494
22502
  name;
@@ -22972,11 +22980,222 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
22972
22980
  `
22973
22981
  );
22974
22982
 
22975
- class GSplatMaterial extends Material {
22983
+ class Shader {
22984
+ computes;
22985
+ passShader;
22986
+ constructor() {
22987
+ this.computes = [];
22988
+ this.passShader = /* @__PURE__ */ new Map();
22989
+ }
22990
+ addRenderPass(renderShader, index = -1) {
22991
+ let subShader = this.passShader.get(renderShader.passType) || [];
22992
+ if (index == -1) {
22993
+ subShader.push(renderShader);
22994
+ } else {
22995
+ subShader.splice(index, -1, renderShader);
22996
+ }
22997
+ this.passShader.set(renderShader.passType, subShader);
22998
+ }
22999
+ removeShader(renderShader, index = -1) {
23000
+ let subShader = this.passShader.get(
23001
+ renderShader.passType
23002
+ );
23003
+ if (subShader) {
23004
+ if (index == -1) {
23005
+ let index2 = subShader.indexOf(renderShader);
23006
+ if (index2 != -1) {
23007
+ subShader.splice(index2);
23008
+ }
23009
+ } else {
23010
+ subShader.splice(index, 1);
23011
+ }
23012
+ }
23013
+ }
23014
+ removeShaderByIndex(passType, index = -1) {
23015
+ let subShader = this.passShader.get(passType);
23016
+ if (subShader) {
23017
+ if (index == -1) {
23018
+ this.passShader.delete(passType);
23019
+ } else {
23020
+ subShader.splice(index, 1);
23021
+ }
23022
+ }
23023
+ }
23024
+ getSubShaders(passType) {
23025
+ return this.passShader.get(passType) || [];
23026
+ }
23027
+ hasSubShaders(passType) {
23028
+ let subs = this.passShader.get(passType);
23029
+ return subs.length > 0;
23030
+ }
23031
+ getDefaultShaders() {
23032
+ return this.passShader.get(PassType.COLOR);
23033
+ }
23034
+ getDefaultColorShader() {
23035
+ return this.passShader.get(PassType.COLOR)[0];
23036
+ }
23037
+ setDefine(arg0, arg1) {
23038
+ for (const pass of this.passShader) {
23039
+ for (const rd of pass[1]) {
23040
+ rd.setDefine(arg0, arg1);
23041
+ }
23042
+ }
23043
+ }
23044
+ hasDefine(arg0) {
23045
+ for (const pass of this.passShader) {
23046
+ for (const rd of pass[1]) {
23047
+ let has = rd.hasDefine(arg0);
23048
+ if (has) return has;
23049
+ }
23050
+ }
23051
+ return false;
23052
+ }
23053
+ deleteDefine(arg0) {
23054
+ for (const pass of this.passShader) {
23055
+ for (const rd of pass[1]) {
23056
+ rd.deleteDefine(arg0);
23057
+ }
23058
+ }
23059
+ }
23060
+ setUniform(arg0, arg1) {
23061
+ for (const pass of this.passShader) {
23062
+ for (const rd of pass[1]) {
23063
+ rd.setUniform(arg0, arg1);
23064
+ }
23065
+ }
23066
+ }
23067
+ setUniformFloat(arg0, arg1) {
23068
+ for (const pass of this.passShader) {
23069
+ for (const rd of pass[1]) {
23070
+ rd.setUniformFloat(arg0, arg1);
23071
+ }
23072
+ }
23073
+ }
23074
+ setUniformVector2(arg0, arg1) {
23075
+ for (const pass of this.passShader) {
23076
+ for (const rd of pass[1]) {
23077
+ rd.setUniformVector2(arg0, arg1);
23078
+ }
23079
+ }
23080
+ }
23081
+ setUniformVector3(arg0, arg1) {
23082
+ for (const pass of this.passShader) {
23083
+ for (const rd of pass[1]) {
23084
+ rd.setUniformVector3(arg0, arg1);
23085
+ }
23086
+ }
23087
+ }
23088
+ setUniformVector4(arg0, arg1) {
23089
+ for (const pass of this.passShader) {
23090
+ for (const rd of pass[1]) {
23091
+ rd.setUniformVector4(arg0, arg1);
23092
+ }
23093
+ }
23094
+ }
23095
+ setUniformColor(arg0, arg1) {
23096
+ for (const pass of this.passShader) {
23097
+ for (const rd of pass[1]) {
23098
+ rd.setUniformColor(arg0, arg1);
23099
+ }
23100
+ }
23101
+ }
23102
+ getUniform(arg0) {
23103
+ return this.getDefaultColorShader().getUniform(arg0);
23104
+ }
23105
+ getUniformFloat(arg0) {
23106
+ return this.getDefaultColorShader().getUniformFloat(arg0);
23107
+ }
23108
+ getUniformVector2(arg0) {
23109
+ return this.getDefaultColorShader().getUniformVector2(arg0);
23110
+ }
23111
+ getUniformVector3(arg0) {
23112
+ return this.getDefaultColorShader().getUniformVector3(arg0);
23113
+ }
23114
+ getUniformVector4(arg0) {
23115
+ return this.getDefaultColorShader().getUniformVector4(arg0);
23116
+ }
23117
+ getUniformColor(arg0) {
23118
+ return this.getDefaultColorShader().getUniformColor(arg0);
23119
+ }
23120
+ setTexture(arg0, arg1) {
23121
+ for (const pass of this.passShader) {
23122
+ for (const rd of pass[1]) {
23123
+ rd.setTexture(arg0, arg1);
23124
+ }
23125
+ }
23126
+ this.setDefine(`USE_${arg0.toLocaleUpperCase()}`, true);
23127
+ }
23128
+ getTexture(arg0) {
23129
+ return this.getDefaultColorShader().textures[arg0];
23130
+ }
23131
+ setUniformBuffer(arg0, arg1) {
23132
+ for (const pass of this.passShader) {
23133
+ for (const rd of pass[1]) {
23134
+ rd.setUniformBuffer(arg0, arg1);
23135
+ }
23136
+ }
23137
+ }
23138
+ getUniformBuffer(arg0) {
23139
+ return this.getDefaultColorShader().getBuffer(arg0);
23140
+ }
23141
+ setStorageBuffer(arg0, arg1) {
23142
+ for (const pass of this.passShader) {
23143
+ for (const rd of pass[1]) {
23144
+ rd.setStorageBuffer(arg0, arg1);
23145
+ }
23146
+ }
23147
+ }
23148
+ getStorageBuffer(arg0) {
23149
+ return this.getDefaultColorShader().getBuffer(arg0);
23150
+ }
23151
+ setStructStorageBuffer(arg0, arg1) {
23152
+ for (const pass of this.passShader) {
23153
+ for (const rd of pass[1]) {
23154
+ rd.setStructStorageBuffer(arg0, arg1);
23155
+ }
23156
+ }
23157
+ }
23158
+ getStructStorageBuffer(arg0) {
23159
+ return this.getDefaultColorShader().getBuffer(arg0);
23160
+ }
23161
+ noticeValueChange() {
23162
+ for (const pass of this.passShader) {
23163
+ for (const rd of pass[1]) {
23164
+ rd.noticeValueChange();
23165
+ }
23166
+ }
23167
+ }
23168
+ destroy() {
23169
+ this.getDefaultColorShader().destroy();
23170
+ }
23171
+ clone() {
23172
+ let newShader = new Shader();
23173
+ let sourceShaderPassList = this.getDefaultShaders();
23174
+ for (const shadePass of sourceShaderPassList) {
23175
+ newShader.addRenderPass(shadePass);
23176
+ }
23177
+ return newShader;
23178
+ }
23179
+ applyUniform() {
23180
+ for (const pass of this.passShader) {
23181
+ for (const rd of pass[1]) {
23182
+ rd.applyUniform();
23183
+ }
23184
+ }
23185
+ }
23186
+ }
23187
+
23188
+ var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
23189
+ var __decorateClass$k = (decorators, target, key, kind) => {
23190
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
23191
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
23192
+ if (decorator = decorators[i])
23193
+ result = (decorator(result)) || result;
23194
+ return result;
23195
+ };
23196
+ exports.GSplatShader = class GSplatShader extends Shader {
22976
23197
  constructor() {
22977
23198
  super();
22978
- ShaderLib.register("gsplat_vs_dc", GSplat_VS);
22979
- ShaderLib.register("gsplat_fs_dc", GSplat_FS);
22980
23199
  const pass = new RenderShaderPass("gsplat_vs_dc", "gsplat_fs_dc");
22981
23200
  pass.passType = PassType.COLOR;
22982
23201
  pass.setShaderEntry("VertMain", "FragMain");
@@ -22986,9 +23205,29 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
22986
23205
  pass.shaderState.transparent = true;
22987
23206
  pass.shaderState.blendMode = BlendMode.NORMAL;
22988
23207
  pass.shaderState.writeMasks = [15, 15];
22989
- const shader = new Shader();
22990
- shader.addRenderPass(pass);
22991
- this.shader = shader;
23208
+ this.addRenderPass(pass);
23209
+ this.setDefault();
23210
+ }
23211
+ /**
23212
+ * Set default uniform values
23213
+ */
23214
+ setDefault() {
23215
+ const pass = this.getDefaultColorShader();
23216
+ const identityMatrix = new Matrix4();
23217
+ pass.setUniform("modelMatrix", identityMatrix.rawData);
23218
+ pass.setUniform("pixelCull", new Float32Array([2, 0, 0, 0]));
23219
+ }
23220
+ };
23221
+ exports.GSplatShader = __decorateClass$k([
23222
+ RegisterShader(exports.GSplatShader, "GSplatShader")
23223
+ ], exports.GSplatShader);
23224
+
23225
+ class GSplatMaterial extends Material {
23226
+ constructor() {
23227
+ super();
23228
+ ShaderLib.register("gsplat_vs_dc", GSplat_VS);
23229
+ ShaderLib.register("gsplat_fs_dc", GSplat_FS);
23230
+ this.shader = new exports.GSplatShader();
22992
23231
  }
22993
23232
  setSplatTextures(splatColor, transformA, transformB, texParams, splatOrder) {
22994
23233
  const pass = this.shader.getDefaultColorShader();
@@ -23997,9 +24236,9 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
23997
24236
  }
23998
24237
  }
23999
24238
 
24000
- var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
24001
- var __decorateClass$h = (decorators, target, key, kind) => {
24002
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
24239
+ var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
24240
+ var __decorateClass$j = (decorators, target, key, kind) => {
24241
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
24003
24242
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
24004
24243
  if (decorator = decorators[i])
24005
24244
  result = (decorator(result)) || result;
@@ -24752,7 +24991,7 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
24752
24991
  super.destroy(force);
24753
24992
  }
24754
24993
  };
24755
- exports.GSplatRenderer = __decorateClass$h([
24994
+ exports.GSplatRenderer = __decorateClass$j([
24756
24995
  RegisterComponent(exports.GSplatRenderer, "GSplatRenderer")
24757
24996
  ], exports.GSplatRenderer);
24758
24997
 
@@ -25063,9 +25302,9 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
25063
25302
  }
25064
25303
  }
25065
25304
 
25066
- var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
25067
- var __decorateClass$g = (decorators, target, key, kind) => {
25068
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
25305
+ var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
25306
+ var __decorateClass$i = (decorators, target, key, kind) => {
25307
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
25069
25308
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
25070
25309
  if (decorator = decorators[i])
25071
25310
  result = (decorator(result)) || result;
@@ -25330,7 +25569,7 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
25330
25569
  super.destroy(force);
25331
25570
  }
25332
25571
  };
25333
- exports.Object3D = __decorateClass$g([
25572
+ exports.Object3D = __decorateClass$i([
25334
25573
  DecorateObject3D
25335
25574
  ], exports.Object3D);
25336
25575
  function DecorateObject3D(ctor, _) {
@@ -26659,9 +26898,9 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
26659
26898
  }
26660
26899
 
26661
26900
  var __defProp = Object.defineProperty;
26662
- var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
26663
- var __decorateClass$f = (decorators, target, key, kind) => {
26664
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
26901
+ var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
26902
+ var __decorateClass$h = (decorators, target, key, kind) => {
26903
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
26665
26904
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
26666
26905
  if (decorator = decorators[i])
26667
26906
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
@@ -26770,13 +27009,13 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
26770
27009
  super.destroy(force);
26771
27010
  }
26772
27011
  };
26773
- __decorateClass$f([
27012
+ __decorateClass$h([
26774
27013
  EditorInspector
26775
27014
  ], exports.MeshRenderer.prototype, "geometry", 1);
26776
- __decorateClass$f([
27015
+ __decorateClass$h([
26777
27016
  EditorInspector
26778
27017
  ], exports.MeshRenderer.prototype, "material", 1);
26779
- exports.MeshRenderer = __decorateClass$f([
27018
+ exports.MeshRenderer = __decorateClass$h([
26780
27019
  RegisterComponent(exports.MeshRenderer, "MeshRenderer")
26781
27020
  ], exports.MeshRenderer);
26782
27021
 
@@ -27273,9 +27512,9 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
27273
27512
  }
27274
27513
  }
27275
27514
 
27276
- var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
27277
- var __decorateClass$e = (decorators, target, key, kind) => {
27278
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
27515
+ var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
27516
+ var __decorateClass$g = (decorators, target, key, kind) => {
27517
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
27279
27518
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
27280
27519
  if (decorator = decorators[i])
27281
27520
  result = (decorator(result)) || result;
@@ -27299,7 +27538,7 @@ fn SH9(dir: vec3<f32>, coefficients: array<vec4f, 9>) -> vec4<f32> {
27299
27538
  this.setUniformFloat(`height`, 100);
27300
27539
  }
27301
27540
  };
27302
- exports.QuadShader = __decorateClass$e([
27541
+ exports.QuadShader = __decorateClass$g([
27303
27542
  RegisterShader(exports.QuadShader, "QuadShader")
27304
27543
  ], exports.QuadShader);
27305
27544
 
@@ -34573,9 +34812,9 @@ fn CsMain( @builtin(workgroup_id) workgroup_id : vec3<u32> , @builtin(global_inv
34573
34812
  }
34574
34813
  }
34575
34814
 
34576
- var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
34577
- var __decorateClass$d = (decorators, target, key, kind) => {
34578
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
34815
+ var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
34816
+ var __decorateClass$f = (decorators, target, key, kind) => {
34817
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
34579
34818
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
34580
34819
  if (decorator = decorators[i])
34581
34820
  result = (decorator(result)) || result;
@@ -34617,13 +34856,13 @@ fn CsMain( @builtin(workgroup_id) workgroup_id : vec3<u32> , @builtin(global_inv
34617
34856
  debug() {
34618
34857
  }
34619
34858
  };
34620
- exports.DirectLight = __decorateClass$d([
34859
+ exports.DirectLight = __decorateClass$f([
34621
34860
  RegisterComponent(exports.DirectLight, "DirectLight")
34622
34861
  ], exports.DirectLight);
34623
34862
 
34624
- var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
34625
- var __decorateClass$c = (decorators, target, key, kind) => {
34626
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
34863
+ var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
34864
+ var __decorateClass$e = (decorators, target, key, kind) => {
34865
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
34627
34866
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
34628
34867
  if (decorator = decorators[i])
34629
34868
  result = (decorator(result)) || result;
@@ -34681,13 +34920,13 @@ fn CsMain( @builtin(workgroup_id) workgroup_id : vec3<u32> , @builtin(global_inv
34681
34920
  debugDraw(show) {
34682
34921
  }
34683
34922
  };
34684
- exports.PointLight = __decorateClass$c([
34923
+ exports.PointLight = __decorateClass$e([
34685
34924
  RegisterComponent(exports.PointLight, "PointLight")
34686
34925
  ], exports.PointLight);
34687
34926
 
34688
- var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
34689
- var __decorateClass$b = (decorators, target, key, kind) => {
34690
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
34927
+ var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
34928
+ var __decorateClass$d = (decorators, target, key, kind) => {
34929
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
34691
34930
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
34692
34931
  if (decorator = decorators[i])
34693
34932
  result = (decorator(result)) || result;
@@ -34752,7 +34991,7 @@ fn CsMain( @builtin(workgroup_id) workgroup_id : vec3<u32> , @builtin(global_inv
34752
34991
  debugDraw(show) {
34753
34992
  }
34754
34993
  };
34755
- exports.SpotLight = __decorateClass$b([
34994
+ exports.SpotLight = __decorateClass$d([
34756
34995
  RegisterComponent(exports.SpotLight, "SpotLight")
34757
34996
  ], exports.SpotLight);
34758
34997
 
@@ -39305,483 +39544,483 @@ fn CsMain( @builtin(workgroup_id) workgroup_id : vec3<u32> , @builtin(global_inv
39305
39544
  }
39306
39545
  }
39307
39546
 
39308
- // DEFLATE is a complex format; to read this code, you should probably check the RFC first:
39309
- // https://tools.ietf.org/html/rfc1951
39310
- // You may also wish to take a look at the guide I made about this program:
39311
- // https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad
39312
- // Some of the following code is similar to that of UZIP.js:
39313
- // https://github.com/photopea/UZIP.js
39314
- // However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.
39315
- // Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint
39316
- // is better for memory in most engines (I *think*).
39317
-
39318
- // aliases for shorter compressed code (most minifers don't do this)
39319
- var u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;
39320
- // fixed length extra bits
39321
- var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);
39322
- // fixed distance extra bits
39323
- var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);
39324
- // code length index map
39325
- var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
39326
- // get base, reverse index map from extra bits
39327
- var freb = function (eb, start) {
39328
- var b = new u16(31);
39329
- for (var i = 0; i < 31; ++i) {
39330
- b[i] = start += 1 << eb[i - 1];
39331
- }
39332
- // numbers here are at max 18 bits
39333
- var r = new i32(b[30]);
39334
- for (var i = 1; i < 30; ++i) {
39335
- for (var j = b[i]; j < b[i + 1]; ++j) {
39336
- r[j] = ((j - b[i]) << 5) | i;
39337
- }
39338
- }
39339
- return { b: b, r: r };
39340
- };
39341
- var _a = freb(fleb, 2), fl = _a.b, revfl = _a.r;
39342
- // we can ignore the fact that the other numbers are wrong; they never happen anyway
39343
- fl[28] = 258, revfl[258] = 28;
39344
- var _b = freb(fdeb, 0), fd = _b.b;
39345
- // map of value to reverse (assuming 16 bits)
39346
- var rev = new u16(32768);
39347
- for (var i = 0; i < 32768; ++i) {
39348
- // reverse table algorithm from SO
39349
- var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1);
39350
- x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2);
39351
- x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4);
39352
- rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1;
39353
- }
39354
- // create huffman tree from u8 "map": index -> code length for code index
39355
- // mb (max bits) must be at most 15
39356
- // TODO: optimize/split up?
39357
- var hMap = (function (cd, mb, r) {
39358
- var s = cd.length;
39359
- // index
39360
- var i = 0;
39361
- // u16 "map": index -> # of codes with bit length = index
39362
- var l = new u16(mb);
39363
- // length of cd must be 288 (total # of codes)
39364
- for (; i < s; ++i) {
39365
- if (cd[i])
39366
- ++l[cd[i] - 1];
39367
- }
39368
- // u16 "map": index -> minimum code for bit length = index
39369
- var le = new u16(mb);
39370
- for (i = 1; i < mb; ++i) {
39371
- le[i] = (le[i - 1] + l[i - 1]) << 1;
39372
- }
39373
- var co;
39374
- if (r) {
39375
- // u16 "map": index -> number of actual bits, symbol for code
39376
- co = new u16(1 << mb);
39377
- // bits to remove for reverser
39378
- var rvb = 15 - mb;
39379
- for (i = 0; i < s; ++i) {
39380
- // ignore 0 lengths
39381
- if (cd[i]) {
39382
- // num encoding both symbol and bits read
39383
- var sv = (i << 4) | cd[i];
39384
- // free bits
39385
- var r_1 = mb - cd[i];
39386
- // start value
39387
- var v = le[cd[i] - 1]++ << r_1;
39388
- // m is end value
39389
- for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {
39390
- // every 16 bit value starting with the code yields the same result
39391
- co[rev[v] >> rvb] = sv;
39392
- }
39393
- }
39394
- }
39395
- }
39396
- else {
39397
- co = new u16(s);
39398
- for (i = 0; i < s; ++i) {
39399
- if (cd[i]) {
39400
- co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]);
39401
- }
39402
- }
39403
- }
39404
- return co;
39405
- });
39406
- // fixed length tree
39407
- var flt = new u8(288);
39408
- for (var i = 0; i < 144; ++i)
39409
- flt[i] = 8;
39410
- for (var i = 144; i < 256; ++i)
39411
- flt[i] = 9;
39412
- for (var i = 256; i < 280; ++i)
39413
- flt[i] = 7;
39414
- for (var i = 280; i < 288; ++i)
39415
- flt[i] = 8;
39416
- // fixed distance tree
39417
- var fdt = new u8(32);
39418
- for (var i = 0; i < 32; ++i)
39419
- fdt[i] = 5;
39420
- // fixed length map
39421
- var flrm = /*#__PURE__*/ hMap(flt, 9, 1);
39422
- // fixed distance map
39423
- var fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);
39424
- // find max of array
39425
- var max = function (a) {
39426
- var m = a[0];
39427
- for (var i = 1; i < a.length; ++i) {
39428
- if (a[i] > m)
39429
- m = a[i];
39430
- }
39431
- return m;
39432
- };
39433
- // read d, starting at bit p and mask with m
39434
- var bits = function (d, p, m) {
39435
- var o = (p / 8) | 0;
39436
- return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;
39437
- };
39438
- // read d, starting at bit p continuing for at least 16 bits
39439
- var bits16 = function (d, p) {
39440
- var o = (p / 8) | 0;
39441
- return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));
39442
- };
39443
- // get end of byte
39444
- var shft = function (p) { return ((p + 7) / 8) | 0; };
39445
- // typed array slice - allows garbage collector to free original reference,
39446
- // while being more compatible than .slice
39447
- var slc = function (v, s, e) {
39448
- if (s == null || s < 0)
39449
- s = 0;
39450
- if (e == null || e > v.length)
39451
- e = v.length;
39452
- // can't use .constructor in case user-supplied
39453
- return new u8(v.subarray(s, e));
39454
- };
39455
- // error codes
39456
- var ec = [
39457
- 'unexpected EOF',
39458
- 'invalid block type',
39459
- 'invalid length/literal',
39460
- 'invalid distance',
39461
- 'stream finished',
39462
- 'no stream handler',
39463
- ,
39464
- 'no callback',
39465
- 'invalid UTF-8 data',
39466
- 'extra field too long',
39467
- 'date not in range 1980-2099',
39468
- 'filename too long',
39469
- 'stream finishing',
39470
- 'invalid zip data'
39471
- // determined by unknown compression method
39472
- ];
39473
- var err = function (ind, msg, nt) {
39474
- var e = new Error(msg || ec[ind]);
39475
- e.code = ind;
39476
- if (Error.captureStackTrace)
39477
- Error.captureStackTrace(e, err);
39478
- if (!nt)
39479
- throw e;
39480
- return e;
39481
- };
39482
- // expands raw DEFLATE data
39483
- var inflt = function (dat, st, buf, dict) {
39484
- // source length dict length
39485
- var sl = dat.length, dl = dict ? dict.length : 0;
39486
- if (!sl || st.f && !st.l)
39487
- return buf || new u8(0);
39488
- var noBuf = !buf;
39489
- // have to estimate size
39490
- var resize = noBuf || st.i != 2;
39491
- // no state
39492
- var noSt = st.i;
39493
- // Assumes roughly 33% compression ratio average
39494
- if (noBuf)
39495
- buf = new u8(sl * 3);
39496
- // ensure buffer can fit at least l elements
39497
- var cbuf = function (l) {
39498
- var bl = buf.length;
39499
- // need to increase size to fit
39500
- if (l > bl) {
39501
- // Double or set to necessary, whichever is greater
39502
- var nbuf = new u8(Math.max(bl * 2, l));
39503
- nbuf.set(buf);
39504
- buf = nbuf;
39505
- }
39506
- };
39507
- // last chunk bitpos bytes
39508
- var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;
39509
- // total bits
39510
- var tbts = sl * 8;
39511
- do {
39512
- if (!lm) {
39513
- // BFINAL - this is only 1 when last chunk is next
39514
- final = bits(dat, pos, 1);
39515
- // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman
39516
- var type = bits(dat, pos + 1, 3);
39517
- pos += 3;
39518
- if (!type) {
39519
- // go to end of byte boundary
39520
- var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;
39521
- if (t > sl) {
39522
- if (noSt)
39523
- err(0);
39524
- break;
39525
- }
39526
- // ensure size
39527
- if (resize)
39528
- cbuf(bt + l);
39529
- // Copy over uncompressed data
39530
- buf.set(dat.subarray(s, t), bt);
39531
- // Get new bitpos, update byte count
39532
- st.b = bt += l, st.p = pos = t * 8, st.f = final;
39533
- continue;
39534
- }
39535
- else if (type == 1)
39536
- lm = flrm, dm = fdrm, lbt = 9, dbt = 5;
39537
- else if (type == 2) {
39538
- // literal lengths
39539
- var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;
39540
- var tl = hLit + bits(dat, pos + 5, 31) + 1;
39541
- pos += 14;
39542
- // length+distance tree
39543
- var ldt = new u8(tl);
39544
- // code length tree
39545
- var clt = new u8(19);
39546
- for (var i = 0; i < hcLen; ++i) {
39547
- // use index map to get real code
39548
- clt[clim[i]] = bits(dat, pos + i * 3, 7);
39549
- }
39550
- pos += hcLen * 3;
39551
- // code lengths bits
39552
- var clb = max(clt), clbmsk = (1 << clb) - 1;
39553
- // code lengths map
39554
- var clm = hMap(clt, clb, 1);
39555
- for (var i = 0; i < tl;) {
39556
- var r = clm[bits(dat, pos, clbmsk)];
39557
- // bits read
39558
- pos += r & 15;
39559
- // symbol
39560
- var s = r >> 4;
39561
- // code length to copy
39562
- if (s < 16) {
39563
- ldt[i++] = s;
39564
- }
39565
- else {
39566
- // copy count
39567
- var c = 0, n = 0;
39568
- if (s == 16)
39569
- n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];
39570
- else if (s == 17)
39571
- n = 3 + bits(dat, pos, 7), pos += 3;
39572
- else if (s == 18)
39573
- n = 11 + bits(dat, pos, 127), pos += 7;
39574
- while (n--)
39575
- ldt[i++] = c;
39576
- }
39577
- }
39578
- // length tree distance tree
39579
- var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);
39580
- // max length bits
39581
- lbt = max(lt);
39582
- // max dist bits
39583
- dbt = max(dt);
39584
- lm = hMap(lt, lbt, 1);
39585
- dm = hMap(dt, dbt, 1);
39586
- }
39587
- else
39588
- err(1);
39589
- if (pos > tbts) {
39590
- if (noSt)
39591
- err(0);
39592
- break;
39593
- }
39594
- }
39595
- // Make sure the buffer can hold this + the largest possible addition
39596
- // Maximum chunk size (practically, theoretically infinite) is 2^17
39597
- if (resize)
39598
- cbuf(bt + 131072);
39599
- var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;
39600
- var lpos = pos;
39601
- for (;; lpos = pos) {
39602
- // bits read, code
39603
- var c = lm[bits16(dat, pos) & lms], sym = c >> 4;
39604
- pos += c & 15;
39605
- if (pos > tbts) {
39606
- if (noSt)
39607
- err(0);
39608
- break;
39609
- }
39610
- if (!c)
39611
- err(2);
39612
- if (sym < 256)
39613
- buf[bt++] = sym;
39614
- else if (sym == 256) {
39615
- lpos = pos, lm = null;
39616
- break;
39617
- }
39618
- else {
39619
- var add = sym - 254;
39620
- // no extra bits needed if less
39621
- if (sym > 264) {
39622
- // index
39623
- var i = sym - 257, b = fleb[i];
39624
- add = bits(dat, pos, (1 << b) - 1) + fl[i];
39625
- pos += b;
39626
- }
39627
- // dist
39628
- var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;
39629
- if (!d)
39630
- err(3);
39631
- pos += d & 15;
39632
- var dt = fd[dsym];
39633
- if (dsym > 3) {
39634
- var b = fdeb[dsym];
39635
- dt += bits16(dat, pos) & (1 << b) - 1, pos += b;
39636
- }
39637
- if (pos > tbts) {
39638
- if (noSt)
39639
- err(0);
39640
- break;
39641
- }
39642
- if (resize)
39643
- cbuf(bt + 131072);
39644
- var end = bt + add;
39645
- if (bt < dt) {
39646
- var shift = dl - dt, dend = Math.min(dt, end);
39647
- if (shift + bt < 0)
39648
- err(3);
39649
- for (; bt < dend; ++bt)
39650
- buf[bt] = dict[shift + bt];
39651
- }
39652
- for (; bt < end; ++bt)
39653
- buf[bt] = buf[bt - dt];
39654
- }
39655
- }
39656
- st.l = lm, st.p = lpos, st.b = bt, st.f = final;
39657
- if (lm)
39658
- final = 1, st.m = lbt, st.d = dm, st.n = dbt;
39659
- } while (!final);
39660
- // don't reallocate for streams or user buffers
39661
- return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);
39662
- };
39663
- // empty
39664
- var et = /*#__PURE__*/ new u8(0);
39665
- // read 2 bytes
39666
- var b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };
39667
- // read 4 bytes
39668
- var b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };
39669
- var b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };
39670
- /**
39671
- * Expands DEFLATE data with no wrapper
39672
- * @param data The data to decompress
39673
- * @param opts The decompression options
39674
- * @returns The decompressed version of the data
39675
- */
39676
- function inflateSync(data, opts) {
39677
- return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);
39678
- }
39679
- // text decoder
39680
- var td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();
39681
- // text decoder stream
39682
- var tds = 0;
39683
- try {
39684
- td.decode(et, { stream: true });
39685
- tds = 1;
39686
- }
39687
- catch (e) { }
39688
- // decode UTF8
39689
- var dutf8 = function (d) {
39690
- for (var r = '', i = 0;;) {
39691
- var c = d[i++];
39692
- var eb = (c > 127) + (c > 223) + (c > 239);
39693
- if (i + eb > d.length)
39694
- return { s: r, r: slc(d, i - 1) };
39695
- if (!eb)
39696
- r += String.fromCharCode(c);
39697
- else if (eb == 3) {
39698
- c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,
39699
- r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));
39700
- }
39701
- else if (eb & 1)
39702
- r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));
39703
- else
39704
- r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));
39705
- }
39706
- };
39707
- /**
39708
- * Converts a Uint8Array to a string
39709
- * @param dat The data to decode to string
39710
- * @param latin1 Whether or not to interpret the data as Latin-1. This should
39711
- * not need to be true unless encoding to binary string.
39712
- * @returns The original UTF-8/Latin-1 string
39713
- */
39714
- function strFromU8(dat, latin1) {
39715
- if (latin1) {
39716
- var r = '';
39717
- for (var i = 0; i < dat.length; i += 16384)
39718
- r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));
39719
- return r;
39720
- }
39721
- else if (td) {
39722
- return td.decode(dat);
39723
- }
39724
- else {
39725
- var _a = dutf8(dat), s = _a.s, r = _a.r;
39726
- if (r.length)
39727
- err(8);
39728
- return s;
39729
- }
39730
- }
39731
- // skip local zip header
39732
- var slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };
39733
- // read zip header
39734
- var zh = function (d, b, z) {
39735
- var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);
39736
- var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];
39737
- return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];
39738
- };
39739
- // read zip64 extra field
39740
- var z64e = function (d, b) {
39741
- for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))
39742
- ;
39743
- return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];
39744
- };
39745
- /**
39746
- * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better
39747
- * performance with more than one file.
39748
- * @param data The raw compressed ZIP file
39749
- * @param opts The ZIP extraction options
39750
- * @returns The decompressed files
39751
- */
39752
- function unzipSync(data, opts) {
39753
- var files = {};
39754
- var e = data.length - 22;
39755
- for (; b4(data, e) != 0x6054B50; --e) {
39756
- if (!e || data.length - e > 65558)
39757
- err(13);
39758
- }
39759
- var c = b2(data, e + 8);
39760
- if (!c)
39761
- return {};
39762
- var o = b4(data, e + 16);
39763
- var z = o == 4294967295 || c == 65535;
39764
- if (z) {
39765
- var ze = b4(data, e - 12);
39766
- z = b4(data, ze) == 0x6064B50;
39767
- if (z) {
39768
- c = b4(data, ze + 32);
39769
- o = b4(data, ze + 48);
39770
- }
39771
- }
39772
- for (var i = 0; i < c; ++i) {
39773
- var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);
39774
- o = no;
39775
- {
39776
- if (!c_2)
39777
- files[fn] = slc(data, b, b + sc);
39778
- else if (c_2 == 8)
39779
- files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) });
39780
- else
39781
- err(14, 'unknown compression type ' + c_2);
39782
- }
39783
- }
39784
- return files;
39547
+ // DEFLATE is a complex format; to read this code, you should probably check the RFC first:
39548
+ // https://tools.ietf.org/html/rfc1951
39549
+ // You may also wish to take a look at the guide I made about this program:
39550
+ // https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad
39551
+ // Some of the following code is similar to that of UZIP.js:
39552
+ // https://github.com/photopea/UZIP.js
39553
+ // However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.
39554
+ // Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint
39555
+ // is better for memory in most engines (I *think*).
39556
+
39557
+ // aliases for shorter compressed code (most minifers don't do this)
39558
+ var u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;
39559
+ // fixed length extra bits
39560
+ var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);
39561
+ // fixed distance extra bits
39562
+ var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);
39563
+ // code length index map
39564
+ var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
39565
+ // get base, reverse index map from extra bits
39566
+ var freb = function (eb, start) {
39567
+ var b = new u16(31);
39568
+ for (var i = 0; i < 31; ++i) {
39569
+ b[i] = start += 1 << eb[i - 1];
39570
+ }
39571
+ // numbers here are at max 18 bits
39572
+ var r = new i32(b[30]);
39573
+ for (var i = 1; i < 30; ++i) {
39574
+ for (var j = b[i]; j < b[i + 1]; ++j) {
39575
+ r[j] = ((j - b[i]) << 5) | i;
39576
+ }
39577
+ }
39578
+ return { b: b, r: r };
39579
+ };
39580
+ var _a = freb(fleb, 2), fl = _a.b, revfl = _a.r;
39581
+ // we can ignore the fact that the other numbers are wrong; they never happen anyway
39582
+ fl[28] = 258, revfl[258] = 28;
39583
+ var _b = freb(fdeb, 0), fd = _b.b;
39584
+ // map of value to reverse (assuming 16 bits)
39585
+ var rev = new u16(32768);
39586
+ for (var i = 0; i < 32768; ++i) {
39587
+ // reverse table algorithm from SO
39588
+ var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1);
39589
+ x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2);
39590
+ x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4);
39591
+ rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1;
39592
+ }
39593
+ // create huffman tree from u8 "map": index -> code length for code index
39594
+ // mb (max bits) must be at most 15
39595
+ // TODO: optimize/split up?
39596
+ var hMap = (function (cd, mb, r) {
39597
+ var s = cd.length;
39598
+ // index
39599
+ var i = 0;
39600
+ // u16 "map": index -> # of codes with bit length = index
39601
+ var l = new u16(mb);
39602
+ // length of cd must be 288 (total # of codes)
39603
+ for (; i < s; ++i) {
39604
+ if (cd[i])
39605
+ ++l[cd[i] - 1];
39606
+ }
39607
+ // u16 "map": index -> minimum code for bit length = index
39608
+ var le = new u16(mb);
39609
+ for (i = 1; i < mb; ++i) {
39610
+ le[i] = (le[i - 1] + l[i - 1]) << 1;
39611
+ }
39612
+ var co;
39613
+ if (r) {
39614
+ // u16 "map": index -> number of actual bits, symbol for code
39615
+ co = new u16(1 << mb);
39616
+ // bits to remove for reverser
39617
+ var rvb = 15 - mb;
39618
+ for (i = 0; i < s; ++i) {
39619
+ // ignore 0 lengths
39620
+ if (cd[i]) {
39621
+ // num encoding both symbol and bits read
39622
+ var sv = (i << 4) | cd[i];
39623
+ // free bits
39624
+ var r_1 = mb - cd[i];
39625
+ // start value
39626
+ var v = le[cd[i] - 1]++ << r_1;
39627
+ // m is end value
39628
+ for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {
39629
+ // every 16 bit value starting with the code yields the same result
39630
+ co[rev[v] >> rvb] = sv;
39631
+ }
39632
+ }
39633
+ }
39634
+ }
39635
+ else {
39636
+ co = new u16(s);
39637
+ for (i = 0; i < s; ++i) {
39638
+ if (cd[i]) {
39639
+ co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]);
39640
+ }
39641
+ }
39642
+ }
39643
+ return co;
39644
+ });
39645
+ // fixed length tree
39646
+ var flt = new u8(288);
39647
+ for (var i = 0; i < 144; ++i)
39648
+ flt[i] = 8;
39649
+ for (var i = 144; i < 256; ++i)
39650
+ flt[i] = 9;
39651
+ for (var i = 256; i < 280; ++i)
39652
+ flt[i] = 7;
39653
+ for (var i = 280; i < 288; ++i)
39654
+ flt[i] = 8;
39655
+ // fixed distance tree
39656
+ var fdt = new u8(32);
39657
+ for (var i = 0; i < 32; ++i)
39658
+ fdt[i] = 5;
39659
+ // fixed length map
39660
+ var flrm = /*#__PURE__*/ hMap(flt, 9, 1);
39661
+ // fixed distance map
39662
+ var fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);
39663
+ // find max of array
39664
+ var max = function (a) {
39665
+ var m = a[0];
39666
+ for (var i = 1; i < a.length; ++i) {
39667
+ if (a[i] > m)
39668
+ m = a[i];
39669
+ }
39670
+ return m;
39671
+ };
39672
+ // read d, starting at bit p and mask with m
39673
+ var bits = function (d, p, m) {
39674
+ var o = (p / 8) | 0;
39675
+ return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;
39676
+ };
39677
+ // read d, starting at bit p continuing for at least 16 bits
39678
+ var bits16 = function (d, p) {
39679
+ var o = (p / 8) | 0;
39680
+ return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));
39681
+ };
39682
+ // get end of byte
39683
+ var shft = function (p) { return ((p + 7) / 8) | 0; };
39684
+ // typed array slice - allows garbage collector to free original reference,
39685
+ // while being more compatible than .slice
39686
+ var slc = function (v, s, e) {
39687
+ if (s == null || s < 0)
39688
+ s = 0;
39689
+ if (e == null || e > v.length)
39690
+ e = v.length;
39691
+ // can't use .constructor in case user-supplied
39692
+ return new u8(v.subarray(s, e));
39693
+ };
39694
+ // error codes
39695
+ var ec = [
39696
+ 'unexpected EOF',
39697
+ 'invalid block type',
39698
+ 'invalid length/literal',
39699
+ 'invalid distance',
39700
+ 'stream finished',
39701
+ 'no stream handler',
39702
+ ,
39703
+ 'no callback',
39704
+ 'invalid UTF-8 data',
39705
+ 'extra field too long',
39706
+ 'date not in range 1980-2099',
39707
+ 'filename too long',
39708
+ 'stream finishing',
39709
+ 'invalid zip data'
39710
+ // determined by unknown compression method
39711
+ ];
39712
+ var err = function (ind, msg, nt) {
39713
+ var e = new Error(msg || ec[ind]);
39714
+ e.code = ind;
39715
+ if (Error.captureStackTrace)
39716
+ Error.captureStackTrace(e, err);
39717
+ if (!nt)
39718
+ throw e;
39719
+ return e;
39720
+ };
39721
+ // expands raw DEFLATE data
39722
+ var inflt = function (dat, st, buf, dict) {
39723
+ // source length dict length
39724
+ var sl = dat.length, dl = dict ? dict.length : 0;
39725
+ if (!sl || st.f && !st.l)
39726
+ return buf || new u8(0);
39727
+ var noBuf = !buf;
39728
+ // have to estimate size
39729
+ var resize = noBuf || st.i != 2;
39730
+ // no state
39731
+ var noSt = st.i;
39732
+ // Assumes roughly 33% compression ratio average
39733
+ if (noBuf)
39734
+ buf = new u8(sl * 3);
39735
+ // ensure buffer can fit at least l elements
39736
+ var cbuf = function (l) {
39737
+ var bl = buf.length;
39738
+ // need to increase size to fit
39739
+ if (l > bl) {
39740
+ // Double or set to necessary, whichever is greater
39741
+ var nbuf = new u8(Math.max(bl * 2, l));
39742
+ nbuf.set(buf);
39743
+ buf = nbuf;
39744
+ }
39745
+ };
39746
+ // last chunk bitpos bytes
39747
+ var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;
39748
+ // total bits
39749
+ var tbts = sl * 8;
39750
+ do {
39751
+ if (!lm) {
39752
+ // BFINAL - this is only 1 when last chunk is next
39753
+ final = bits(dat, pos, 1);
39754
+ // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman
39755
+ var type = bits(dat, pos + 1, 3);
39756
+ pos += 3;
39757
+ if (!type) {
39758
+ // go to end of byte boundary
39759
+ var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;
39760
+ if (t > sl) {
39761
+ if (noSt)
39762
+ err(0);
39763
+ break;
39764
+ }
39765
+ // ensure size
39766
+ if (resize)
39767
+ cbuf(bt + l);
39768
+ // Copy over uncompressed data
39769
+ buf.set(dat.subarray(s, t), bt);
39770
+ // Get new bitpos, update byte count
39771
+ st.b = bt += l, st.p = pos = t * 8, st.f = final;
39772
+ continue;
39773
+ }
39774
+ else if (type == 1)
39775
+ lm = flrm, dm = fdrm, lbt = 9, dbt = 5;
39776
+ else if (type == 2) {
39777
+ // literal lengths
39778
+ var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;
39779
+ var tl = hLit + bits(dat, pos + 5, 31) + 1;
39780
+ pos += 14;
39781
+ // length+distance tree
39782
+ var ldt = new u8(tl);
39783
+ // code length tree
39784
+ var clt = new u8(19);
39785
+ for (var i = 0; i < hcLen; ++i) {
39786
+ // use index map to get real code
39787
+ clt[clim[i]] = bits(dat, pos + i * 3, 7);
39788
+ }
39789
+ pos += hcLen * 3;
39790
+ // code lengths bits
39791
+ var clb = max(clt), clbmsk = (1 << clb) - 1;
39792
+ // code lengths map
39793
+ var clm = hMap(clt, clb, 1);
39794
+ for (var i = 0; i < tl;) {
39795
+ var r = clm[bits(dat, pos, clbmsk)];
39796
+ // bits read
39797
+ pos += r & 15;
39798
+ // symbol
39799
+ var s = r >> 4;
39800
+ // code length to copy
39801
+ if (s < 16) {
39802
+ ldt[i++] = s;
39803
+ }
39804
+ else {
39805
+ // copy count
39806
+ var c = 0, n = 0;
39807
+ if (s == 16)
39808
+ n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];
39809
+ else if (s == 17)
39810
+ n = 3 + bits(dat, pos, 7), pos += 3;
39811
+ else if (s == 18)
39812
+ n = 11 + bits(dat, pos, 127), pos += 7;
39813
+ while (n--)
39814
+ ldt[i++] = c;
39815
+ }
39816
+ }
39817
+ // length tree distance tree
39818
+ var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);
39819
+ // max length bits
39820
+ lbt = max(lt);
39821
+ // max dist bits
39822
+ dbt = max(dt);
39823
+ lm = hMap(lt, lbt, 1);
39824
+ dm = hMap(dt, dbt, 1);
39825
+ }
39826
+ else
39827
+ err(1);
39828
+ if (pos > tbts) {
39829
+ if (noSt)
39830
+ err(0);
39831
+ break;
39832
+ }
39833
+ }
39834
+ // Make sure the buffer can hold this + the largest possible addition
39835
+ // Maximum chunk size (practically, theoretically infinite) is 2^17
39836
+ if (resize)
39837
+ cbuf(bt + 131072);
39838
+ var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;
39839
+ var lpos = pos;
39840
+ for (;; lpos = pos) {
39841
+ // bits read, code
39842
+ var c = lm[bits16(dat, pos) & lms], sym = c >> 4;
39843
+ pos += c & 15;
39844
+ if (pos > tbts) {
39845
+ if (noSt)
39846
+ err(0);
39847
+ break;
39848
+ }
39849
+ if (!c)
39850
+ err(2);
39851
+ if (sym < 256)
39852
+ buf[bt++] = sym;
39853
+ else if (sym == 256) {
39854
+ lpos = pos, lm = null;
39855
+ break;
39856
+ }
39857
+ else {
39858
+ var add = sym - 254;
39859
+ // no extra bits needed if less
39860
+ if (sym > 264) {
39861
+ // index
39862
+ var i = sym - 257, b = fleb[i];
39863
+ add = bits(dat, pos, (1 << b) - 1) + fl[i];
39864
+ pos += b;
39865
+ }
39866
+ // dist
39867
+ var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;
39868
+ if (!d)
39869
+ err(3);
39870
+ pos += d & 15;
39871
+ var dt = fd[dsym];
39872
+ if (dsym > 3) {
39873
+ var b = fdeb[dsym];
39874
+ dt += bits16(dat, pos) & (1 << b) - 1, pos += b;
39875
+ }
39876
+ if (pos > tbts) {
39877
+ if (noSt)
39878
+ err(0);
39879
+ break;
39880
+ }
39881
+ if (resize)
39882
+ cbuf(bt + 131072);
39883
+ var end = bt + add;
39884
+ if (bt < dt) {
39885
+ var shift = dl - dt, dend = Math.min(dt, end);
39886
+ if (shift + bt < 0)
39887
+ err(3);
39888
+ for (; bt < dend; ++bt)
39889
+ buf[bt] = dict[shift + bt];
39890
+ }
39891
+ for (; bt < end; ++bt)
39892
+ buf[bt] = buf[bt - dt];
39893
+ }
39894
+ }
39895
+ st.l = lm, st.p = lpos, st.b = bt, st.f = final;
39896
+ if (lm)
39897
+ final = 1, st.m = lbt, st.d = dm, st.n = dbt;
39898
+ } while (!final);
39899
+ // don't reallocate for streams or user buffers
39900
+ return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);
39901
+ };
39902
+ // empty
39903
+ var et = /*#__PURE__*/ new u8(0);
39904
+ // read 2 bytes
39905
+ var b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };
39906
+ // read 4 bytes
39907
+ var b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };
39908
+ var b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };
39909
+ /**
39910
+ * Expands DEFLATE data with no wrapper
39911
+ * @param data The data to decompress
39912
+ * @param opts The decompression options
39913
+ * @returns The decompressed version of the data
39914
+ */
39915
+ function inflateSync(data, opts) {
39916
+ return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);
39917
+ }
39918
+ // text decoder
39919
+ var td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();
39920
+ // text decoder stream
39921
+ var tds = 0;
39922
+ try {
39923
+ td.decode(et, { stream: true });
39924
+ tds = 1;
39925
+ }
39926
+ catch (e) { }
39927
+ // decode UTF8
39928
+ var dutf8 = function (d) {
39929
+ for (var r = '', i = 0;;) {
39930
+ var c = d[i++];
39931
+ var eb = (c > 127) + (c > 223) + (c > 239);
39932
+ if (i + eb > d.length)
39933
+ return { s: r, r: slc(d, i - 1) };
39934
+ if (!eb)
39935
+ r += String.fromCharCode(c);
39936
+ else if (eb == 3) {
39937
+ c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,
39938
+ r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));
39939
+ }
39940
+ else if (eb & 1)
39941
+ r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));
39942
+ else
39943
+ r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));
39944
+ }
39945
+ };
39946
+ /**
39947
+ * Converts a Uint8Array to a string
39948
+ * @param dat The data to decode to string
39949
+ * @param latin1 Whether or not to interpret the data as Latin-1. This should
39950
+ * not need to be true unless encoding to binary string.
39951
+ * @returns The original UTF-8/Latin-1 string
39952
+ */
39953
+ function strFromU8(dat, latin1) {
39954
+ if (latin1) {
39955
+ var r = '';
39956
+ for (var i = 0; i < dat.length; i += 16384)
39957
+ r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));
39958
+ return r;
39959
+ }
39960
+ else if (td) {
39961
+ return td.decode(dat);
39962
+ }
39963
+ else {
39964
+ var _a = dutf8(dat), s = _a.s, r = _a.r;
39965
+ if (r.length)
39966
+ err(8);
39967
+ return s;
39968
+ }
39969
+ }
39970
+ // skip local zip header
39971
+ var slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };
39972
+ // read zip header
39973
+ var zh = function (d, b, z) {
39974
+ var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);
39975
+ var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];
39976
+ return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];
39977
+ };
39978
+ // read zip64 extra field
39979
+ var z64e = function (d, b) {
39980
+ for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))
39981
+ ;
39982
+ return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];
39983
+ };
39984
+ /**
39985
+ * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better
39986
+ * performance with more than one file.
39987
+ * @param data The raw compressed ZIP file
39988
+ * @param opts The ZIP extraction options
39989
+ * @returns The decompressed files
39990
+ */
39991
+ function unzipSync(data, opts) {
39992
+ var files = {};
39993
+ var e = data.length - 22;
39994
+ for (; b4(data, e) != 0x6054B50; --e) {
39995
+ if (!e || data.length - e > 65558)
39996
+ err(13);
39997
+ }
39998
+ var c = b2(data, e + 8);
39999
+ if (!c)
40000
+ return {};
40001
+ var o = b4(data, e + 16);
40002
+ var z = o == 4294967295 || c == 65535;
40003
+ if (z) {
40004
+ var ze = b4(data, e - 12);
40005
+ z = b4(data, ze) == 0x6064B50;
40006
+ if (z) {
40007
+ c = b4(data, ze + 32);
40008
+ o = b4(data, ze + 48);
40009
+ }
40010
+ }
40011
+ for (var i = 0; i < c; ++i) {
40012
+ var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);
40013
+ o = no;
40014
+ {
40015
+ if (!c_2)
40016
+ files[fn] = slc(data, b, b + sc);
40017
+ else if (c_2 == 8)
40018
+ files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) });
40019
+ else
40020
+ err(14, 'unknown compression type ' + c_2);
40021
+ }
40022
+ }
40023
+ return files;
39785
40024
  }
39786
40025
 
39787
40026
  class UnLitMaterial extends Material {
@@ -40552,7 +40791,7 @@ fn CsMain( @builtin(workgroup_id) workgroup_id : vec3<u32> , @builtin(global_inv
40552
40791
  }
40553
40792
  }
40554
40793
 
40555
- const version = "1.0.11";
40794
+ const version = "1.0.12";
40556
40795
 
40557
40796
  class Engine3D {
40558
40797
  /**
@@ -45065,9 +45304,9 @@ fn frag(){
45065
45304
  }
45066
45305
  }
45067
45306
 
45068
- var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
45069
- var __decorateClass$a = (decorators, target, key, kind) => {
45070
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
45307
+ var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
45308
+ var __decorateClass$c = (decorators, target, key, kind) => {
45309
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
45071
45310
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
45072
45311
  if (decorator = decorators[i])
45073
45312
  result = (decorator(result)) || result;
@@ -45091,7 +45330,7 @@ fn frag(){
45091
45330
  shaderState.depthCompare = GPUCompareFunction.less;
45092
45331
  }
45093
45332
  };
45094
- exports.SkyShader = __decorateClass$a([
45333
+ exports.SkyShader = __decorateClass$c([
45095
45334
  RegisterShader(exports.SkyShader, "SkyShader")
45096
45335
  ], exports.SkyShader);
45097
45336
 
@@ -45889,9 +46128,9 @@ fn frag(){
45889
46128
  }
45890
46129
  }
45891
46130
 
45892
- var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
45893
- var __decorateClass$9 = (decorators, target, key, kind) => {
45894
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
46131
+ var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
46132
+ var __decorateClass$b = (decorators, target, key, kind) => {
46133
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
45895
46134
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
45896
46135
  if (decorator = decorators[i])
45897
46136
  result = (decorator(result)) || result;
@@ -46095,7 +46334,7 @@ fn frag(){
46095
46334
  this._currentClipState.weight = 1;
46096
46335
  }
46097
46336
  };
46098
- exports.SkeletonAnimationComponent = __decorateClass$9([
46337
+ exports.SkeletonAnimationComponent = __decorateClass$b([
46099
46338
  RegisterComponent(exports.SkeletonAnimationComponent, "SkeletonAnimationComponent")
46100
46339
  ], exports.SkeletonAnimationComponent);
46101
46340
  class SkeletonAnimationCrossFadeState {
@@ -46131,9 +46370,9 @@ fn frag(){
46131
46370
  }
46132
46371
  }
46133
46372
 
46134
- var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
46135
- var __decorateClass$8 = (decorators, target, key, kind) => {
46136
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
46373
+ var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
46374
+ var __decorateClass$a = (decorators, target, key, kind) => {
46375
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
46137
46376
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
46138
46377
  if (decorator = decorators[i])
46139
46378
  result = (decorator(result)) || result;
@@ -46544,7 +46783,7 @@ fn frag(){
46544
46783
  return dst;
46545
46784
  }
46546
46785
  };
46547
- exports.AnimatorComponent = __decorateClass$8([
46786
+ exports.AnimatorComponent = __decorateClass$a([
46548
46787
  RegisterComponent(exports.AnimatorComponent, "AnimatorComponent")
46549
46788
  ], exports.AnimatorComponent);
46550
46789
  class PropertyAnimationClipState {
@@ -47301,9 +47540,9 @@ fn frag(){
47301
47540
  }
47302
47541
  }
47303
47542
 
47304
- var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
47305
- var __decorateClass$7 = (decorators, target, key, kind) => {
47306
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
47543
+ var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
47544
+ var __decorateClass$9 = (decorators, target, key, kind) => {
47545
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
47307
47546
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
47308
47547
  if (decorator = decorators[i])
47309
47548
  result = (decorator(result)) || result;
@@ -47452,7 +47691,7 @@ fn frag(){
47452
47691
  super.nodeUpdate(view, passType, renderPassState, clusterLightingBuffer);
47453
47692
  }
47454
47693
  };
47455
- exports.SkinnedMeshRenderer2 = __decorateClass$7([
47694
+ exports.SkinnedMeshRenderer2 = __decorateClass$9([
47456
47695
  RegisterComponent(exports.SkinnedMeshRenderer2, "SkinnedMeshRenderer2")
47457
47696
  ], exports.SkinnedMeshRenderer2);
47458
47697
 
@@ -52585,9 +52824,9 @@ fn frag(){
52585
52824
  }
52586
52825
  }
52587
52826
 
52588
- var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
52589
- var __decorateClass$6 = (decorators, target, key, kind) => {
52590
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
52827
+ var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
52828
+ var __decorateClass$8 = (decorators, target, key, kind) => {
52829
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
52591
52830
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
52592
52831
  if (decorator = decorators[i])
52593
52832
  result = (decorator(result)) || result;
@@ -52664,10 +52903,86 @@ fn frag(){
52664
52903
  debugDraw(show) {
52665
52904
  }
52666
52905
  };
52667
- exports.Light = __decorateClass$6([
52906
+ exports.Light = __decorateClass$8([
52668
52907
  RegisterComponent(exports.Light, "Light")
52669
52908
  ], exports.Light);
52670
52909
 
52910
+ var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
52911
+ var __decorateClass$7 = (decorators, target, key, kind) => {
52912
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
52913
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
52914
+ if (decorator = decorators[i])
52915
+ result = (decorator(result)) || result;
52916
+ return result;
52917
+ };
52918
+ exports.FatLineRenderer = class FatLineRenderer extends RenderNode {
52919
+ _fatLineMaterial = null;
52920
+ _fatLineGeometry = null;
52921
+ constructor() {
52922
+ super();
52923
+ }
52924
+ onEnable() {
52925
+ super.onEnable();
52926
+ }
52927
+ onDisable() {
52928
+ super.onDisable();
52929
+ }
52930
+ cloneTo(obj) {
52931
+ const component = obj.addComponent(exports.FatLineRenderer);
52932
+ component.copyComponent(this);
52933
+ }
52934
+ copyComponent(from) {
52935
+ super.copyComponent(from);
52936
+ return this;
52937
+ }
52938
+ /**
52939
+ * Set FatLine geometry
52940
+ */
52941
+ set geometry(value) {
52942
+ super.geometry = value;
52943
+ this._fatLineGeometry = value;
52944
+ if (value) {
52945
+ this.instanceCount = value.instanceCount;
52946
+ if (this._fatLineMaterial && value.instanceBuffer) {
52947
+ this._fatLineMaterial.setInstanceBuffer(value.instanceBuffer);
52948
+ }
52949
+ }
52950
+ }
52951
+ get geometry() {
52952
+ return this._fatLineGeometry;
52953
+ }
52954
+ /**
52955
+ * Set FatLine material
52956
+ */
52957
+ set material(value) {
52958
+ this.materials = [value];
52959
+ this._fatLineMaterial = value;
52960
+ if (this._fatLineGeometry && this._fatLineGeometry.instanceBuffer) {
52961
+ value.setInstanceBuffer(this._fatLineGeometry.instanceBuffer);
52962
+ }
52963
+ }
52964
+ get material() {
52965
+ return this._fatLineMaterial;
52966
+ }
52967
+ /**
52968
+ * Override nodeUpdate to automatically update FatLine-specific uniforms
52969
+ */
52970
+ nodeUpdate(view, passType, renderPassState, clusterLightingBuffer) {
52971
+ if (this._fatLineMaterial && this.object3D) {
52972
+ this._fatLineMaterial.setModelMatrix(this.object3D.transform.worldMatrix);
52973
+ const width = webGPUContext.presentationSize[0];
52974
+ const height = webGPUContext.presentationSize[1];
52975
+ if (width > 0 && height > 0) {
52976
+ this._fatLineMaterial.resolution = new Vector2(width, height);
52977
+ }
52978
+ }
52979
+ super.nodeUpdate(view, passType, renderPassState, clusterLightingBuffer);
52980
+ }
52981
+ };
52982
+ exports.FatLineRenderer = __decorateClass$7([
52983
+ RegisterComponent(exports.FatLineRenderer, "FatLineRenderer")
52984
+ ], exports.FatLineRenderer);
52985
+
52671
52986
  class Probe extends exports.Object3D {
52672
52987
  index = 0;
52673
52988
  drawCallFrame = -1;
@@ -52966,9 +53281,9 @@ fn frag(){
52966
53281
  }
52967
53282
  }
52968
53283
 
52969
- var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
52970
- var __decorateClass$5 = (decorators, target, key, kind) => {
52971
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
53284
+ var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
53285
+ var __decorateClass$6 = (decorators, target, key, kind) => {
53286
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
52972
53287
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
52973
53288
  if (decorator = decorators[i])
52974
53289
  result = (decorator(result)) || result;
@@ -52994,13 +53309,13 @@ fn frag(){
52994
53309
  }
52995
53310
  }
52996
53311
  };
52997
- exports.MeshFilter = __decorateClass$5([
53312
+ exports.MeshFilter = __decorateClass$6([
52998
53313
  RegisterComponent(exports.MeshFilter, "MeshFilter")
52999
53314
  ], exports.MeshFilter);
53000
53315
 
53001
- var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
53002
- var __decorateClass$4 = (decorators, target, key, kind) => {
53003
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
53316
+ var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
53317
+ var __decorateClass$5 = (decorators, target, key, kind) => {
53318
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
53004
53319
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
53005
53320
  if (decorator = decorators[i])
53006
53321
  result = (decorator(result)) || result;
@@ -53126,7 +53441,7 @@ fn frag(){
53126
53441
  super.nodeUpdate(view, passType, renderPassState, clusterLightingBuffer);
53127
53442
  }
53128
53443
  };
53129
- exports.SkinnedMeshRenderer = __decorateClass$4([
53444
+ exports.SkinnedMeshRenderer = __decorateClass$5([
53130
53445
  RegisterComponent(exports.SkinnedMeshRenderer, "SkinnedMeshRenderer")
53131
53446
  ], exports.SkinnedMeshRenderer);
53132
53447
 
@@ -53958,6 +54273,230 @@ fn frag(){
53958
54273
  }
53959
54274
  }
53960
54275
 
54276
+ class FatLineGeometry extends GeometryBase {
54277
+ _instanceBuffer;
54278
+ _instanceData;
54279
+ _instanceCount = 0;
54280
+ constructor() {
54281
+ super();
54282
+ this.initBaseGeometry();
54283
+ }
54284
+ /**
54285
+ * Initialize base quad geometry (shared by all line segments)
54286
+ * This is similar to ThreeJS LineSegmentsGeometry base geometry
54287
+ */
54288
+ initBaseGeometry() {
54289
+ const positions = new Float32Array([
54290
+ -1,
54291
+ 2,
54292
+ 0,
54293
+ 1,
54294
+ 2,
54295
+ 0,
54296
+ // Top endcap
54297
+ -1,
54298
+ 1,
54299
+ 0,
54300
+ 1,
54301
+ 1,
54302
+ 0,
54303
+ // Top of line segment
54304
+ -1,
54305
+ 0,
54306
+ 0,
54307
+ 1,
54308
+ 0,
54309
+ 0,
54310
+ // Bottom of line segment
54311
+ -1,
54312
+ -1,
54313
+ 0,
54314
+ 1,
54315
+ -1,
54316
+ 0
54317
+ // Bottom endcap
54318
+ ]);
54319
+ const uvs = new Float32Array([
54320
+ -1,
54321
+ 2,
54322
+ 1,
54323
+ 2,
54324
+ -1,
54325
+ 1,
54326
+ 1,
54327
+ 1,
54328
+ -1,
54329
+ -1,
54330
+ 1,
54331
+ -1,
54332
+ -1,
54333
+ -2,
54334
+ 1,
54335
+ -2
54336
+ ]);
54337
+ const indices = new Uint16Array([
54338
+ 0,
54339
+ 2,
54340
+ 1,
54341
+ 2,
54342
+ 3,
54343
+ 1,
54344
+ // First quad
54345
+ 2,
54346
+ 4,
54347
+ 3,
54348
+ 4,
54349
+ 5,
54350
+ 3,
54351
+ // Second quad
54352
+ 4,
54353
+ 6,
54354
+ 5,
54355
+ 6,
54356
+ 7,
54357
+ 5
54358
+ // Third quad
54359
+ ]);
54360
+ this.setIndices(indices);
54361
+ this.setAttribute(VertexAttributeName.position, positions);
54362
+ this.setAttribute(VertexAttributeName.uv, uvs);
54363
+ this.addSubGeometry({
54364
+ indexStart: 0,
54365
+ indexCount: indices.length,
54366
+ vertexStart: 0,
54367
+ vertexCount: positions.length / 3,
54368
+ firstStart: 0,
54369
+ index: 0,
54370
+ topology: 0
54371
+ });
54372
+ }
54373
+ /**
54374
+ * Set line positions from continuous points array
54375
+ * @param positions Array of positions [x1,y1,z1, x2,y2,z2, ...]
54376
+ */
54377
+ setPositions(positions) {
54378
+ const posArray = positions instanceof Float32Array ? positions : new Float32Array(positions);
54379
+ const numPoints = posArray.length / 3;
54380
+ const numSegments = numPoints - 1;
54381
+ if (numSegments <= 0) {
54382
+ console.warn("FatLineGeometry: Need at least 2 points");
54383
+ return this;
54384
+ }
54385
+ const instanceData = new Float32Array(numSegments * 16);
54386
+ for (let i = 0; i < numSegments; i++) {
54387
+ const i0 = i * 3;
54388
+ const i1 = (i + 1) * 3;
54389
+ instanceData[i * 16 + 0] = posArray[i0 + 0];
54390
+ instanceData[i * 16 + 1] = posArray[i0 + 1];
54391
+ instanceData[i * 16 + 2] = posArray[i0 + 2];
54392
+ instanceData[i * 16 + 3] = 0;
54393
+ instanceData[i * 16 + 4] = posArray[i1 + 0];
54394
+ instanceData[i * 16 + 5] = posArray[i1 + 1];
54395
+ instanceData[i * 16 + 6] = posArray[i1 + 2];
54396
+ instanceData[i * 16 + 7] = 0;
54397
+ instanceData[i * 16 + 8] = 1;
54398
+ instanceData[i * 16 + 9] = 1;
54399
+ instanceData[i * 16 + 10] = 1;
54400
+ instanceData[i * 16 + 11] = 0;
54401
+ instanceData[i * 16 + 12] = 1;
54402
+ instanceData[i * 16 + 13] = 1;
54403
+ instanceData[i * 16 + 14] = 1;
54404
+ instanceData[i * 16 + 15] = 0;
54405
+ }
54406
+ this._instanceData = instanceData;
54407
+ this._instanceCount = numSegments;
54408
+ this.computeBoundingBox(posArray);
54409
+ return this;
54410
+ }
54411
+ /**
54412
+ * Set colors for line segments
54413
+ * @param colors Array of colors [r1,g1,b1, r2,g2,b2, ...] for each point
54414
+ */
54415
+ setColors(colors) {
54416
+ const colorArray = colors instanceof Float32Array ? colors : new Float32Array(colors);
54417
+ if (!this._instanceData) {
54418
+ console.warn(
54419
+ "FatLineGeometry: Must call setPositions() before setColors()"
54420
+ );
54421
+ return this;
54422
+ }
54423
+ const numPoints = colorArray.length / 3;
54424
+ const numSegments = numPoints - 1;
54425
+ if (numSegments !== this._instanceCount) {
54426
+ console.warn(
54427
+ "FatLineGeometry: Color array length doesn't match segment count"
54428
+ );
54429
+ return this;
54430
+ }
54431
+ for (let i = 0; i < numSegments; i++) {
54432
+ const i0 = i * 3;
54433
+ const i1 = (i + 1) * 3;
54434
+ this._instanceData[i * 16 + 8] = colorArray[i0 + 0];
54435
+ this._instanceData[i * 16 + 9] = colorArray[i0 + 1];
54436
+ this._instanceData[i * 16 + 10] = colorArray[i0 + 2];
54437
+ this._instanceData[i * 16 + 12] = colorArray[i1 + 0];
54438
+ this._instanceData[i * 16 + 13] = colorArray[i1 + 1];
54439
+ this._instanceData[i * 16 + 14] = colorArray[i1 + 2];
54440
+ }
54441
+ return this;
54442
+ }
54443
+ /**
54444
+ * Compute bounding box from positions
54445
+ */
54446
+ computeBoundingBox(positions) {
54447
+ const min = new Vector3(Infinity, Infinity, Infinity);
54448
+ const max = new Vector3(-Infinity, -Infinity, -Infinity);
54449
+ for (let i = 0; i < positions.length; i += 3) {
54450
+ const x = positions[i];
54451
+ const y = positions[i + 1];
54452
+ const z = positions[i + 2];
54453
+ min.x = Math.min(min.x, x);
54454
+ min.y = Math.min(min.y, y);
54455
+ min.z = Math.min(min.z, z);
54456
+ max.x = Math.max(max.x, x);
54457
+ max.y = Math.max(max.y, y);
54458
+ max.z = Math.max(max.z, z);
54459
+ }
54460
+ const size = Vector3.sub(max, min);
54461
+ this.bounds = new BoundingBox(Vector3.ZERO.clone(), size);
54462
+ this.bounds.setFromMinMax(min, max);
54463
+ }
54464
+ /**
54465
+ * Get instance data for GPU upload
54466
+ */
54467
+ get instanceData() {
54468
+ return this._instanceData;
54469
+ }
54470
+ /**
54471
+ * Get number of line segments (instances)
54472
+ */
54473
+ get instanceCount() {
54474
+ return this._instanceCount;
54475
+ }
54476
+ /**
54477
+ * Get or create instance buffer
54478
+ */
54479
+ get instanceBuffer() {
54480
+ if (!this._instanceBuffer && this._instanceData) {
54481
+ this._instanceBuffer = new StorageGPUBuffer(
54482
+ this._instanceData.byteLength
54483
+ );
54484
+ this._instanceBuffer.setFloat32Array("", this._instanceData);
54485
+ this._instanceBuffer.apply();
54486
+ }
54487
+ return this._instanceBuffer;
54488
+ }
54489
+ /**
54490
+ * Update instance buffer with new data
54491
+ */
54492
+ updateInstanceBuffer() {
54493
+ if (this._instanceBuffer && this._instanceData) {
54494
+ this._instanceBuffer.setFloat32Array("", this._instanceData);
54495
+ this._instanceBuffer.apply();
54496
+ }
54497
+ }
54498
+ }
54499
+
53961
54500
  class VertexBufferLayout {
53962
54501
  name;
53963
54502
  offset;
@@ -59228,9 +59767,9 @@ fn frag(){
59228
59767
  }
59229
59768
  }
59230
59769
 
59231
- var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
59232
- var __decorateClass$3 = (decorators, target, key, kind) => {
59233
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
59770
+ var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
59771
+ var __decorateClass$4 = (decorators, target, key, kind) => {
59772
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
59234
59773
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
59235
59774
  if (decorator = decorators[i])
59236
59775
  result = (decorator(result)) || result;
@@ -59349,13 +59888,13 @@ fn frag(){
59349
59888
  }
59350
59889
  }
59351
59890
  };
59352
- exports.LitSSSShader = __decorateClass$3([
59891
+ exports.LitSSSShader = __decorateClass$4([
59353
59892
  RegisterShader(exports.LitSSSShader, "LitSSSShader")
59354
59893
  ], exports.LitSSSShader);
59355
59894
 
59356
- var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
59357
- var __decorateClass$2 = (decorators, target, key, kind) => {
59358
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
59895
+ var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
59896
+ var __decorateClass$3 = (decorators, target, key, kind) => {
59897
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
59359
59898
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
59360
59899
  if (decorator = decorators[i])
59361
59900
  result = (decorator(result)) || result;
@@ -59451,7 +59990,7 @@ fn frag(){
59451
59990
  }
59452
59991
  }
59453
59992
  };
59454
- exports.LitShader = __decorateClass$2([
59993
+ exports.LitShader = __decorateClass$3([
59455
59994
  RegisterShader(exports.LitShader, "LitShader")
59456
59995
  ], exports.LitShader);
59457
59996
 
@@ -59610,6 +60149,47 @@ fn frag(){
59610
60149
  }
59611
60150
  }
59612
60151
 
60152
+ var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
60153
+ var __decorateClass$2 = (decorators, target, key, kind) => {
60154
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
60155
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
60156
+ if (decorator = decorators[i])
60157
+ result = (decorator(result)) || result;
60158
+ return result;
60159
+ };
60160
+ exports.FatLineShader = class FatLineShader extends Shader {
60161
+ constructor() {
60162
+ super();
60163
+ const colorShader = new RenderShaderPass("FatLine_VS", "FatLine_FS");
60164
+ colorShader.setShaderEntry(`VertMain`, `FragMain`);
60165
+ this.addRenderPass(colorShader);
60166
+ const shaderState = colorShader.shaderState;
60167
+ shaderState.acceptShadow = false;
60168
+ shaderState.castShadow = false;
60169
+ shaderState.receiveEnv = false;
60170
+ shaderState.acceptGI = false;
60171
+ shaderState.useLight = false;
60172
+ shaderState.cullMode = GPUCullMode.none;
60173
+ shaderState.depthWriteEnabled = true;
60174
+ this.setDefault();
60175
+ }
60176
+ /**
60177
+ * Set default uniform values
60178
+ */
60179
+ setDefault() {
60180
+ this.setUniformColor(`baseColor`, new Color(1, 1, 1, 1));
60181
+ this.setUniformFloat(`lineWidth`, 1);
60182
+ this.setUniformFloat(`opacity`, 1);
60183
+ this.setUniformVector2(`resolution`, new Vector2(1920, 1080));
60184
+ const identityMatrix = new Matrix4();
60185
+ const pass = this.getDefaultColorShader();
60186
+ pass.setUniform(`modelMatrix`, identityMatrix.rawData);
60187
+ }
60188
+ };
60189
+ exports.FatLineShader = __decorateClass$2([
60190
+ RegisterShader(exports.FatLineShader, "FatLineShader")
60191
+ ], exports.FatLineShader);
60192
+
59613
60193
  var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
59614
60194
  var __decorateClass$1 = (decorators, target, key, kind) => {
59615
60195
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
@@ -59946,6 +60526,78 @@ fn frag(){
59946
60526
  }
59947
60527
  }
59948
60528
 
60529
+ class FatLineMaterial extends Material {
60530
+ constructor() {
60531
+ super();
60532
+ this.shader = new exports.FatLineShader();
60533
+ this.transparent = true;
60534
+ }
60535
+ /**
60536
+ * Set instance buffer for line segments
60537
+ * This should be called after setting the geometry
60538
+ */
60539
+ setInstanceBuffer(buffer) {
60540
+ this.shader.setStorageBuffer("instances", buffer);
60541
+ }
60542
+ /**
60543
+ * Set model matrix for transforming line segments
60544
+ * This should be updated each frame if the object moves
60545
+ */
60546
+ setModelMatrix(matrix) {
60547
+ const pass = this.shader.getDefaultColorShader();
60548
+ pass.setUniform("modelMatrix", matrix.rawData);
60549
+ }
60550
+ /**
60551
+ * Set base color (tint color)
60552
+ */
60553
+ set baseColor(color) {
60554
+ this.shader.setUniformColor(`baseColor`, color);
60555
+ }
60556
+ /**
60557
+ * Get base color (tint color)
60558
+ */
60559
+ get baseColor() {
60560
+ return this.shader.getUniformColor("baseColor");
60561
+ }
60562
+ /**
60563
+ * Set line width in pixels
60564
+ */
60565
+ set lineWidth(value) {
60566
+ this.shader.setUniformFloat(`lineWidth`, value);
60567
+ }
60568
+ /**
60569
+ * Get line width in pixels
60570
+ */
60571
+ get lineWidth() {
60572
+ return this.shader.getUniformFloat("lineWidth");
60573
+ }
60574
+ /**
60575
+ * Set opacity (0-1)
60576
+ */
60577
+ set opacity(value) {
60578
+ this.shader.setUniformFloat(`opacity`, value);
60579
+ }
60580
+ /**
60581
+ * Get opacity (0-1)
60582
+ */
60583
+ get opacity() {
60584
+ return this.shader.getUniformFloat("opacity");
60585
+ }
60586
+ /**
60587
+ * Set viewport resolution for correct pixel-space calculations
60588
+ * This should be set automatically by the renderer
60589
+ */
60590
+ set resolution(value) {
60591
+ this.shader.setUniformVector2(`resolution`, value);
60592
+ }
60593
+ /**
60594
+ * Get viewport resolution
60595
+ */
60596
+ get resolution() {
60597
+ return this.shader.getUniformVector2("resolution");
60598
+ }
60599
+ }
60600
+
59949
60601
  class LambertMaterial extends Material {
59950
60602
  /**
59951
60603
  * @constructor
@@ -65856,6 +66508,10 @@ fn frag(){
65856
66508
  exports.FXAAPost = FXAAPost;
65857
66509
  exports.FXAAShader = FXAAShader;
65858
66510
  exports.FastMathShader = FastMathShader;
66511
+ exports.FatLineGeometry = FatLineGeometry;
66512
+ exports.FatLineMaterial = FatLineMaterial;
66513
+ exports.FatLine_FS = FatLine_FS;
66514
+ exports.FatLine_VS = FatLine_VS;
65859
66515
  exports.FeatureTable = FeatureTable;
65860
66516
  exports.FileLoader = FileLoader;
65861
66517
  exports.FirstPersonCameraController = FirstPersonCameraController;