@rings-webgpu/core 1.0.12 → 1.0.14

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.
@@ -22678,140 +22678,119 @@ const GSplat_VS = (
22678
22678
  /* wgsl */
22679
22679
  `
22680
22680
  #include "GlobalUniform"
22681
-
22682
- struct VSOut {
22683
- @location(auto) vColor : vec4f,
22684
- @location(auto) vTexCoord : vec2f,
22685
- @builtin(position) member : vec4f
22686
- };
22687
-
22688
- // ===== SPLAT CORE VS (from PlayCanvas shader-generator-gsplat.js) =====
22689
-
22690
- // Uniforms (mapped to WebGPU bindings)
22691
- // matrix_model, matrix_view, matrix_projection -> GlobalUniform + MaterialUniform
22692
- // viewport -> calculated from globalUniform.windowWidth/Height
22693
- // tex_params -> materialUniform.tex_params
22694
22681
 
22695
- @group(1) @binding(0) var splatColor : texture_2d<f32>;
22696
- @group(1) @binding(1) var transformA : texture_2d<u32>;
22697
- @group(1) @binding(2) var transformB : texture_2d<f32>;
22698
- @group(1) @binding(4) var splatOrder : texture_2d<u32>;
22682
+ // Constants
22683
+ const ALPHA_THRESHOLD: f32 = 0.00392156863; // 1.0 / 255.0
22684
+ const COV_COMPENSATION: f32 = 0.3;
22685
+ const MAX_SPLAT_SIZE: f32 = 1024.0;
22686
+ const MIN_LAMBDA: f32 = 0.1;
22687
+ const LOG_255: f32 = 5.541263545; // log(255.0) - natural log for WGSL
22699
22688
 
22700
22689
  struct MaterialUniform {
22701
- tex_params: vec4f, // numSplats, textureWidth, validCount, visBoost
22702
22690
  modelMatrix: mat4x4<f32>,
22703
- pixelCull: vec4f, // minPixels, maxPixels, maxPixelCullDistance, reserved
22691
+ tex_params: vec4<f32>, // [numSplats, texWidth, validCount, visBoost]
22692
+ pixelCull: vec4<f32>, // [minPixels, maxPixels, maxPixelCullDistance, batchSize]
22693
+ };
22694
+ @group(1) @binding(0) var<uniform> materialUniform: MaterialUniform;
22695
+
22696
+ struct VSOut {
22697
+ @builtin(position) member: vec4<f32>,
22698
+ @location(0) vColor: vec4<f32>,
22699
+ @location(1) vTexCoord: vec2<f32>,
22704
22700
  };
22705
- @group(1) @binding(3) var<uniform> materialUniform : MaterialUniform;
22706
22701
 
22707
- // Global variables (like PlayCanvas)
22708
- var<private> orderId: u32;
22709
- var<private> splatId: u32;
22710
- var<private> splatUV: vec2<i32>;
22711
- var<private> tA: vec4<u32>;
22702
+ // Textures (like PlayCanvas)
22703
+ @group(1) @binding(1) var splatColor: texture_2d<f32>;
22704
+ @group(1) @binding(2) var transformA: texture_2d<u32>;
22705
+ @group(1) @binding(3) var transformB: texture_2d<f32>;
22706
+ @group(1) @binding(4) var splatOrder: texture_2d<u32>;
22712
22707
 
22713
- // Helper: decode 16-bit half float
22714
- fn unpackHalf(h: u32) -> f32 {
22715
- let s = (h >> 15u) & 0x1u;
22716
- let e = (h >> 10u) & 0x1fu;
22717
- let m = h & 0x3ffu;
22718
- let sign = select(1.0, -1.0, s == 1u);
22719
- if (e == 0u) {
22720
- if (m == 0u) { return 0.0; }
22721
- return sign * (f32(m) * exp2(-24.0));
22722
- } else if (e == 31u) {
22723
- return sign * 65504.0;
22724
- } else {
22725
- return sign * (1.0 + f32(m) / 1024.0) * exp2(f32(i32(e) - 15));
22726
- }
22708
+ struct SplatData {
22709
+ center: vec3f,
22710
+ covA: vec3f,
22711
+ covB: vec3f,
22712
+ };
22713
+
22714
+ // Helper function to discard splat
22715
+ fn discardSplat() -> VSOut {
22716
+ var o: VSOut;
22717
+ o.member = vec4f(0.0, 0.0, 2.0, 1.0);
22718
+ o.vColor = vec4f(0.0);
22719
+ o.vTexCoord = vec2f(0.0);
22720
+ return o;
22727
22721
  }
22728
22722
 
22729
- // === calcSplatUV() - returns bool ===
22730
- fn calcSplatUV(instance_id: u32) -> bool {
22731
- let numSplats = u32(materialUniform.tex_params.x);
22732
- let textureWidth = u32(materialUniform.tex_params.y);
22733
-
22734
- // calculate splat index
22735
- orderId = instance_id;
22736
-
22737
- if (orderId >= numSplats) {
22738
- return false;
22739
- }
22740
-
22723
+ // === calcSplatUV() - returns optional UV ===
22724
+ fn calcSplatUV(orderId: u32, textureWidth: u32, numSplats: u32) -> vec2<i32> {
22741
22725
  let orderUV = vec2<i32>(
22742
22726
  i32(orderId % textureWidth),
22743
22727
  i32(orderId / textureWidth)
22744
22728
  );
22745
22729
 
22746
- // calculate splatUV
22747
- splatId = textureLoad(splatOrder, orderUV, 0).r;
22748
- splatUV = vec2<i32>(
22730
+ let splatId = textureLoad(splatOrder, orderUV, 0).r;
22731
+ return vec2<i32>(
22749
22732
  i32(splatId % textureWidth),
22750
22733
  i32(splatId / textureWidth)
22751
22734
  );
22752
-
22753
- return true;
22754
22735
  }
22755
22736
 
22756
- // === getCenter() - returns vec3 ===
22757
- fn getCenter() -> vec3f {
22758
- tA = textureLoad(transformA, splatUV, 0);
22759
- return vec3f(bitcast<f32>(tA.x), bitcast<f32>(tA.y), bitcast<f32>(tA.z));
22760
- }
22761
-
22762
- // Struct to return covA and covB
22763
- struct CovarianceData {
22764
- covA: vec3f,
22765
- covB: vec3f,
22766
- };
22767
-
22768
- // === getCovariance() - returns struct ===
22769
- fn getCovariance() -> CovarianceData {
22770
- let tB = textureLoad(transformB, splatUV, 0);
22737
+ // === getSplatData() - unified texture loading ===
22738
+ fn getSplatData(splatUV: vec2<i32>) -> SplatData {
22739
+ var data: SplatData;
22771
22740
 
22772
- // Use WGSL built-in unpack2x16float (equivalent to GLSL unpackHalf2x16)
22741
+ // Load both textures once
22742
+ let tA = textureLoad(transformA, splatUV, 0);
22743
+ let tB = textureLoad(transformB, splatUV, 0);
22773
22744
  let tC = unpack2x16float(tA.w);
22774
22745
 
22775
- var result: CovarianceData;
22776
- result.covA = tB.xyz;
22777
- result.covB = vec3f(tC.x, tC.y, tB.w);
22746
+ // Extract center
22747
+ data.center = vec3f(bitcast<f32>(tA.x), bitcast<f32>(tA.y), bitcast<f32>(tA.z));
22778
22748
 
22779
- return result;
22749
+ // Extract covariance
22750
+ data.covA = tB.xyz;
22751
+ data.covB = vec3f(tC.x, tC.y, tB.w);
22752
+
22753
+ return data;
22780
22754
  }
22781
22755
 
22782
22756
  // === calcV1V2() - returns vec4 ===
22783
22757
  fn calcV1V2(splat_cam: vec3f, covA: vec3f, covB: vec3f, W: mat3x3f, viewport: vec2f, projMat: mat4x4f) -> vec4f {
22758
+ // Construct symmetric covariance matrix
22784
22759
  let Vrk = mat3x3f(
22785
22760
  vec3f(covA.x, covA.y, covA.z),
22786
22761
  vec3f(covA.y, covB.x, covB.y),
22787
22762
  vec3f(covA.z, covB.y, covB.z)
22788
22763
  );
22789
22764
 
22765
+ // Calculate Jacobian
22790
22766
  let focal = viewport.x * projMat[0][0];
22791
-
22792
- let J1 = focal / splat_cam.z;
22793
- let J2 = -J1 / splat_cam.z * splat_cam.xy;
22767
+ let inv_z = 1.0 / splat_cam.z;
22768
+ let J1 = focal * inv_z;
22769
+ let J2 = -J1 * inv_z * splat_cam.xy;
22794
22770
  let J = mat3x3f(
22795
22771
  vec3f(J1, 0.0, J2.x),
22796
22772
  vec3f(0.0, J1, J2.y),
22797
22773
  vec3f(0.0, 0.0, 0.0)
22798
22774
  );
22799
22775
 
22776
+ // Project covariance to screen space
22800
22777
  let T = W * J;
22801
22778
  let cov = transpose(T) * Vrk * T;
22802
22779
 
22803
- let diagonal1 = cov[0][0] + 0.3;
22780
+ // Eigenvalue decomposition with compensation
22781
+ let diagonal1 = cov[0][0] + COV_COMPENSATION;
22804
22782
  let offDiagonal = cov[0][1];
22805
- let diagonal2 = cov[1][1] + 0.3;
22783
+ let diagonal2 = cov[1][1] + COV_COMPENSATION;
22806
22784
 
22807
22785
  let mid = 0.5 * (diagonal1 + diagonal2);
22808
- let radius = length(vec2f((diagonal1 - diagonal2) / 2.0, offDiagonal));
22786
+ let radius = length(vec2f((diagonal1 - diagonal2) * 0.5, offDiagonal));
22809
22787
  let lambda1 = mid + radius;
22810
- let lambda2 = max(mid - radius, 0.1);
22788
+ let lambda2 = max(mid - radius, MIN_LAMBDA);
22811
22789
  let diagonalVector = normalize(vec2f(offDiagonal, lambda1 - diagonal1));
22812
22790
 
22813
- let v1 = min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector;
22814
- let v2 = min(sqrt(2.0 * lambda2), 1024.0) * vec2f(diagonalVector.y, -diagonalVector.x);
22791
+ // Calculate axis vectors with size clamping
22792
+ let v1 = min(sqrt(2.0 * lambda1), MAX_SPLAT_SIZE) * diagonalVector;
22793
+ let v2 = min(sqrt(2.0 * lambda2), MAX_SPLAT_SIZE) * vec2f(diagonalVector.y, -diagonalVector.x);
22815
22794
 
22816
22795
  // WebGPU Y-axis flip: WebGPU NDC Y goes from top(-1) to bottom(1), opposite of WebGL
22817
22796
  return vec4f(v1.x, -v1.y, v2.x, -v2.y);
@@ -22822,117 +22801,100 @@ const GSplat_VS = (
22822
22801
  @vertex
22823
22802
  fn VertMain(
22824
22803
  @builtin(vertex_index) vid : u32,
22825
- @builtin(instance_index) iid : u32
22804
+ @builtin(instance_index) iid : u32,
22805
+ @location(0) position: vec3<f32> // vertex_position from mesh (x, y, local_index)
22826
22806
  ) -> VSOut {
22827
- var o: VSOut;
22828
- let discardVec = vec4f(0.0, 0.0, 2.0, 1.0);
22829
-
22830
- // Vertex position array (PlayCanvas uses attribute vec3 with x,y in [-1,1])
22831
- let vertex_position = array<vec2f, 4>(
22832
- vec2f(-2.0, -2.0),
22833
- vec2f( 2.0, -2.0),
22834
- vec2f(-2.0, 2.0),
22835
- vec2f( 2.0, 2.0)
22836
- );
22837
- let vertex_pos = vertex_position[vid & 3u];
22807
+ // Calculate splat ID
22808
+ let batchSize = u32(materialUniform.pixelCull.w);
22809
+ let orderId = iid * batchSize + u32(position.z);
22838
22810
 
22839
- // calculate splat uv
22840
- if (!calcSplatUV(iid)) {
22841
- o.member = discardVec;
22842
- o.vColor = vec4f(0.0);
22843
- o.vTexCoord = vec2f(0.0);
22844
- return o;
22811
+ // Early bounds check
22812
+ let textureWidth = u32(materialUniform.tex_params.y);
22813
+ let numSplats = u32(materialUniform.tex_params.x);
22814
+ if (orderId >= numSplats) {
22815
+ return discardSplat();
22845
22816
  }
22846
22817
 
22847
- // get center
22848
- let center = getCenter();
22818
+ // Calculate splat UV and load all data in one go
22819
+ let splatUV = calcSplatUV(orderId, textureWidth, numSplats);
22820
+ let splatData = getSplatData(splatUV);
22821
+
22822
+ // Load color early for alpha test
22823
+ let color = textureLoad(splatColor, splatUV, 0);
22824
+ if (color.a < ALPHA_THRESHOLD) {
22825
+ return discardSplat();
22826
+ }
22849
22827
 
22850
- // handle transforms
22828
+ // Transform matrices
22829
+ let matrix_model = materialUniform.modelMatrix;
22851
22830
  let matrix_view = globalUniform.viewMat;
22852
22831
  let matrix_projection = globalUniform.projMat;
22853
- let matrix_model = materialUniform.modelMatrix;
22854
-
22855
22832
  let model_view = matrix_view * matrix_model;
22856
- let splat_cam = model_view * vec4f(center, 1.0);
22857
- let splat_proj = matrix_projection * splat_cam;
22858
22833
 
22859
- // Frustum culling: cull splats behind camera
22860
- if (splat_proj.z < 0.0) {
22861
- o.member = discardVec;
22862
- o.vColor = vec4f(0.0);
22863
- o.vTexCoord = vec2f(0.0);
22864
- return o;
22834
+ // Transform center to camera and clip space
22835
+ let splat_cam = model_view * vec4f(splatData.center, 1.0);
22836
+
22837
+ // Early depth culling
22838
+ if (splat_cam.z <= 0.0) {
22839
+ return discardSplat();
22865
22840
  }
22866
22841
 
22867
- // Frustum culling: cull splats outside screen bounds
22868
- // Add margin for splat radius (conservative: ~2x max splat size)
22869
- let ndc = splat_proj.xyz / splat_proj.w;
22870
- let margin = 0.5; // Allow splats near edges to be visible
22871
- if (ndc.x < -1.0 - margin || ndc.x > 1.0 + margin ||
22872
- ndc.y < -1.0 - margin || ndc.y > 1.0 + margin ||
22842
+ let splat_proj = matrix_projection * splat_cam;
22843
+
22844
+ // Frustum culling with NDC check
22845
+ let inv_w = 1.0 / splat_proj.w;
22846
+ let ndc = splat_proj.xyz * inv_w;
22847
+ if (ndc.x < -1.0 || ndc.x > 1.0 ||
22848
+ ndc.y < -1.0 || ndc.y > 1.0 ||
22873
22849
  ndc.z < 0.0 || ndc.z > 1.0) {
22874
- o.member = discardVec;
22875
- o.vColor = vec4f(0.0);
22876
- o.vTexCoord = vec2f(0.0);
22877
- return o;
22850
+ return discardSplat();
22878
22851
  }
22879
22852
 
22880
- // get covariance
22881
- let cov_data = getCovariance();
22882
-
22853
+ // Calculate v1v2 (screen-space ellipse axes)
22883
22854
  let viewport = vec2f(globalUniform.windowWidth, globalUniform.windowHeight);
22884
- let v1v2 = calcV1V2(splat_cam.xyz, cov_data.covA, cov_data.covB, transpose(mat3x3f(model_view[0].xyz, model_view[1].xyz, model_view[2].xyz)), viewport, matrix_projection);
22855
+ let W = transpose(mat3x3f(model_view[0].xyz, model_view[1].xyz, model_view[2].xyz));
22856
+ let v1v2 = calcV1V2(splat_cam.xyz, splatData.covA, splatData.covB, W, viewport, matrix_projection);
22885
22857
 
22886
- // get color
22887
- let color = textureLoad(splatColor, splatUV, 0);
22888
-
22889
- // calculate scale based on alpha
22890
- let scale = min(1.0, sqrt(-log(1.0 / 255.0 / color.a)) / 2.0);
22858
+ // Calculate scale based on alpha (optimized formula)
22859
+ let scale = min(1.0, sqrt(LOG_255 + log(color.a)) * 0.5);
22891
22860
 
22892
- // apply visBoost (size multiplier)
22861
+ // Apply visBoost (size multiplier)
22893
22862
  let visBoost = materialUniform.tex_params.w;
22894
- var v1v2_scaled = v1v2 * scale * visBoost;
22863
+ let v1v2_scaled = v1v2 * (scale * visBoost);
22895
22864
 
22896
- // Pixel coverage culling (min and max thresholds)
22897
- let v1_len_sq = dot(v1v2_scaled.xy, v1v2_scaled.xy);
22898
- let v2_len_sq = dot(v1v2_scaled.zw, v1v2_scaled.zw);
22865
+ // Pixel coverage culling (vectorized squared length calculation)
22866
+ let v1v2_sq = v1v2_scaled * v1v2_scaled;
22867
+ let v1_len_sq = v1v2_sq.x + v1v2_sq.y;
22868
+ let v2_len_sq = v1v2_sq.z + v1v2_sq.w;
22899
22869
 
22900
22870
  let minPixels = materialUniform.pixelCull.x;
22901
22871
  let maxPixels = materialUniform.pixelCull.y;
22902
- let maxPixelCullDistance = materialUniform.pixelCull.z;
22903
22872
 
22904
- // Early out tiny splats (below minimum pixel coverage)
22873
+ // Early out tiny splats
22905
22874
  if (v1_len_sq < minPixels && v2_len_sq < minPixels) {
22906
- o.member = discardVec;
22907
- o.vColor = vec4f(0.0);
22908
- o.vTexCoord = vec2f(0.0);
22909
- return o;
22875
+ return discardSplat();
22910
22876
  }
22911
22877
 
22912
- // Cull oversized splats (above maximum pixel coverage)
22913
- // Only apply to splats close to camera (distance-based condition)
22878
+ // Cull oversized splats
22914
22879
  if (maxPixels > 0.0) {
22915
- // Calculate distance from splat to camera
22880
+ let maxPixelCullDistance = materialUniform.pixelCull.z;
22916
22881
  let splatDistance = length(splat_cam.xyz);
22917
-
22918
- // Only cull oversized splats if they are close to camera
22919
22882
  if (maxPixelCullDistance <= 0.0 || splatDistance < maxPixelCullDistance) {
22920
22883
  let maxAxisSq = maxPixels * maxPixels;
22921
22884
  if (v1_len_sq > maxAxisSq || v2_len_sq > maxAxisSq) {
22922
- o.member = discardVec;
22923
- o.vColor = vec4f(0.0);
22924
- o.vTexCoord = vec2f(0.0);
22925
- return o;
22885
+ return discardSplat();
22926
22886
  }
22927
22887
  }
22928
22888
  }
22929
22889
 
22930
- // gl_Position = splat_proj + vec4((vertex_position.x * v1v2.xy + vertex_position.y * v1v2.zw) / viewport * splat_proj.w, 0, 0);
22931
- o.member = splat_proj + vec4f((vertex_pos.x * v1v2_scaled.xy + vertex_pos.y * v1v2_scaled.zw) / viewport * splat_proj.w, 0.0, 0.0);
22932
-
22933
- // texCoord = vertex_position.xy * scale / 2.0;
22934
- o.vTexCoord = vertex_pos * scale / 2.0;
22890
+ // Final position calculation (optimized)
22891
+ let vertex_pos = position.xy;
22892
+ let inv_viewport = 1.0 / viewport;
22893
+ let offset = (vertex_pos.x * v1v2_scaled.xy + vertex_pos.y * v1v2_scaled.zw) * inv_viewport * splat_proj.w;
22935
22894
 
22895
+ var o: VSOut;
22896
+ o.member = splat_proj + vec4f(offset, 0.0, 0.0);
22897
+ o.vTexCoord = vertex_pos * (scale * 0.5);
22936
22898
  o.vColor = color;
22937
22899
 
22938
22900
  return o;
@@ -22943,31 +22905,29 @@ const GSplat_FS = (
22943
22905
  /* wgsl */
22944
22906
  `
22945
22907
  #include "FragmentOutput"
22908
+
22909
+ // Constants
22910
+ const ALPHA_THRESHOLD: f32 = 0.00392156863; // 1.0 / 255.0
22911
+ const GAUSSIAN_SCALE: f32 = 4.0;
22946
22912
 
22947
- // === evalSplat() - like PlayCanvas splatCoreFS ===
22913
+ // === evalSplat() - optimized gaussian evaluation ===
22948
22914
  fn evalSplat(texCoord: vec2f, color: vec4f) -> vec4f {
22949
22915
  let A = dot(texCoord, texCoord);
22950
- if (A > 1.0) {
22951
- discard;
22952
- }
22953
22916
 
22954
- let B = exp(-A * 4.0) * color.a;
22955
- if (B < 1.0 / 255.0) {
22956
- discard;
22957
- }
22917
+ // Branch-less optimization using select
22918
+ let gaussian = exp(-A * GAUSSIAN_SCALE) * color.a;
22919
+ let alpha = select(gaussian, 0.0, A > 1.0 || gaussian < ALPHA_THRESHOLD);
22958
22920
 
22959
- // TONEMAP_ENABLED branch not implemented (would call toneMap() and gammaCorrectOutput())
22960
- return vec4f(color.rgb, B);
22921
+ return vec4f(color.rgb, alpha);
22961
22922
  }
22962
-
22963
- // === main() - like PlayCanvas splatMainFS ===
22923
+
22964
22924
  @fragment
22965
- fn FragMain(@location(auto) vColor: vec4f, @location(auto) vTexCoord: vec2f) -> FragmentOutput {
22966
- let result = evalSplat(vTexCoord, vColor);
22967
-
22925
+ fn FragMain(
22926
+ @location(0) vColor: vec4<f32>,
22927
+ @location(1) vTexCoord: vec2<f32>
22928
+ ) -> FragmentOutput {
22968
22929
  var o: FragmentOutput;
22969
- o.color = result;
22970
- o.gBuffer = vec4f(0.0);
22930
+ o.color = evalSplat(vTexCoord, vColor);
22971
22931
  return o;
22972
22932
  }
22973
22933
  `
@@ -23192,12 +23152,13 @@ let GSplatShader = class extends Shader {
23192
23152
  const pass = new RenderShaderPass("gsplat_vs_dc", "gsplat_fs_dc");
23193
23153
  pass.passType = PassType.COLOR;
23194
23154
  pass.setShaderEntry("VertMain", "FragMain");
23195
- pass.topology = GPUPrimitiveTopology.triangle_strip;
23155
+ pass.topology = GPUPrimitiveTopology.triangle_list;
23196
23156
  pass.depthWriteEnabled = false;
23197
- pass.cullMode = "none";
23157
+ pass.cullMode = GPUCullMode.none;
23198
23158
  pass.shaderState.transparent = true;
23199
23159
  pass.shaderState.blendMode = BlendMode.NORMAL;
23200
23160
  pass.shaderState.writeMasks = [15, 15];
23161
+ pass.shaderState.castReflection = false;
23201
23162
  this.addRenderPass(pass);
23202
23163
  this.setDefault();
23203
23164
  }
@@ -23216,6 +23177,7 @@ GSplatShader = __decorateClass$k([
23216
23177
  ], GSplatShader);
23217
23178
 
23218
23179
  class GSplatMaterial extends Material {
23180
+ _pixelCullArray = new Float32Array(4);
23219
23181
  constructor() {
23220
23182
  super();
23221
23183
  ShaderLib.register("gsplat_vs_dc", GSplat_VS);
@@ -23231,6 +23193,7 @@ class GSplatMaterial extends Material {
23231
23193
  if (splatOrder) {
23232
23194
  pass.setTexture("splatOrder", splatOrder);
23233
23195
  }
23196
+ pass.shaderState.depthCompare = GPUCompareFunction.less;
23234
23197
  }
23235
23198
  /**
23236
23199
  * Set the model matrix for transforming splats to world space
@@ -23245,9 +23208,13 @@ class GSplatMaterial extends Material {
23245
23208
  * @param maxPixels Maximum pixel coverage (cull oversized splats), default: 0 (disabled)
23246
23209
  * @param maxPixelCullDistance Only cull oversized splats within this distance, 0 = always cull
23247
23210
  */
23248
- setPixelCulling(minPixels, maxPixels, maxPixelCullDistance = 0) {
23211
+ setPixelCulling(minPixels, maxPixels, maxPixelCullDistance = 0, batchSize = 128) {
23212
+ this._pixelCullArray[0] = minPixels;
23213
+ this._pixelCullArray[1] = maxPixels;
23214
+ this._pixelCullArray[2] = maxPixelCullDistance;
23215
+ this._pixelCullArray[3] = batchSize;
23249
23216
  const pass = this.shader.getDefaultColorShader();
23250
- pass.setUniform("pixelCull", new Float32Array([minPixels, maxPixels, maxPixelCullDistance, 0]));
23217
+ pass.setUniform("pixelCull", this._pixelCullArray);
23251
23218
  }
23252
23219
  }
23253
23220
 
@@ -23905,108 +23872,47 @@ class GeometryBase {
23905
23872
  }
23906
23873
  }
23907
23874
 
23908
- class PlaneGeometry extends GeometryBase {
23909
- width;
23910
- height;
23911
- segmentW;
23912
- segmentH;
23913
- up;
23914
- constructor(width, height, segmentW = 1, segmentH = 1, up = Vector3.Y_AXIS) {
23875
+ class GSplatGeometry extends GeometryBase {
23876
+ batchSize;
23877
+ constructor(batchSize = 128) {
23915
23878
  super();
23916
- this.width = width;
23917
- this.height = height;
23918
- this.segmentW = segmentW;
23919
- this.segmentH = segmentH;
23920
- this.up = up;
23921
- this.buildGeometry(this.up);
23922
- }
23923
- buildGeometry(axis) {
23924
- var x, y;
23925
- var numIndices;
23926
- var base;
23927
- var tw = this.segmentW + 1;
23928
- (this.segmentH + 1) * tw;
23929
- this.bounds = new BoundingBox(
23930
- Vector3.ZERO.clone(),
23931
- new Vector3(this.width, 1, this.height)
23932
- );
23933
- numIndices = this.segmentH * this.segmentW * 6;
23934
- let vertexCount = (this.segmentW + 1) * (this.segmentH + 1);
23935
- let position_arr = new Float32Array(vertexCount * 3);
23936
- let normal_arr = new Float32Array(vertexCount * 3);
23937
- let uv_arr = new Float32Array(vertexCount * 2);
23938
- let indices_arr;
23939
- let totalIndexCount = this.segmentW * this.segmentH * 2 * 3;
23940
- if (totalIndexCount >= Uint16Array.length) {
23941
- indices_arr = new Uint32Array(this.segmentW * this.segmentH * 2 * 3);
23942
- } else {
23943
- indices_arr = new Uint16Array(this.segmentW * this.segmentH * 2 * 3);
23944
- }
23945
- numIndices = 0;
23946
- var indexP = 0;
23947
- var indexN = 0;
23948
- var indexU = 0;
23949
- for (var yi = 0; yi <= this.segmentH; ++yi) {
23950
- for (var xi = 0; xi <= this.segmentW; ++xi) {
23951
- x = (xi / this.segmentW - 0.5) * this.width;
23952
- y = (yi / this.segmentH - 0.5) * this.height;
23953
- switch (axis) {
23954
- case Vector3.Y_AXIS:
23955
- position_arr[indexP++] = x;
23956
- position_arr[indexP++] = 0;
23957
- position_arr[indexP++] = y;
23958
- normal_arr[indexN++] = 0;
23959
- normal_arr[indexN++] = 1;
23960
- normal_arr[indexN++] = 0;
23961
- break;
23962
- case Vector3.Z_AXIS:
23963
- position_arr[indexP++] = x;
23964
- position_arr[indexP++] = -y;
23965
- position_arr[indexP++] = 0;
23966
- normal_arr[indexN++] = 0;
23967
- normal_arr[indexN++] = 0;
23968
- normal_arr[indexN++] = 1;
23969
- break;
23970
- case Vector3.X_AXIS:
23971
- position_arr[indexP++] = 0;
23972
- position_arr[indexP++] = x;
23973
- position_arr[indexP++] = y;
23974
- normal_arr[indexN++] = 1;
23975
- normal_arr[indexN++] = 0;
23976
- normal_arr[indexN++] = 0;
23977
- break;
23978
- default:
23979
- position_arr[indexP++] = x;
23980
- position_arr[indexP++] = 0;
23981
- position_arr[indexP++] = y;
23982
- normal_arr[indexN++] = 0;
23983
- normal_arr[indexN++] = 1;
23984
- normal_arr[indexN++] = 0;
23985
- break;
23986
- }
23987
- uv_arr[indexU++] = xi / this.segmentW;
23988
- uv_arr[indexU++] = yi / this.segmentH;
23989
- if (xi != this.segmentW && yi != this.segmentH) {
23990
- base = xi + yi * tw;
23991
- indices_arr[numIndices++] = base + 1;
23992
- indices_arr[numIndices++] = base;
23993
- indices_arr[numIndices++] = base + tw;
23994
- indices_arr[numIndices++] = base + 1;
23995
- indices_arr[numIndices++] = base + tw;
23996
- indices_arr[numIndices++] = base + tw + 1;
23997
- }
23998
- }
23999
- }
24000
- this.setIndices(indices_arr);
24001
- this.setAttribute(VertexAttributeName.position, position_arr);
24002
- this.setAttribute(VertexAttributeName.normal, normal_arr);
24003
- this.setAttribute(VertexAttributeName.uv, uv_arr);
24004
- this.setAttribute(VertexAttributeName.TEXCOORD_1, uv_arr);
23879
+ this.batchSize = batchSize;
23880
+ const meshPositions = new Float32Array(12 * batchSize);
23881
+ for (let i = 0; i < batchSize; ++i) {
23882
+ meshPositions.set([
23883
+ -2,
23884
+ -2,
23885
+ i,
23886
+ 2,
23887
+ -2,
23888
+ i,
23889
+ 2,
23890
+ 2,
23891
+ i,
23892
+ -2,
23893
+ 2,
23894
+ i
23895
+ ], i * 12);
23896
+ }
23897
+ const meshIndices = new Uint32Array(6 * batchSize);
23898
+ for (let i = 0; i < batchSize; ++i) {
23899
+ const b = i * 4;
23900
+ meshIndices.set([
23901
+ 0 + b,
23902
+ 1 + b,
23903
+ 2 + b,
23904
+ 0 + b,
23905
+ 2 + b,
23906
+ 3 + b
23907
+ ], i * 6);
23908
+ }
23909
+ this.setAttribute(VertexAttributeName.position, meshPositions);
23910
+ this.setIndices(meshIndices);
24005
23911
  this.addSubGeometry({
24006
23912
  indexStart: 0,
24007
- indexCount: indices_arr.length,
23913
+ indexCount: meshIndices.length,
24008
23914
  vertexStart: 0,
24009
- vertexCount: 0,
23915
+ vertexCount: meshPositions.length / 3,
24010
23916
  firstStart: 0,
24011
23917
  index: 0,
24012
23918
  topology: 0
@@ -24110,18 +24016,49 @@ class Uint32ArrayTexture extends Texture {
24110
24016
  updateTexture(width, height, data) {
24111
24017
  let device = webGPUContext.device;
24112
24018
  const bytesPerRow = width * 4 * 4;
24113
- const staging = device.createBuffer({
24019
+ device.queue.writeTexture(
24020
+ { texture: this.getGPUTexture() },
24021
+ data.buffer,
24022
+ { bytesPerRow },
24023
+ { width, height, depthOrArrayLayers: 1 }
24024
+ );
24025
+ }
24026
+ }
24027
+
24028
+ class R32UintTexture extends Texture {
24029
+ _dataBuffer;
24030
+ create(width, height, data) {
24031
+ let device = webGPUContext.device;
24032
+ const bytesPerRow = width * 4;
24033
+ this.format = GPUTextureFormat.r32uint;
24034
+ const mipmapCount = 1;
24035
+ this.createTextureDescriptor(width, height, mipmapCount, this.format);
24036
+ const textureDataBuffer = this._dataBuffer = device.createBuffer({
24114
24037
  size: data.byteLength,
24115
24038
  usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.COPY_SRC
24116
24039
  });
24117
- device.queue.writeBuffer(staging, 0, data.buffer);
24040
+ device.queue.writeBuffer(textureDataBuffer, 0, data.buffer);
24118
24041
  const encoder = device.createCommandEncoder();
24119
24042
  encoder.copyBufferToTexture(
24120
- { buffer: staging, bytesPerRow },
24043
+ { buffer: textureDataBuffer, bytesPerRow },
24121
24044
  { texture: this.getGPUTexture() },
24122
24045
  { width, height, depthOrArrayLayers: 1 }
24123
24046
  );
24124
24047
  device.queue.submit([encoder.finish()]);
24048
+ this.samplerBindingLayout.type = `non-filtering`;
24049
+ this.textureBindingLayout.sampleType = `uint`;
24050
+ this.gpuSampler = device.createSampler({});
24051
+ return this;
24052
+ }
24053
+ updateTexture(width, height, data) {
24054
+ let device = webGPUContext.device;
24055
+ const bytesPerRow = width * 4;
24056
+ device.queue.writeTexture(
24057
+ { texture: this.getGPUTexture() },
24058
+ data.buffer,
24059
+ { bytesPerRow },
24060
+ { width, height, depthOrArrayLayers: 1 }
24061
+ );
24125
24062
  }
24126
24063
  }
24127
24064
 
@@ -24263,14 +24200,15 @@ let GSplatRenderer = class extends RenderNode {
24263
24200
  // Web Worker for sorting
24264
24201
  _sortWorker;
24265
24202
  _lastSentTime = 0;
24266
- _minIntervalMs = 0;
24267
- // No throttle for immediate sorting
24203
+ _minIntervalMs = 16;
24268
24204
  _centersSent = false;
24269
24205
  _lastViewMatrixHash = 0;
24270
24206
  // Adaptive sorting optimization
24271
24207
  _lastCameraSpeed = 0;
24272
24208
  _adaptiveSorting = true;
24273
24209
  // Enable adaptive sorting by default
24210
+ _lastPixelCullParams = "";
24211
+ _texturesInitialized = false;
24274
24212
  // LOD (Level of Detail) system
24275
24213
  _lodEnabled = false;
24276
24214
  _lodDistances = [5, 10, 20, 40];
@@ -24292,6 +24230,11 @@ let GSplatRenderer = class extends RenderNode {
24292
24230
  get fullCount() {
24293
24231
  return this._fullCount;
24294
24232
  }
24233
+ // Batched rendering
24234
+ _batchSize = 128;
24235
+ // Splats per draw call
24236
+ instanceCount = 0;
24237
+ // For InstanceDrawComponent compatibility
24295
24238
  constructor() {
24296
24239
  super();
24297
24240
  }
@@ -24307,24 +24250,20 @@ let GSplatRenderer = class extends RenderNode {
24307
24250
  this.texParams = new Float32Array([this.count, this.size.x, this.count, 1]);
24308
24251
  this._positions = asset.position;
24309
24252
  const total = this.size.x * this.size.y;
24310
- this._orderData = new Uint32Array(total * 4);
24253
+ this._orderData = new Uint32Array(total);
24311
24254
  for (let i = 0; i < total; i++) {
24312
- const src = i < this.count ? i : this.count > 0 ? this.count - 1 : 0;
24313
- const base = i * 4;
24314
- this._orderData[base + 0] = src;
24315
- this._orderData[base + 1] = 0;
24316
- this._orderData[base + 2] = 0;
24317
- this._orderData[base + 3] = 0;
24318
- }
24319
- this.splatOrder = new Uint32ArrayTexture().create(this.size.x, this.size.y, this._orderData);
24255
+ this._orderData[i] = i < this.count ? i : this.count > 0 ? this.count - 1 : 0;
24256
+ }
24257
+ this.splatOrder = new R32UintTexture().create(this.size.x, this.size.y, this._orderData);
24320
24258
  this.splatOrder.name = "splatOrder";
24321
24259
  this.splatOrder.minFilter = "nearest";
24322
24260
  this.splatOrder.magFilter = "nearest";
24323
24261
  this.splatOrder.addressModeU = "clamp-to-edge";
24324
24262
  this.splatOrder.addressModeV = "clamp-to-edge";
24325
24263
  this.gsplatMaterial = new GSplatMaterial();
24326
- this.geometry = new PlaneGeometry(1, 1, 1, 1);
24264
+ this.geometry = new GSplatGeometry(this._batchSize);
24327
24265
  this.materials = [this.gsplatMaterial];
24266
+ this.instanceCount = 0;
24328
24267
  }
24329
24268
  /**
24330
24269
  * Update splat sorting before rendering
@@ -24401,12 +24340,7 @@ let GSplatRenderer = class extends RenderNode {
24401
24340
  this.texParams[2] = Math.min(this.texParams[0], this.count);
24402
24341
  const total = this.size.x * this.size.y;
24403
24342
  for (let i = 0; i < total; i++) {
24404
- const src = i < this.count ? i : this.count > 0 ? this.count - 1 : 0;
24405
- const base = i * 4;
24406
- this._orderData[base + 0] = src;
24407
- this._orderData[base + 1] = 0;
24408
- this._orderData[base + 2] = 0;
24409
- this._orderData[base + 3] = 0;
24343
+ this._orderData[i] = i < this.count ? i : this.count > 0 ? this.count - 1 : 0;
24410
24344
  }
24411
24345
  this.splatOrder.updateTexture(this.size.x, this.size.y, this._orderData);
24412
24346
  if (this._sortWorker) {
@@ -24433,6 +24367,7 @@ let GSplatRenderer = class extends RenderNode {
24433
24367
  } else {
24434
24368
  this._centersSent = false;
24435
24369
  }
24370
+ this.instanceCount = 0;
24436
24371
  }
24437
24372
  /**
24438
24373
  * Set visibility boost factor (material uniform tex_params.w)
@@ -24496,6 +24431,18 @@ let GSplatRenderer = class extends RenderNode {
24496
24431
  distanceEnabled: this._maxPixelCullDistance > 0
24497
24432
  };
24498
24433
  }
24434
+ /**
24435
+ * Get batching statistics
24436
+ */
24437
+ getBatchingStats() {
24438
+ return {
24439
+ enabled: true,
24440
+ batchSize: this._batchSize,
24441
+ instanceCount: this.instanceCount,
24442
+ splatCount: this.count,
24443
+ reduction: this.count > 0 ? (1 - this.instanceCount / this.count) * 100 : 0
24444
+ };
24445
+ }
24499
24446
  /**
24500
24447
  * Calculate texture size for given splat count
24501
24448
  */
@@ -24718,18 +24665,20 @@ let GSplatRenderer = class extends RenderNode {
24718
24665
  const indices = new Uint32Array(newOrder);
24719
24666
  const total = this.size.x * this.size.y;
24720
24667
  const count = this.count;
24721
- this._orderData = new Uint32Array(total * 4);
24722
- for (let i = 0; i < total; i++) {
24723
- const src = i < count ? indices[i] : count > 0 ? count - 1 : 0;
24724
- const base = i * 4;
24725
- this._orderData[base + 0] = src;
24726
- this._orderData[base + 1] = 0;
24727
- this._orderData[base + 2] = 0;
24728
- this._orderData[base + 3] = 0;
24668
+ if (!this._orderData || this._orderData.length !== total) {
24669
+ this._orderData = new Uint32Array(total);
24670
+ }
24671
+ const validCount = Math.min(count, indices.length);
24672
+ this._orderData.set(indices.subarray(0, validCount), 0);
24673
+ if (validCount < total) {
24674
+ const lastIndex = count > 0 ? count - 1 : 0;
24675
+ this._orderData.fill(lastIndex, validCount, total);
24729
24676
  }
24730
24677
  this.splatOrder.updateTexture(this.size.x, this.size.y, this._orderData);
24731
24678
  const valid = Math.max(0, Math.min(this.count, ev.data.count | 0));
24732
24679
  this.texParams[2] = valid;
24680
+ const newInstanceCount = Math.ceil(valid / this._batchSize);
24681
+ this.instanceCount = newInstanceCount;
24733
24682
  };
24734
24683
  const worldPos = this._worldPositions || this._positions;
24735
24684
  const centers = this._mapping ? new Float32Array(this._mapping.length * 3) : new Float32Array(worldPos);
@@ -24932,30 +24881,22 @@ let GSplatRenderer = class extends RenderNode {
24932
24881
  nodeUpdate(view, passType, renderPassState, clusterLightingBuffer) {
24933
24882
  const worldMatrix = this.object3D.transform.worldMatrix;
24934
24883
  this.gsplatMaterial.setTransformMatrix(worldMatrix);
24935
- this.gsplatMaterial.setPixelCulling(this._minPixelCoverage, this._maxPixelCoverage, this._maxPixelCullDistance);
24936
- this.gsplatMaterial.setSplatTextures(
24937
- this.splatColor,
24938
- this.transformA,
24939
- this.transformB,
24940
- this.texParams,
24941
- this.splatOrder
24942
- );
24943
- super.nodeUpdate(view, passType, renderPassState, clusterLightingBuffer);
24944
- }
24945
- /**
24946
- * Render pass
24947
- */
24948
- renderPass2(view, passType, rendererPassState, clusterLightingBuffer, encoder, useBundle = false) {
24949
- for (let mat of this.materials) {
24950
- const passes = mat.getPass(passType);
24951
- if (!passes || passes.length === 0) continue;
24952
- for (const pass of passes) {
24953
- if (!pass.pipeline) continue;
24954
- pass.apply(this.geometry, rendererPassState);
24955
- GPUContext.bindPipeline(encoder, pass);
24956
- GPUContext.draw(encoder, 4, this.count, 0, 0);
24957
- }
24884
+ const currentParams = `${this._minPixelCoverage},${this._maxPixelCoverage},${this._maxPixelCullDistance},${this._batchSize}`;
24885
+ if (currentParams !== this._lastPixelCullParams) {
24886
+ this.gsplatMaterial.setPixelCulling(this._minPixelCoverage, this._maxPixelCoverage, this._maxPixelCullDistance, this._batchSize);
24887
+ this._lastPixelCullParams = currentParams;
24888
+ }
24889
+ if (!this._texturesInitialized) {
24890
+ this.gsplatMaterial.setSplatTextures(
24891
+ this.splatColor,
24892
+ this.transformA,
24893
+ this.transformB,
24894
+ this.texParams,
24895
+ this.splatOrder
24896
+ );
24897
+ this._texturesInitialized = true;
24958
24898
  }
24899
+ super.nodeUpdate(view, passType, renderPassState, clusterLightingBuffer);
24959
24900
  }
24960
24901
  /**
24961
24902
  * Render pass (fallback)
@@ -24969,7 +24910,28 @@ let GSplatRenderer = class extends RenderNode {
24969
24910
  if (!pass.pipeline) continue;
24970
24911
  pass.apply(this.geometry, renderContext.rendererPassState || renderContext);
24971
24912
  GPUContext.bindPipeline(encoder, pass);
24972
- GPUContext.draw(encoder, 4, this.count, 0, 0);
24913
+ GPUContext.bindGeometryBuffer(encoder, this.geometry);
24914
+ const subGeometry = this.geometry.subGeometries[0];
24915
+ const lodInfo = subGeometry.lodLevels[0];
24916
+ if (this.instanceCount > 0) {
24917
+ GPUContext.drawIndexed(
24918
+ encoder,
24919
+ lodInfo.indexCount,
24920
+ this.instanceCount,
24921
+ lodInfo.indexStart,
24922
+ 0,
24923
+ 0
24924
+ );
24925
+ } else {
24926
+ GPUContext.drawIndexed(
24927
+ encoder,
24928
+ lodInfo.indexCount,
24929
+ 1,
24930
+ lodInfo.indexStart,
24931
+ 0,
24932
+ 0
24933
+ );
24934
+ }
24973
24935
  }
24974
24936
  }
24975
24937
  }
@@ -24981,6 +24943,31 @@ let GSplatRenderer = class extends RenderNode {
24981
24943
  this._sortWorker.terminate();
24982
24944
  this._sortWorker = null;
24983
24945
  }
24946
+ if (this.splatColor) {
24947
+ this.splatColor.destroy(force);
24948
+ this.splatColor = null;
24949
+ }
24950
+ if (this.transformA) {
24951
+ this.transformA.destroy(force);
24952
+ this.transformA = null;
24953
+ }
24954
+ if (this.transformB) {
24955
+ this.transformB.destroy(force);
24956
+ this.transformB = null;
24957
+ }
24958
+ if (this.splatOrder) {
24959
+ this.splatOrder.destroy(force);
24960
+ this.splatOrder = null;
24961
+ }
24962
+ if (this.gsplatMaterial) {
24963
+ this.gsplatMaterial.destroy(force);
24964
+ this.gsplatMaterial = null;
24965
+ }
24966
+ this._positions = null;
24967
+ this._worldPositions = null;
24968
+ this._orderData = null;
24969
+ this.texParams = null;
24970
+ this._mapping = null;
24984
24971
  super.destroy(force);
24985
24972
  }
24986
24973
  };
@@ -26888,6 +26875,43 @@ class MorphTargetData {
26888
26875
  usage
26889
26876
  );
26890
26877
  }
26878
+ destroy(force) {
26879
+ if (this._computeConfigBuffer) {
26880
+ this._computeConfigBuffer.destroy(force);
26881
+ this._computeConfigBuffer = null;
26882
+ }
26883
+ if (this._morphInfluenceBuffer) {
26884
+ this._morphInfluenceBuffer.destroy(force);
26885
+ this._morphInfluenceBuffer = null;
26886
+ }
26887
+ if (this._computeShader) {
26888
+ this._computeShader.destroy(force);
26889
+ this._computeShader = null;
26890
+ }
26891
+ if (this._positionAttrDataGroup) {
26892
+ if (this._positionAttrDataGroup.input) {
26893
+ this._positionAttrDataGroup.input.destroy(force);
26894
+ }
26895
+ if (this._positionAttrDataGroup.output) {
26896
+ this._positionAttrDataGroup.output.destroy(force);
26897
+ }
26898
+ this._positionAttrDataGroup = null;
26899
+ }
26900
+ if (this._normalAttrDataGroup) {
26901
+ if (this._normalAttrDataGroup.input) {
26902
+ this._normalAttrDataGroup.input.destroy(force);
26903
+ }
26904
+ if (this._normalAttrDataGroup.output) {
26905
+ this._normalAttrDataGroup.output.destroy(force);
26906
+ }
26907
+ this._normalAttrDataGroup = null;
26908
+ }
26909
+ this._computeConfigArray = null;
26910
+ this._morphInfluenceArray = null;
26911
+ this._collectMorphTargetData = null;
26912
+ this._blendTarget = null;
26913
+ this._computeShaders = null;
26914
+ }
26891
26915
  }
26892
26916
 
26893
26917
  var __defProp = Object.defineProperty;
@@ -26999,6 +27023,10 @@ let MeshRenderer = class extends RenderNode {
26999
27023
  super.nodeUpdate(view, passType, renderPassState, clusterLightingBuffer);
27000
27024
  }
27001
27025
  destroy(force) {
27026
+ if (this.morphData) {
27027
+ this.morphData.destroy(force);
27028
+ this.morphData = null;
27029
+ }
27002
27030
  super.destroy(force);
27003
27031
  }
27004
27032
  };
@@ -27505,6 +27533,115 @@ class WebGPUDescriptorCreator {
27505
27533
  }
27506
27534
  }
27507
27535
 
27536
+ class PlaneGeometry extends GeometryBase {
27537
+ width;
27538
+ height;
27539
+ segmentW;
27540
+ segmentH;
27541
+ up;
27542
+ constructor(width, height, segmentW = 1, segmentH = 1, up = Vector3.Y_AXIS) {
27543
+ super();
27544
+ this.width = width;
27545
+ this.height = height;
27546
+ this.segmentW = segmentW;
27547
+ this.segmentH = segmentH;
27548
+ this.up = up;
27549
+ this.buildGeometry(this.up);
27550
+ }
27551
+ buildGeometry(axis) {
27552
+ var x, y;
27553
+ var numIndices;
27554
+ var base;
27555
+ var tw = this.segmentW + 1;
27556
+ (this.segmentH + 1) * tw;
27557
+ this.bounds = new BoundingBox(
27558
+ Vector3.ZERO.clone(),
27559
+ new Vector3(this.width, 1, this.height)
27560
+ );
27561
+ numIndices = this.segmentH * this.segmentW * 6;
27562
+ let vertexCount = (this.segmentW + 1) * (this.segmentH + 1);
27563
+ let position_arr = new Float32Array(vertexCount * 3);
27564
+ let normal_arr = new Float32Array(vertexCount * 3);
27565
+ let uv_arr = new Float32Array(vertexCount * 2);
27566
+ let indices_arr;
27567
+ let totalIndexCount = this.segmentW * this.segmentH * 2 * 3;
27568
+ if (totalIndexCount >= Uint16Array.length) {
27569
+ indices_arr = new Uint32Array(this.segmentW * this.segmentH * 2 * 3);
27570
+ } else {
27571
+ indices_arr = new Uint16Array(this.segmentW * this.segmentH * 2 * 3);
27572
+ }
27573
+ numIndices = 0;
27574
+ var indexP = 0;
27575
+ var indexN = 0;
27576
+ var indexU = 0;
27577
+ for (var yi = 0; yi <= this.segmentH; ++yi) {
27578
+ for (var xi = 0; xi <= this.segmentW; ++xi) {
27579
+ x = (xi / this.segmentW - 0.5) * this.width;
27580
+ y = (yi / this.segmentH - 0.5) * this.height;
27581
+ switch (axis) {
27582
+ case Vector3.Y_AXIS:
27583
+ position_arr[indexP++] = x;
27584
+ position_arr[indexP++] = 0;
27585
+ position_arr[indexP++] = y;
27586
+ normal_arr[indexN++] = 0;
27587
+ normal_arr[indexN++] = 1;
27588
+ normal_arr[indexN++] = 0;
27589
+ break;
27590
+ case Vector3.Z_AXIS:
27591
+ position_arr[indexP++] = x;
27592
+ position_arr[indexP++] = -y;
27593
+ position_arr[indexP++] = 0;
27594
+ normal_arr[indexN++] = 0;
27595
+ normal_arr[indexN++] = 0;
27596
+ normal_arr[indexN++] = 1;
27597
+ break;
27598
+ case Vector3.X_AXIS:
27599
+ position_arr[indexP++] = 0;
27600
+ position_arr[indexP++] = x;
27601
+ position_arr[indexP++] = y;
27602
+ normal_arr[indexN++] = 1;
27603
+ normal_arr[indexN++] = 0;
27604
+ normal_arr[indexN++] = 0;
27605
+ break;
27606
+ default:
27607
+ position_arr[indexP++] = x;
27608
+ position_arr[indexP++] = 0;
27609
+ position_arr[indexP++] = y;
27610
+ normal_arr[indexN++] = 0;
27611
+ normal_arr[indexN++] = 1;
27612
+ normal_arr[indexN++] = 0;
27613
+ break;
27614
+ }
27615
+ uv_arr[indexU++] = xi / this.segmentW;
27616
+ uv_arr[indexU++] = yi / this.segmentH;
27617
+ if (xi != this.segmentW && yi != this.segmentH) {
27618
+ base = xi + yi * tw;
27619
+ indices_arr[numIndices++] = base + 1;
27620
+ indices_arr[numIndices++] = base;
27621
+ indices_arr[numIndices++] = base + tw;
27622
+ indices_arr[numIndices++] = base + 1;
27623
+ indices_arr[numIndices++] = base + tw;
27624
+ indices_arr[numIndices++] = base + tw + 1;
27625
+ }
27626
+ }
27627
+ }
27628
+ this.setIndices(indices_arr);
27629
+ this.setAttribute(VertexAttributeName.position, position_arr);
27630
+ this.setAttribute(VertexAttributeName.normal, normal_arr);
27631
+ this.setAttribute(VertexAttributeName.uv, uv_arr);
27632
+ this.setAttribute(VertexAttributeName.TEXCOORD_1, uv_arr);
27633
+ this.addSubGeometry({
27634
+ indexStart: 0,
27635
+ indexCount: indices_arr.length,
27636
+ vertexStart: 0,
27637
+ vertexCount: 0,
27638
+ firstStart: 0,
27639
+ index: 0,
27640
+ topology: 0
27641
+ });
27642
+ }
27643
+ }
27644
+
27508
27645
  var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
27509
27646
  var __decorateClass$g = (decorators, target, key, kind) => {
27510
27647
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
@@ -30479,7 +30616,15 @@ class RendererJob {
30479
30616
  shadowMapPassRenderer;
30480
30617
  pointLightShadowRenderer;
30481
30618
  ddgiProbeRenderer;
30482
- postRenderer;
30619
+ _postRenderer;
30620
+ get postRenderer() {
30621
+ if (!this._postRenderer) {
30622
+ let gbufferFrame = GBufferFrame.getGBufferFrame("ColorPassGBuffer");
30623
+ this._postRenderer = this.addRenderer(PostRenderer);
30624
+ this._postRenderer.setRenderStates(gbufferFrame);
30625
+ }
30626
+ return this._postRenderer;
30627
+ }
30483
30628
  clusterLightingRender;
30484
30629
  reflectionRenderer;
30485
30630
  occlusionSystem;
@@ -30503,7 +30648,9 @@ class RendererJob {
30503
30648
  }
30504
30649
  this.shadowMapPassRenderer = new ShadowMapPassRenderer();
30505
30650
  this.pointLightShadowRenderer = new PointLightShadowRenderer();
30506
- this.addPost(new FXAAPost());
30651
+ if (Engine3D.setting.render.postProcessing.fxaa.enable) {
30652
+ this.addPost(new FXAAPost());
30653
+ }
30507
30654
  }
30508
30655
  addRenderer(c, param) {
30509
30656
  let renderer;
@@ -30533,11 +30680,6 @@ class RendererJob {
30533
30680
  this.pauseRender = false;
30534
30681
  }
30535
30682
  addPost(post) {
30536
- if (!this.postRenderer) {
30537
- let gbufferFrame = GBufferFrame.getGBufferFrame("ColorPassGBuffer");
30538
- this.postRenderer = this.addRenderer(PostRenderer);
30539
- this.postRenderer.setRenderStates(gbufferFrame);
30540
- }
30541
30683
  if (post instanceof PostBase) {
30542
30684
  this.postRenderer.attachPost(this.view, post);
30543
30685
  }
@@ -30555,15 +30697,21 @@ class RendererJob {
30555
30697
  renderFrame() {
30556
30698
  let view = this._view;
30557
30699
  ProfilerUtil.startView(view);
30558
- GlobalBindGroup.getLightEntries(view.scene).update(view);
30559
- GlobalBindGroup.getReflectionEntries(view.scene).update(view);
30560
- this.occlusionSystem.update(view.camera, view.scene);
30561
- this.clusterLightingRender.render(view, this.occlusionSystem);
30562
- if (this.shadowMapPassRenderer) {
30700
+ if (this.clusterLightingRender) {
30701
+ GlobalBindGroup.getLightEntries(view.scene).update(view);
30702
+ GlobalBindGroup.getReflectionEntries(view.scene).update(view);
30703
+ }
30704
+ if (Engine3D.setting.occlusionQuery.enable && this.occlusionSystem) {
30705
+ this.occlusionSystem.update(view.camera, view.scene);
30706
+ }
30707
+ if (this.clusterLightingRender) {
30708
+ this.clusterLightingRender.render(view, this.occlusionSystem);
30709
+ }
30710
+ if (Engine3D.setting.shadow.enable && this.shadowMapPassRenderer) {
30563
30711
  ShadowLightsCollect.update(view);
30564
30712
  this.shadowMapPassRenderer.render(view, this.occlusionSystem);
30565
30713
  }
30566
- if (this.pointLightShadowRenderer) {
30714
+ if (Engine3D.setting.shadow.enable && this.pointLightShadowRenderer) {
30567
30715
  this.pointLightShadowRenderer.render(view, this.occlusionSystem);
30568
30716
  }
30569
30717
  if (this.depthPassRenderer) {
@@ -40784,7 +40932,7 @@ class PostProcessingComponent extends ComponentBase {
40784
40932
  }
40785
40933
  }
40786
40934
 
40787
- const version = "1.0.12";
40935
+ const version = "1.0.14";
40788
40936
 
40789
40937
  class Engine3D {
40790
40938
  /**
@@ -66370,4 +66518,4 @@ const __viteBrowserExternal = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.def
66370
66518
  __proto__: null
66371
66519
  }, Symbol.toStringTag, { value: 'Module' }));
66372
66520
 
66373
- export { AccelerateDecelerateInterpolator, AccelerateInterpolator, AnimationCurve, AnimationCurveT, AnimationMonitor, AnimatorComponent, AnimatorEventKeyframe, AnticipateInterpolator, AnticipateOvershootInterpolator, ArrayHas, ArrayItemIndex, AtlasParser, AtmosphericComponent, AtmosphericScatteringSky, AtmosphericScatteringSkySetting, AtmosphericScatteringSky_shader, AttributeAnimCurve, AxisObject, B3DMLoader, B3DMLoaderBase, B3DMParseUtil, B3DMParser, BRDFLUT, BRDFLUTGenerate, BRDF_frag, BatchTable, BiMap, BillboardComponent, BillboardType, BitUtil, BitmapTexture2D, BitmapTexture2DArray, BitmapTextureCube, Blend, BlendFactor, BlendMode, BlendShapeData, BlendShapePropertyData, BloomPost, BlurEffectCreatorBlur_cs, BlurEffectCreatorSample_cs, BlurTexture2DBufferCreator, BounceInterpolator, BoundUtil, BoundingBox, BoundingSphere, BoxColliderShape, BoxGeometry, BrdfLut_frag, BsDF_frag, BxDF_frag, BxdfDebug_frag, BytesArray, CEvent, CEventDispatcher, CEventListener, CResizeEvent, CSM, Camera3D, CameraControllerBase, CameraType, CameraUtil, CapsuleColliderShape, CastPointShadowMaterialPass, CastShadowMaterialPass, Clearcoat_frag, ClusterBoundsSource_cs, ClusterConfig, ClusterDebug_frag, ClusterLight, ClusterLightingBuffer, ClusterLightingRender, ClusterLighting_cs, CollectInfo, ColliderComponent, ColliderShape, ColliderShapeType, Color, ColorGradient, ColorLitMaterial, ColorLitShader, ColorPassFragmentOutput, ColorPassRenderer, ColorUtil, ComData, Combine_cs, Common_frag, Common_vert, ComponentBase, ComponentCollect, ComputeGPUBuffer, ComputeShader, Context3D, CubeCamera, CubeMapFaceEnum, CubeSky_Shader, CubicBezierCurve, CubicBezierPath, CubicBezierType, CycleInterpolator, CylinderGeometry, DDGIIrradianceComputePass, DDGIIrradianceGPUBufferReader, DDGIIrradianceVolume, DDGIIrradiance_shader, DDGILightingPass, DDGILighting_shader, DDGIMultiBouncePass, DDGIProbeRenderer, DEGREES_TO_RADIANS, DecelerateInterpolator, Denoising_cs, Depth2DTextureArray, DepthCubeArrayTexture, DepthMaterialPass, DepthOfFieldPost, DepthOfView_cs, DirectLight, DoubleArray, EditorInspector, Engine3D, Entity, EntityBatchCollect, EntityCollect, EnvMap_frag, ErpImage2CubeMap, ErpImage2CubeMapCreateCube_cs, ErpImage2CubeMapRgbe2rgba_cs, ExtrudeGeometry, FASTFLOOR, FXAAPost, FXAAShader, FastMathShader, FatLineGeometry, FatLineMaterial, FatLineRenderer, FatLineShader, FatLine_FS, FatLine_VS, FeatureTable, FileLoader, FirstPersonCameraController, Float16ArrayTexture, Float32ArrayTexture, FlyCameraController, FontChar, FontInfo, FontPage, FontParser, ForwardRenderJob, FragmentOutput, FragmentVarying, FrameCache, Frustum, FrustumCSM, FrustumCulling_cs, FullQuad_vert_wgsl, GBufferFrame, GBufferPass, GBufferPost, GBufferStand, GBuffer_pass, GILighting, GIProbeMaterial, GIProbeMaterialType, GIProbeShader, GIRenderCompleteEvent, GIRenderStartEvent, GLBChunk, GLBHeader, GLBParser, GLSLLexer, GLSLLexerToken, GLSLPreprocessor, GLSLSyntax, GLTFBinaryExtension, GLTFMaterial, GLTFParser, GLTFSubParser, GLTFSubParserCamera, GLTFSubParserConverter, GLTFSubParserMaterial, GLTFSubParserMesh, GLTFSubParserSkeleton, GLTFSubParserSkin, GLTFType, GLTF_Accessors, GLTF_Info, GLTF_Light, GLTF_Mesh, GLTF_Node, GLTF_Primitives, GLTF_Scene, GPUAddressMode, GPUBlendFactor, GPUBufferBase, GPUBufferType, GPUCompareFunction, GPUContext, GPUCullMode, GPUFilterMode, GPUPrimitiveTopology, GPUTextureFormat, GPUVertexFormat, GPUVertexStepMode, GSplatFormat, GSplatMaterial, GSplatRenderer, GSplatShader, GSplat_FS, GSplat_VS, GTAOPost, GTAO_cs, GUIAtlasTexture, GUICanvas, GUIConfig, GUIGeometry, GUIGeometryRebuild, GUIMaterial, GUIPassRenderer, GUIPick, GUIPickHelper, GUIQuad, GUIQuadAttrEnum, GUIRenderer, GUIShader, GUISpace, GUISprite, GUITexture, GaussianSplatParser, GenerayRandomDir, GeoJsonParser, GeoJsonUtil, GeoType, GeometryBase, GeometryIndicesBuffer, GeometryUtil, GeometryVertexBuffer, GeometryVertexType, GetComponentClass, GetCountInstanceID, GetRepeat, GetShader, GlassShader, GlobalBindGroup, GlobalBindGroupLayout, GlobalFog, GlobalFog_shader, GlobalIlluminationComponent, GlobalUniform, GlobalUniformGroup, GodRayPost, GodRay_cs, GridObject, HDRTexture, HDRTextureCube, Hair_frag, Hair_shader_op, Hair_shader_tr, HaltonSeq, Horizontal, HoverCameraController, I3DMLoader, I3DMLoaderBase, I3DMParser, IBLEnvMapCreator, IBLEnvMapCreator_cs, IESProfiles, IESProfiles_frag, IKDTreeUserData, ImageType, IndicesGPUBuffer, Inline_vert, InputSystem, InstanceDrawComponent, InstanceUniform, InstancedMesh, Interpolator, InterpolatorEnum, IrradianceDataReaderCompleteEvent, IrradianceVolumeData_frag, Irradiance_frag, IsEditorInspector, IsNonSerialize, Joint, JointPose, JumperInterpolator, KDTreeEntity, KDTreeNode, KDTreeRange, KDTreeSpace, KDTreeUUID, KHR_draco_mesh_compression, KHR_lights_punctual, KHR_materials_clearcoat, KHR_materials_emissive_strength, KHR_materials_ior, KHR_materials_unlit, KMZParser, KV, KelvinUtil, KeyCode, KeyEvent, Keyframe, KeyframeT, LDRTextureCube, LambertMaterial, Lambert_shader, Light, LightBase, LightData, LightEntries, LightType, LightingFunction_frag, Line, LineClassification, LinearInterpolator, LitMaterial, LitSSSShader, LitShader, Lit_shader, LoaderBase, LoaderEvent, LoaderManager, MAX_VALUE, MIN_VALUE, Material, MaterialDataUniformGPUBuffer, MaterialUtilities, MathShader, MathUtil, Matrix3, Matrix4, MatrixBindGroup, MatrixGPUBuffer, MatrixShader, MemoryDO, MemoryInfo, MergeRGBACreator, MergeRGBA_cs, MeshColliderShape, MeshFilter, MeshRenderer, MinMaxAnimationCurves, MinMaxCurve, MinMaxCurveState, MinMaxPolyCurves, MorePassParser, MorePassShader, MorphTargetBlender, MorphTargetData, MorphTargetFrame, MorphTargetTransformKey, MorphTarget_shader, MouseCode, MultiBouncePass_cs, Navi3DAstar, Navi3DConst, Navi3DEdge, Navi3DFunnel, Navi3DMaskType, Navi3DMesh, Navi3DPoint, Navi3DPoint2D, Navi3DPointFat, Navi3DRouter, Navi3DTriangle, NonSerialize, NormalMap_frag, OAnimationEvent, OBJParser, Object3D, Object3DEvent, Object3DTransformTools, Object3DUtil, ObjectAnimClip, OcclusionSystem, Octree, OctreeEntity, OrbitController, OrderMap, Orientation3D, OutLineBlendColor_cs, OutlineCalcOutline_cs, OutlinePass, OutlinePost, OutlinePostData, OutlinePostManager, OutlinePostSlot, Outline_cs, OvershootInterpolator, PBRLItShader, PBRLitSSSShader, ParserBase, ParserFormat, ParticleSystemCurveEvalMode, ParticleSystemRandomnessIds, PassGenerate, PassShader, PassType, PhysicMaterialUniform_frag, PickCompute, PickFire, PickGUIEvent3D, PickResult, Picker_cs, PingPong, PipelinePool, Plane3D, PlaneClassification, PlaneGeometry, PointClassification, PointLight, PointLightShadowRenderer, PointShadowCubeCamera, PointerEvent3D, Polynomial, PolynomialCurve, Polynomials, PoolNode, PostBase, PostProcessingComponent, PostRenderer, PreDepthPassRenderer, PreFilteredEnvironment_cs, PreFilteredEnvironment_cs2, PreIntegratedLut, PreIntegratedLutCompute, PrefabAvatarData, PrefabAvatarParser, PrefabBoneData, PrefabMaterialParser, PrefabMeshData, PrefabMeshParser, PrefabNode, PrefabParser, PrefabStringUtil, PrefabTextureData, PrefabTextureParser, Preprocessor, Probe, ProbeEntries, ProbeGBufferFrame, ProfilerUtil, PropertyAnimClip, PropertyAnimTag, PropertyAnimation, PropertyAnimationClip, PropertyAnimationClipState, PropertyAnimationEvent, PropertyHelp, QuadAABB, QuadGlsl_fs, QuadGlsl_vs, QuadRoot, QuadShader, QuadTree, QuadTreeCell, Quad_depth2dArray_frag_wgsl, Quad_depth2d_frag_wgsl, Quad_depthCube_frag_wgsl, Quad_frag_wgsl, Quad_vert_wgsl, Quaternion, RADIANS_TO_DEGREES, RGBEErrorCode, RGBEHeader, RGBEParser, RTDescriptor, RTFrame, RTResourceConfig, RTResourceMap, Rand, RandomSeed, Ray, RayCastMeshDetail, Reader, Rect, Reference, Reflection, ReflectionCG, ReflectionEntries, ReflectionMaterial, ReflectionRenderer, ReflectionShader, ReflectionShader_shader, RegisterComponent, RegisterShader, RenderContext, RenderLayer, RenderLayerUtil, RenderNode, RenderShaderCollect, RenderShaderCompute, RenderShaderPass, RenderTexture, RendererBase, RendererJob, RendererMap, RendererMask, RendererMaskUtil, RendererPassState, RepeatSE, Res, RotationControlComponents, SHCommon_frag, SN_ArrayConstant, SN_BinaryOperation, SN_Break, SN_CodeBlock, SN_Constant, SN_Continue, SN_Declaration, SN_Discard, SN_DoWhileLoop, SN_Expression, SN_ForLoop, SN_Function, SN_FunctionArgs, SN_FunctionCall, SN_IFBranch, SN_Identifier, SN_IndexOperation, SN_Layout, SN_ParenExpression, SN_Precision, SN_Return, SN_SelectOperation, SN_Struct, SN_TernaryOperation, SN_UnaryOperation, SN_WhileLoop, SSAO_cs, SSGI2_cs, SSGIPost, SSRPost, SSR_BlendColor_cs, SSR_IS_Kernel, SSR_IS_cs, SSR_RayTrace_cs, ScaleControlComponents, Scene3D, Shader, ShaderAttributeInfo, ShaderConverter, ShaderConverterResult, ShaderLib, ShaderPassBase, ShaderReflection, ShaderStage, ShaderState, ShaderUniformInfo, ShaderUtil, ShadingInput, ShadowLightsCollect, ShadowMapPassRenderer, ShadowMapping_frag, Skeleton, SkeletonAnimationClip, SkeletonAnimationClipState, SkeletonAnimationComponent, SkeletonAnimationCompute, SkeletonAnimation_shader, SkeletonBlendComputeArgs, SkeletonPose, SkeletonTransformComputeArgs, SkinnedMeshRenderer, SkinnedMeshRenderer2, SkyGBufferPass, SkyGBuffer_pass, SkyMaterial, SkyRenderer, SkyShader, SolidColorSky, SphereColliderShape, SphereGeometry, SphereReflection, SpotLight, StandShader, StatementNode, StorageGPUBuffer, StringUtil, Struct, StructStorageGPUBuffer, SubGeometry, TAACopyTex_cs, TAAPost, TAASharpTex_cs, TAA_cs, TestComputeLoadBuffer, TextAnchor, TextFieldLayout, TextFieldLine, Texture, TextureCube, TextureCubeFaceData, TextureCubeStdCreator, TextureCubeUtils, TextureMipmapCompute, TextureMipmapGenerator, TextureScaleCompute, ThirdPersonCameraController, TileSet, TileSetChild, TileSetChildContent, TileSetChildContentMetaData, TileSetRoot, TilesRenderer, Time, TokenType, TorusGeometry, TouchData, TrailGeometry, Transform, TransformAxisEnum, TransformControllerBaseComponent, TransformMode, TransformSpaceMode, TranslationControlComponents, TranslatorContext, TriGeometry, Triangle, UIButton, UIButtonTransition, UIComponentBase, UIEvent, UIImage, UIImageGroup, UIInteractive, UIInteractiveStyle, UIPanel, UIRenderAble, UIShadow, UITextField, UITransform, UUID, UV, Uint32ArrayTexture, Uint8ArrayTexture, UnLit, UnLitMaterial, UnLitMaterialUniform_frag, UnLitShader, UnLitTexArrayMaterial, UnLitTexArrayShader, UnLitTextureArray, UnLit_frag, UniformGPUBuffer, UniformNode, UniformType, ValueEnumType, ValueOp, ValueParser, ValueSpread, Vector2, Vector3, Vector3Ex, Vector4, VertexAttribute, VertexAttributeIndexShader, VertexAttributeName, VertexAttributeSize, VertexAttributeStride, VertexAttributes_vert, VertexBufferLayout, VertexFormat, VertexGPUBuffer, Vertical, VideoUniform_frag, View3D, ViewPanel, ViewQuad, VirtualTexture, WGSLTranslator, WayLines3D, WayPoint3D, WebGPUDescriptorCreator, WorldMatrixUniform, WorldPanel, WrapMode, WrapTimeMode, ZCullingCompute, ZPassShader_cs, ZPassShader_fs, ZPassShader_vs, ZSorterUtil, append, arrayToString, blendComponent, buildCurves, byteSizeOfType, calculateCurveRangesValue, calculateMinMax, castPointShadowMap_vert, clamp, clampRepeat, computeAABBFromPositions, cos, crossProduct, cubicPolynomialRoot, cubicPolynomialRootsGeneric, curvesSupportProcedural, deg2Rad, detectGSplatFormat, directionShadowCastMap_frag, dot, doubleIntegrateSegment, downSample, fastInvSqrt, floorfToIntPos, fonts, generateRandom, generateRandom3, getFloatFromInt, getGLTypeFromTypedArray, getGLTypeFromTypedArrayType, getGlobalRandomSeed, getTypedArray, getTypedArrayTypeFromGLType, grad1, grad2, grad3, grad4, inferSHOrder, integrateSegment, irradianceDataReader, kPI, lerp, lerpByte, lerpColor, lerpVector3, magnitude, makeAloneSprite, makeGUISprite, makeMatrix44, matrixMultiply, matrixRotate, matrixRotateY, mergeFunctions, multiplyMatrices4x4REF, normal_distribution, normalizeFast, normalizeSafe, normalizedToByte, normalizedToWord, outlinePostData, outlinePostManager, parsePlyGaussianSplat, parsePlyHeader, perm, post, quadraticPolynomialRootsGeneric, rad2Deg, random01, randomBarycentricCoord, randomPointBetweenEllipsoid, randomPointBetweenSphere, randomPointInsideCube, randomPointInsideEllipsoid, randomPointInsideUnitCircle, randomPointInsideUnitSphere, randomQuaternion, randomQuaternionUniformDistribution, randomSeed, randomUnitVector, randomUnitVector2, rangedRandomFloat, rangedRandomInt, readByType, readMagicBytes, registerMaterial, repeat, rotMatrix, rotateVectorByQuat, roundfToIntPos, scale, shadowCastMap_frag, shadowCastMap_vert, simplex, sin, snoise1, snoise2, snoise3, snoise4, sqrMagnitude, sqrtImpl, stencilStateFace, swap, textureCompress, threshold, toHalfFloat, tw, uniform_real_distribution, uniform_real_distribution2, upSample$1 as upSample, webGPUContext, zSorterUtil };
66521
+ export { AccelerateDecelerateInterpolator, AccelerateInterpolator, AnimationCurve, AnimationCurveT, AnimationMonitor, AnimatorComponent, AnimatorEventKeyframe, AnticipateInterpolator, AnticipateOvershootInterpolator, ArrayHas, ArrayItemIndex, AtlasParser, AtmosphericComponent, AtmosphericScatteringSky, AtmosphericScatteringSkySetting, AtmosphericScatteringSky_shader, AttributeAnimCurve, AxisObject, B3DMLoader, B3DMLoaderBase, B3DMParseUtil, B3DMParser, BRDFLUT, BRDFLUTGenerate, BRDF_frag, BatchTable, BiMap, BillboardComponent, BillboardType, BitUtil, BitmapTexture2D, BitmapTexture2DArray, BitmapTextureCube, Blend, BlendFactor, BlendMode, BlendShapeData, BlendShapePropertyData, BloomPost, BlurEffectCreatorBlur_cs, BlurEffectCreatorSample_cs, BlurTexture2DBufferCreator, BounceInterpolator, BoundUtil, BoundingBox, BoundingSphere, BoxColliderShape, BoxGeometry, BrdfLut_frag, BsDF_frag, BxDF_frag, BxdfDebug_frag, BytesArray, CEvent, CEventDispatcher, CEventListener, CResizeEvent, CSM, Camera3D, CameraControllerBase, CameraType, CameraUtil, CapsuleColliderShape, CastPointShadowMaterialPass, CastShadowMaterialPass, Clearcoat_frag, ClusterBoundsSource_cs, ClusterConfig, ClusterDebug_frag, ClusterLight, ClusterLightingBuffer, ClusterLightingRender, ClusterLighting_cs, CollectInfo, ColliderComponent, ColliderShape, ColliderShapeType, Color, ColorGradient, ColorLitMaterial, ColorLitShader, ColorPassFragmentOutput, ColorPassRenderer, ColorUtil, ComData, Combine_cs, Common_frag, Common_vert, ComponentBase, ComponentCollect, ComputeGPUBuffer, ComputeShader, Context3D, CubeCamera, CubeMapFaceEnum, CubeSky_Shader, CubicBezierCurve, CubicBezierPath, CubicBezierType, CycleInterpolator, CylinderGeometry, DDGIIrradianceComputePass, DDGIIrradianceGPUBufferReader, DDGIIrradianceVolume, DDGIIrradiance_shader, DDGILightingPass, DDGILighting_shader, DDGIMultiBouncePass, DDGIProbeRenderer, DEGREES_TO_RADIANS, DecelerateInterpolator, Denoising_cs, Depth2DTextureArray, DepthCubeArrayTexture, DepthMaterialPass, DepthOfFieldPost, DepthOfView_cs, DirectLight, DoubleArray, EditorInspector, Engine3D, Entity, EntityBatchCollect, EntityCollect, EnvMap_frag, ErpImage2CubeMap, ErpImage2CubeMapCreateCube_cs, ErpImage2CubeMapRgbe2rgba_cs, ExtrudeGeometry, FASTFLOOR, FXAAPost, FXAAShader, FastMathShader, FatLineGeometry, FatLineMaterial, FatLineRenderer, FatLineShader, FatLine_FS, FatLine_VS, FeatureTable, FileLoader, FirstPersonCameraController, Float16ArrayTexture, Float32ArrayTexture, FlyCameraController, FontChar, FontInfo, FontPage, FontParser, ForwardRenderJob, FragmentOutput, FragmentVarying, FrameCache, Frustum, FrustumCSM, FrustumCulling_cs, FullQuad_vert_wgsl, GBufferFrame, GBufferPass, GBufferPost, GBufferStand, GBuffer_pass, GILighting, GIProbeMaterial, GIProbeMaterialType, GIProbeShader, GIRenderCompleteEvent, GIRenderStartEvent, GLBChunk, GLBHeader, GLBParser, GLSLLexer, GLSLLexerToken, GLSLPreprocessor, GLSLSyntax, GLTFBinaryExtension, GLTFMaterial, GLTFParser, GLTFSubParser, GLTFSubParserCamera, GLTFSubParserConverter, GLTFSubParserMaterial, GLTFSubParserMesh, GLTFSubParserSkeleton, GLTFSubParserSkin, GLTFType, GLTF_Accessors, GLTF_Info, GLTF_Light, GLTF_Mesh, GLTF_Node, GLTF_Primitives, GLTF_Scene, GPUAddressMode, GPUBlendFactor, GPUBufferBase, GPUBufferType, GPUCompareFunction, GPUContext, GPUCullMode, GPUFilterMode, GPUPrimitiveTopology, GPUTextureFormat, GPUVertexFormat, GPUVertexStepMode, GSplatFormat, GSplatGeometry, GSplatMaterial, GSplatRenderer, GSplatShader, GSplat_FS, GSplat_VS, GTAOPost, GTAO_cs, GUIAtlasTexture, GUICanvas, GUIConfig, GUIGeometry, GUIGeometryRebuild, GUIMaterial, GUIPassRenderer, GUIPick, GUIPickHelper, GUIQuad, GUIQuadAttrEnum, GUIRenderer, GUIShader, GUISpace, GUISprite, GUITexture, GaussianSplatParser, GenerayRandomDir, GeoJsonParser, GeoJsonUtil, GeoType, GeometryBase, GeometryIndicesBuffer, GeometryUtil, GeometryVertexBuffer, GeometryVertexType, GetComponentClass, GetCountInstanceID, GetRepeat, GetShader, GlassShader, GlobalBindGroup, GlobalBindGroupLayout, GlobalFog, GlobalFog_shader, GlobalIlluminationComponent, GlobalUniform, GlobalUniformGroup, GodRayPost, GodRay_cs, GridObject, HDRTexture, HDRTextureCube, Hair_frag, Hair_shader_op, Hair_shader_tr, HaltonSeq, Horizontal, HoverCameraController, I3DMLoader, I3DMLoaderBase, I3DMParser, IBLEnvMapCreator, IBLEnvMapCreator_cs, IESProfiles, IESProfiles_frag, IKDTreeUserData, ImageType, IndicesGPUBuffer, Inline_vert, InputSystem, InstanceDrawComponent, InstanceUniform, InstancedMesh, Interpolator, InterpolatorEnum, IrradianceDataReaderCompleteEvent, IrradianceVolumeData_frag, Irradiance_frag, IsEditorInspector, IsNonSerialize, Joint, JointPose, JumperInterpolator, KDTreeEntity, KDTreeNode, KDTreeRange, KDTreeSpace, KDTreeUUID, KHR_draco_mesh_compression, KHR_lights_punctual, KHR_materials_clearcoat, KHR_materials_emissive_strength, KHR_materials_ior, KHR_materials_unlit, KMZParser, KV, KelvinUtil, KeyCode, KeyEvent, Keyframe, KeyframeT, LDRTextureCube, LambertMaterial, Lambert_shader, Light, LightBase, LightData, LightEntries, LightType, LightingFunction_frag, Line, LineClassification, LinearInterpolator, LitMaterial, LitSSSShader, LitShader, Lit_shader, LoaderBase, LoaderEvent, LoaderManager, MAX_VALUE, MIN_VALUE, Material, MaterialDataUniformGPUBuffer, MaterialUtilities, MathShader, MathUtil, Matrix3, Matrix4, MatrixBindGroup, MatrixGPUBuffer, MatrixShader, MemoryDO, MemoryInfo, MergeRGBACreator, MergeRGBA_cs, MeshColliderShape, MeshFilter, MeshRenderer, MinMaxAnimationCurves, MinMaxCurve, MinMaxCurveState, MinMaxPolyCurves, MorePassParser, MorePassShader, MorphTargetBlender, MorphTargetData, MorphTargetFrame, MorphTargetTransformKey, MorphTarget_shader, MouseCode, MultiBouncePass_cs, Navi3DAstar, Navi3DConst, Navi3DEdge, Navi3DFunnel, Navi3DMaskType, Navi3DMesh, Navi3DPoint, Navi3DPoint2D, Navi3DPointFat, Navi3DRouter, Navi3DTriangle, NonSerialize, NormalMap_frag, OAnimationEvent, OBJParser, Object3D, Object3DEvent, Object3DTransformTools, Object3DUtil, ObjectAnimClip, OcclusionSystem, Octree, OctreeEntity, OrbitController, OrderMap, Orientation3D, OutLineBlendColor_cs, OutlineCalcOutline_cs, OutlinePass, OutlinePost, OutlinePostData, OutlinePostManager, OutlinePostSlot, Outline_cs, OvershootInterpolator, PBRLItShader, PBRLitSSSShader, ParserBase, ParserFormat, ParticleSystemCurveEvalMode, ParticleSystemRandomnessIds, PassGenerate, PassShader, PassType, PhysicMaterialUniform_frag, PickCompute, PickFire, PickGUIEvent3D, PickResult, Picker_cs, PingPong, PipelinePool, Plane3D, PlaneClassification, PlaneGeometry, PointClassification, PointLight, PointLightShadowRenderer, PointShadowCubeCamera, PointerEvent3D, Polynomial, PolynomialCurve, Polynomials, PoolNode, PostBase, PostProcessingComponent, PostRenderer, PreDepthPassRenderer, PreFilteredEnvironment_cs, PreFilteredEnvironment_cs2, PreIntegratedLut, PreIntegratedLutCompute, PrefabAvatarData, PrefabAvatarParser, PrefabBoneData, PrefabMaterialParser, PrefabMeshData, PrefabMeshParser, PrefabNode, PrefabParser, PrefabStringUtil, PrefabTextureData, PrefabTextureParser, Preprocessor, Probe, ProbeEntries, ProbeGBufferFrame, ProfilerUtil, PropertyAnimClip, PropertyAnimTag, PropertyAnimation, PropertyAnimationClip, PropertyAnimationClipState, PropertyAnimationEvent, PropertyHelp, QuadAABB, QuadGlsl_fs, QuadGlsl_vs, QuadRoot, QuadShader, QuadTree, QuadTreeCell, Quad_depth2dArray_frag_wgsl, Quad_depth2d_frag_wgsl, Quad_depthCube_frag_wgsl, Quad_frag_wgsl, Quad_vert_wgsl, Quaternion, R32UintTexture, RADIANS_TO_DEGREES, RGBEErrorCode, RGBEHeader, RGBEParser, RTDescriptor, RTFrame, RTResourceConfig, RTResourceMap, Rand, RandomSeed, Ray, RayCastMeshDetail, Reader, Rect, Reference, Reflection, ReflectionCG, ReflectionEntries, ReflectionMaterial, ReflectionRenderer, ReflectionShader, ReflectionShader_shader, RegisterComponent, RegisterShader, RenderContext, RenderLayer, RenderLayerUtil, RenderNode, RenderShaderCollect, RenderShaderCompute, RenderShaderPass, RenderTexture, RendererBase, RendererJob, RendererMap, RendererMask, RendererMaskUtil, RendererPassState, RepeatSE, Res, RotationControlComponents, SHCommon_frag, SN_ArrayConstant, SN_BinaryOperation, SN_Break, SN_CodeBlock, SN_Constant, SN_Continue, SN_Declaration, SN_Discard, SN_DoWhileLoop, SN_Expression, SN_ForLoop, SN_Function, SN_FunctionArgs, SN_FunctionCall, SN_IFBranch, SN_Identifier, SN_IndexOperation, SN_Layout, SN_ParenExpression, SN_Precision, SN_Return, SN_SelectOperation, SN_Struct, SN_TernaryOperation, SN_UnaryOperation, SN_WhileLoop, SSAO_cs, SSGI2_cs, SSGIPost, SSRPost, SSR_BlendColor_cs, SSR_IS_Kernel, SSR_IS_cs, SSR_RayTrace_cs, ScaleControlComponents, Scene3D, Shader, ShaderAttributeInfo, ShaderConverter, ShaderConverterResult, ShaderLib, ShaderPassBase, ShaderReflection, ShaderStage, ShaderState, ShaderUniformInfo, ShaderUtil, ShadingInput, ShadowLightsCollect, ShadowMapPassRenderer, ShadowMapping_frag, Skeleton, SkeletonAnimationClip, SkeletonAnimationClipState, SkeletonAnimationComponent, SkeletonAnimationCompute, SkeletonAnimation_shader, SkeletonBlendComputeArgs, SkeletonPose, SkeletonTransformComputeArgs, SkinnedMeshRenderer, SkinnedMeshRenderer2, SkyGBufferPass, SkyGBuffer_pass, SkyMaterial, SkyRenderer, SkyShader, SolidColorSky, SphereColliderShape, SphereGeometry, SphereReflection, SpotLight, StandShader, StatementNode, StorageGPUBuffer, StringUtil, Struct, StructStorageGPUBuffer, SubGeometry, TAACopyTex_cs, TAAPost, TAASharpTex_cs, TAA_cs, TestComputeLoadBuffer, TextAnchor, TextFieldLayout, TextFieldLine, Texture, TextureCube, TextureCubeFaceData, TextureCubeStdCreator, TextureCubeUtils, TextureMipmapCompute, TextureMipmapGenerator, TextureScaleCompute, ThirdPersonCameraController, TileSet, TileSetChild, TileSetChildContent, TileSetChildContentMetaData, TileSetRoot, TilesRenderer, Time, TokenType, TorusGeometry, TouchData, TrailGeometry, Transform, TransformAxisEnum, TransformControllerBaseComponent, TransformMode, TransformSpaceMode, TranslationControlComponents, TranslatorContext, TriGeometry, Triangle, UIButton, UIButtonTransition, UIComponentBase, UIEvent, UIImage, UIImageGroup, UIInteractive, UIInteractiveStyle, UIPanel, UIRenderAble, UIShadow, UITextField, UITransform, UUID, UV, Uint32ArrayTexture, Uint8ArrayTexture, UnLit, UnLitMaterial, UnLitMaterialUniform_frag, UnLitShader, UnLitTexArrayMaterial, UnLitTexArrayShader, UnLitTextureArray, UnLit_frag, UniformGPUBuffer, UniformNode, UniformType, ValueEnumType, ValueOp, ValueParser, ValueSpread, Vector2, Vector3, Vector3Ex, Vector4, VertexAttribute, VertexAttributeIndexShader, VertexAttributeName, VertexAttributeSize, VertexAttributeStride, VertexAttributes_vert, VertexBufferLayout, VertexFormat, VertexGPUBuffer, Vertical, VideoUniform_frag, View3D, ViewPanel, ViewQuad, VirtualTexture, WGSLTranslator, WayLines3D, WayPoint3D, WebGPUDescriptorCreator, WorldMatrixUniform, WorldPanel, WrapMode, WrapTimeMode, ZCullingCompute, ZPassShader_cs, ZPassShader_fs, ZPassShader_vs, ZSorterUtil, append, arrayToString, blendComponent, buildCurves, byteSizeOfType, calculateCurveRangesValue, calculateMinMax, castPointShadowMap_vert, clamp, clampRepeat, computeAABBFromPositions, cos, crossProduct, cubicPolynomialRoot, cubicPolynomialRootsGeneric, curvesSupportProcedural, deg2Rad, detectGSplatFormat, directionShadowCastMap_frag, dot, doubleIntegrateSegment, downSample, fastInvSqrt, floorfToIntPos, fonts, generateRandom, generateRandom3, getFloatFromInt, getGLTypeFromTypedArray, getGLTypeFromTypedArrayType, getGlobalRandomSeed, getTypedArray, getTypedArrayTypeFromGLType, grad1, grad2, grad3, grad4, inferSHOrder, integrateSegment, irradianceDataReader, kPI, lerp, lerpByte, lerpColor, lerpVector3, magnitude, makeAloneSprite, makeGUISprite, makeMatrix44, matrixMultiply, matrixRotate, matrixRotateY, mergeFunctions, multiplyMatrices4x4REF, normal_distribution, normalizeFast, normalizeSafe, normalizedToByte, normalizedToWord, outlinePostData, outlinePostManager, parsePlyGaussianSplat, parsePlyHeader, perm, post, quadraticPolynomialRootsGeneric, rad2Deg, random01, randomBarycentricCoord, randomPointBetweenEllipsoid, randomPointBetweenSphere, randomPointInsideCube, randomPointInsideEllipsoid, randomPointInsideUnitCircle, randomPointInsideUnitSphere, randomQuaternion, randomQuaternionUniformDistribution, randomSeed, randomUnitVector, randomUnitVector2, rangedRandomFloat, rangedRandomInt, readByType, readMagicBytes, registerMaterial, repeat, rotMatrix, rotateVectorByQuat, roundfToIntPos, scale, shadowCastMap_frag, shadowCastMap_vert, simplex, sin, snoise1, snoise2, snoise3, snoise4, sqrMagnitude, sqrtImpl, stencilStateFace, swap, textureCompress, threshold, toHalfFloat, tw, uniform_real_distribution, uniform_real_distribution2, upSample$1 as upSample, webGPUContext, zSorterUtil };