@babylonjs/core 8.50.5 → 8.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/AudioV2/webAudio/webAudioSoundSource.d.ts +2 -2
  2. package/AudioV2/webAudio/webAudioSoundSource.js +12 -2
  3. package/AudioV2/webAudio/webAudioSoundSource.js.map +1 -1
  4. package/Cameras/geospatialCamera.js +21 -20
  5. package/Cameras/geospatialCamera.js.map +1 -1
  6. package/Cameras/geospatialCameraMovement.d.ts +8 -1
  7. package/Cameras/geospatialCameraMovement.js +29 -8
  8. package/Cameras/geospatialCameraMovement.js.map +1 -1
  9. package/Engines/abstractEngine.js +2 -2
  10. package/Engines/abstractEngine.js.map +1 -1
  11. package/Instrumentation/engineInstrumentation.js +2 -1
  12. package/Instrumentation/engineInstrumentation.js.map +1 -1
  13. package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +1 -0
  14. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +52 -12
  15. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  16. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.d.ts +86 -0
  17. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js +160 -0
  18. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js.map +1 -0
  19. package/Materials/index.d.ts +1 -0
  20. package/Materials/index.js +1 -0
  21. package/Materials/index.js.map +1 -1
  22. package/Maths/math.constants.d.ts +2 -1
  23. package/Maths/math.constants.js +3 -2
  24. package/Maths/math.constants.js.map +1 -1
  25. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +4 -1
  26. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  27. package/Misc/dataStorage.d.ts +13 -0
  28. package/Misc/dataStorage.js +25 -0
  29. package/Misc/dataStorage.js.map +1 -1
  30. package/Shaders/gaussianSplatting.fragment.js +8 -2
  31. package/Shaders/gaussianSplatting.fragment.js.map +1 -1
  32. package/Shaders/gaussianSplatting.vertex.js +8 -2
  33. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  34. package/ShadersWGSL/gaussianSplatting.fragment.js +7 -1
  35. package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
  36. package/ShadersWGSL/gaussianSplatting.vertex.js +8 -2
  37. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  38. package/package.json +1 -1
@@ -43,4 +43,17 @@ export declare class DataStorage {
43
43
  * @param value The value to write
44
44
  */
45
45
  static WriteNumber(key: string, value: number): void;
46
+ /**
47
+ * Reads a JSON value from the data storage
48
+ * @param key The key to read
49
+ * @param defaultValue The value if the key doesn't exist
50
+ * @returns The JSON value
51
+ */
52
+ static ReadJson<T>(key: string, defaultValue: T): T;
53
+ /**
54
+ * Writes a JSON value to the data storage
55
+ * @param key The key to write
56
+ * @param value The JSON value to write
57
+ */
58
+ static WriteJson<T>(key: string, value: T): void;
46
59
  }
@@ -1,3 +1,4 @@
1
+ import { Logger } from "./logger.js";
1
2
  /**
2
3
  * Class for storing data to local storage if available or in-memory storage otherwise
3
4
  */
@@ -75,6 +76,30 @@ export class DataStorage {
75
76
  static WriteNumber(key, value) {
76
77
  this._Storage.setItem(key, value.toString());
77
78
  }
79
+ /**
80
+ * Reads a JSON value from the data storage
81
+ * @param key The key to read
82
+ * @param defaultValue The value if the key doesn't exist
83
+ * @returns The JSON value
84
+ */
85
+ static ReadJson(key, defaultValue) {
86
+ const value = this._Storage.getItem(key);
87
+ try {
88
+ return value !== null ? JSON.parse(value) : defaultValue;
89
+ }
90
+ catch (e) {
91
+ Logger.Warn(`Failed to parse JSON from storage for key "${key}". Returning default value.`, e);
92
+ return defaultValue;
93
+ }
94
+ }
95
+ /**
96
+ * Writes a JSON value to the data storage
97
+ * @param key The key to write
98
+ * @param value The JSON value to write
99
+ */
100
+ static WriteJson(key, value) {
101
+ this._Storage.setItem(key, JSON.stringify(value));
102
+ }
78
103
  }
79
104
  DataStorage._Storage = DataStorage._GetStorage();
80
105
  //# sourceMappingURL=dataStorage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataStorage.js","sourceRoot":"","sources":["../../../../dev/core/src/Misc/dataStorage.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,OAAO,WAAW;IAGZ,MAAM,CAAC,WAAW;QACtB,IAAI,CAAC;YACD,YAAY,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACjC,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAChC,OAAO,YAAY,CAAC;QACxB,CAAC;QAAC,MAAM,CAAC;YACL,MAAM,eAAe,GAA8B,EAAE,CAAC;YACtD,OAAO;gBACH,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;oBACb,MAAM,KAAK,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;oBACnC,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;gBAC9C,CAAC;gBACD,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;oBACpB,eAAe,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;gBACjC,CAAC;aACJ,CAAC;QACN,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,UAAU,CAAC,GAAW,EAAE,YAAoB;QACtD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACzC,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC;IACjD,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAC,GAAW,EAAE,KAAa;QAChD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,WAAW,CAAC,GAAW,EAAE,YAAqB;QACxD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACzC,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,YAAY,CAAC,GAAW,EAAE,KAAc;QAClD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,UAAU,CAAC,GAAW,EAAE,YAAoB;QACtD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACzC,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IAC7D,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAC,GAAW,EAAE,KAAa;QAChD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;;AA/Ec,oBAAQ,GAAa,WAAW,CAAC,WAAW,EAAE,CAAC","sourcesContent":["interface IStorage {\r\n getItem: (key: string) => string | null;\r\n setItem: (key: string, value: string) => void;\r\n}\r\n\r\n/**\r\n * Class for storing data to local storage if available or in-memory storage otherwise\r\n */\r\nexport class DataStorage {\r\n private static _Storage: IStorage = DataStorage._GetStorage();\r\n\r\n private static _GetStorage(): IStorage {\r\n try {\r\n localStorage.setItem(\"test\", \"\");\r\n localStorage.removeItem(\"test\");\r\n return localStorage;\r\n } catch {\r\n const inMemoryStorage: { [key: string]: string } = {};\r\n return {\r\n getItem: (key) => {\r\n const value = inMemoryStorage[key];\r\n return value === undefined ? null : value;\r\n },\r\n setItem: (key, value) => {\r\n inMemoryStorage[key] = value;\r\n },\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Reads a string from the data storage\r\n * @param key The key to read\r\n * @param defaultValue The value if the key doesn't exist\r\n * @returns The string value\r\n */\r\n public static ReadString(key: string, defaultValue: string): string {\r\n const value = this._Storage.getItem(key);\r\n return value !== null ? value : defaultValue;\r\n }\r\n\r\n /**\r\n * Writes a string to the data storage\r\n * @param key The key to write\r\n * @param value The value to write\r\n */\r\n public static WriteString(key: string, value: string): void {\r\n this._Storage.setItem(key, value);\r\n }\r\n\r\n /**\r\n * Reads a boolean from the data storage\r\n * @param key The key to read\r\n * @param defaultValue The value if the key doesn't exist\r\n * @returns The boolean value\r\n */\r\n public static ReadBoolean(key: string, defaultValue: boolean): boolean {\r\n const value = this._Storage.getItem(key);\r\n return value !== null ? value === \"true\" : defaultValue;\r\n }\r\n\r\n /**\r\n * Writes a boolean to the data storage\r\n * @param key The key to write\r\n * @param value The value to write\r\n */\r\n public static WriteBoolean(key: string, value: boolean) {\r\n this._Storage.setItem(key, value ? \"true\" : \"false\");\r\n }\r\n\r\n /**\r\n * Reads a number from the data storage\r\n * @param key The key to read\r\n * @param defaultValue The value if the key doesn't exist\r\n * @returns The number value\r\n */\r\n public static ReadNumber(key: string, defaultValue: number): number {\r\n const value = this._Storage.getItem(key);\r\n return value !== null ? parseFloat(value) : defaultValue;\r\n }\r\n\r\n /**\r\n * Writes a number to the data storage\r\n * @param key The key to write\r\n * @param value The value to write\r\n */\r\n public static WriteNumber(key: string, value: number) {\r\n this._Storage.setItem(key, value.toString());\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"dataStorage.js","sourceRoot":"","sources":["../../../../dev/core/src/Misc/dataStorage.ts"],"names":[],"mappings":"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","sourcesContent":["import { Logger } from \"./logger\";\r\n\r\ninterface IStorage {\r\n getItem: (key: string) => string | null;\r\n setItem: (key: string, value: string) => void;\r\n}\r\n\r\n/**\r\n * Class for storing data to local storage if available or in-memory storage otherwise\r\n */\r\nexport class DataStorage {\r\n private static _Storage: IStorage = DataStorage._GetStorage();\r\n\r\n private static _GetStorage(): IStorage {\r\n try {\r\n localStorage.setItem(\"test\", \"\");\r\n localStorage.removeItem(\"test\");\r\n return localStorage;\r\n } catch {\r\n const inMemoryStorage: { [key: string]: string } = {};\r\n return {\r\n getItem: (key) => {\r\n const value = inMemoryStorage[key];\r\n return value === undefined ? null : value;\r\n },\r\n setItem: (key, value) => {\r\n inMemoryStorage[key] = value;\r\n },\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Reads a string from the data storage\r\n * @param key The key to read\r\n * @param defaultValue The value if the key doesn't exist\r\n * @returns The string value\r\n */\r\n public static ReadString(key: string, defaultValue: string): string {\r\n const value = this._Storage.getItem(key);\r\n return value !== null ? value : defaultValue;\r\n }\r\n\r\n /**\r\n * Writes a string to the data storage\r\n * @param key The key to write\r\n * @param value The value to write\r\n */\r\n public static WriteString(key: string, value: string): void {\r\n this._Storage.setItem(key, value);\r\n }\r\n\r\n /**\r\n * Reads a boolean from the data storage\r\n * @param key The key to read\r\n * @param defaultValue The value if the key doesn't exist\r\n * @returns The boolean value\r\n */\r\n public static ReadBoolean(key: string, defaultValue: boolean): boolean {\r\n const value = this._Storage.getItem(key);\r\n return value !== null ? value === \"true\" : defaultValue;\r\n }\r\n\r\n /**\r\n * Writes a boolean to the data storage\r\n * @param key The key to write\r\n * @param value The value to write\r\n */\r\n public static WriteBoolean(key: string, value: boolean) {\r\n this._Storage.setItem(key, value ? \"true\" : \"false\");\r\n }\r\n\r\n /**\r\n * Reads a number from the data storage\r\n * @param key The key to read\r\n * @param defaultValue The value if the key doesn't exist\r\n * @returns The number value\r\n */\r\n public static ReadNumber(key: string, defaultValue: number): number {\r\n const value = this._Storage.getItem(key);\r\n return value !== null ? parseFloat(value) : defaultValue;\r\n }\r\n\r\n /**\r\n * Writes a number to the data storage\r\n * @param key The key to write\r\n * @param value The value to write\r\n */\r\n public static WriteNumber(key: string, value: number) {\r\n this._Storage.setItem(key, value.toString());\r\n }\r\n\r\n /**\r\n * Reads a JSON value from the data storage\r\n * @param key The key to read\r\n * @param defaultValue The value if the key doesn't exist\r\n * @returns The JSON value\r\n */\r\n public static ReadJson<T>(key: string, defaultValue: T): T {\r\n const value = this._Storage.getItem(key);\r\n try {\r\n return value !== null ? JSON.parse(value) : defaultValue;\r\n } catch (e) {\r\n Logger.Warn(`Failed to parse JSON from storage for key \"${key}\". Returning default value.`, e);\r\n return defaultValue;\r\n }\r\n }\r\n\r\n /**\r\n * Writes a JSON value to the data storage\r\n * @param key The key to write\r\n * @param value The JSON value to write\r\n */\r\n public static WriteJson<T>(key: string, value: T) {\r\n this._Storage.setItem(key, JSON.stringify(value));\r\n }\r\n}\r\n"]}
@@ -10,10 +10,16 @@ const shader = `#include<clipPlaneFragmentDeclaration>
10
10
  #include<logDepthDeclaration>
11
11
  #include<fogFragmentDeclaration>
12
12
  varying vec4 vColor;varying vec2 vPosition;
13
+ #define CUSTOM_FRAGMENT_DEFINITIONS
13
14
  #include<gaussianSplattingFragmentDeclaration>
14
- void main () {
15
+ void main () {
16
+ #define CUSTOM_FRAGMENT_MAIN_BEGIN
15
17
  #include<clipPlaneFragment>
16
- gl_FragColor=gaussianColor(vColor);}
18
+ vec4 finalColor=gaussianColor(vColor);
19
+ #define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR
20
+ gl_FragColor=finalColor;
21
+ #define CUSTOM_FRAGMENT_MAIN_END
22
+ }
17
23
  `;
18
24
  // Sideeffect
19
25
  if (!ShaderStore.ShadersStore[name]) {
@@ -1 +1 @@
1
- {"version":3,"file":"gaussianSplatting.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/gaussianSplatting.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,+CAA+C,CAAC;AACvD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,yCAAyC,CAAC;AACjD,OAAO,uDAAuD,CAAC;AAC/D,OAAO,oCAAoC,CAAC;AAE5C,MAAM,IAAI,GAAG,8BAA8B,CAAC;AAC5C,MAAM,MAAM,GAAG;;;;;;;;CAQd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;IAClC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/clipPlaneFragmentDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/fogFragmentDeclaration\";\nimport \"./ShadersInclude/gaussianSplattingFragmentDeclaration\";\nimport \"./ShadersInclude/clipPlaneFragment\";\n\nconst name = \"gaussianSplattingPixelShader\";\nconst shader = `#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvarying vec4 vColor;varying vec2 vPosition;\n#include<gaussianSplattingFragmentDeclaration>\nvoid main () { \n#include<clipPlaneFragment>\ngl_FragColor=gaussianColor(vColor);}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStore[name]) {\n ShaderStore.ShadersStore[name] = shader;\n}\n/** @internal */\nexport const gaussianSplattingPixelShader = { name, shader };\n"]}
1
+ {"version":3,"file":"gaussianSplatting.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/gaussianSplatting.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,+CAA+C,CAAC;AACvD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,yCAAyC,CAAC;AACjD,OAAO,uDAAuD,CAAC;AAC/D,OAAO,oCAAoC,CAAC;AAE5C,MAAM,IAAI,GAAG,8BAA8B,CAAC;AAC5C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;CAcd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;IAClC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/clipPlaneFragmentDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/fogFragmentDeclaration\";\nimport \"./ShadersInclude/gaussianSplattingFragmentDeclaration\";\nimport \"./ShadersInclude/clipPlaneFragment\";\n\nconst name = \"gaussianSplattingPixelShader\";\nconst shader = `#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvarying vec4 vColor;varying vec2 vPosition;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n#include<gaussianSplattingFragmentDeclaration>\nvoid main () {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec4 finalColor=gaussianColor(vColor);\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\ngl_FragColor=finalColor;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStore[name]) {\n ShaderStore.ShadersStore[name] = shader;\n}\n/** @internal */\nexport const gaussianSplattingPixelShader = { name, shader };\n"]}
@@ -37,8 +37,11 @@ uniform highp usampler2D shTexture2;
37
37
  uniform sampler2D partIndicesTexture;
38
38
  #endif
39
39
  varying vec4 vColor;varying vec2 vPosition;
40
+ #define CUSTOM_VERTEX_DEFINITIONS
40
41
  #include<gaussianSplatting>
41
- void main () {float splatIndex=getSplatIndex(int(position.z+0.5));Splat splat=readSplat(splatIndex);vec3 covA=splat.covA.xyz;vec3 covB=vec3(splat.covA.w,splat.covB.xy);
42
+ void main () {
43
+ #define CUSTOM_VERTEX_MAIN_BEGIN
44
+ float splatIndex=getSplatIndex(int(position.z+0.5));Splat splat=readSplat(splatIndex);vec3 covA=splat.covA.xyz;vec3 covB=vec3(splat.covA.w,splat.covB.xy);
42
45
  #if IS_COMPOUND
43
46
  mat4 splatWorld=getPartWorld(splat.partIndex);
44
47
  #else
@@ -52,10 +55,13 @@ vColor.w*=alpha;
52
55
  #if IS_COMPOUND
53
56
  vColor.w*=partVisibility[splat.partIndex];
54
57
  #endif
55
- gl_Position=gaussianSplatting(position.xy,worldPos.xyz,vec2(1.,1.),covA,covB,splatWorld,view,projection);
58
+ vec2 scale=vec2(1.,1.);
59
+ #define CUSTOM_VERTEX_UPDATE
60
+ gl_Position=gaussianSplatting(position.xy,worldPos.xyz,scale,covA,covB,splatWorld,view,projection);
56
61
  #include<clipPlaneVertex>
57
62
  #include<fogVertex>
58
63
  #include<logDepthVertex>
64
+ #define CUSTOM_VERTEX_MAIN_END
59
65
  }
60
66
  `;
61
67
  // Sideeffect
@@ -1 +1 @@
1
- {"version":3,"file":"gaussianSplatting.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/gaussianSplatting.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,qDAAqD,CAAC;AAC7D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,6CAA6C,CAAC;AACrD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,4BAA4B,CAAC;AACpC,OAAO,iCAAiC,CAAC;AAEzC,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Cd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;IAClC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/gaussianSplattingVertexDeclaration\";\nimport \"./ShadersInclude/gaussianSplattingUboDeclaration\";\nimport \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport \"./ShadersInclude/fogVertexDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/helperFunctions\";\nimport \"./ShadersInclude/gaussianSplatting\";\nimport \"./ShadersInclude/clipPlaneVertex\";\nimport \"./ShadersInclude/fogVertex\";\nimport \"./ShadersInclude/logDepthVertex\";\n\nconst name = \"gaussianSplattingVertexShader\";\nconst shader = `#include<__decl__gaussianSplattingVertex>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\n#include<helperFunctions>\nuniform vec2 invViewport;uniform vec2 dataTextureSize;uniform vec2 focal;uniform float kernelSize;uniform vec3 eyePosition;uniform float alpha;\n#if IS_COMPOUND\nuniform mat4 partWorld[MAX_PART_COUNT];uniform float partVisibility[MAX_PART_COUNT];\n#endif\nuniform sampler2D covariancesATexture;uniform sampler2D covariancesBTexture;uniform sampler2D centersTexture;uniform sampler2D colorsTexture;\n#if SH_DEGREE>0\nuniform highp usampler2D shTexture0;\n#endif\n#if SH_DEGREE>1\nuniform highp usampler2D shTexture1;\n#endif\n#if SH_DEGREE>2\nuniform highp usampler2D shTexture2;\n#endif\n#if IS_COMPOUND\nuniform sampler2D partIndicesTexture;\n#endif\nvarying vec4 vColor;varying vec2 vPosition;\n#include<gaussianSplatting>\nvoid main () {float splatIndex=getSplatIndex(int(position.z+0.5));Splat splat=readSplat(splatIndex);vec3 covA=splat.covA.xyz;vec3 covB=vec3(splat.covA.w,splat.covB.xy);\n#if IS_COMPOUND\nmat4 splatWorld=getPartWorld(splat.partIndex);\n#else\nmat4 splatWorld=world;\n#endif\nvec4 worldPos=splatWorld*vec4(splat.center.xyz,1.0);vColor=splat.color;vPosition=position.xy;\n#if SH_DEGREE>0\nmat3 worldRot=mat3(splatWorld);mat3 normWorldRot=inverseMat3(worldRot);vec3 eyeToSplatLocalSpace=normalize(normWorldRot*(worldPos.xyz-eyePosition));vColor.xyz=splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace);\n#endif\nvColor.w*=alpha;\n#if IS_COMPOUND\nvColor.w*=partVisibility[splat.partIndex];\n#endif\ngl_Position=gaussianSplatting(position.xy,worldPos.xyz,vec2(1.,1.),covA,covB,splatWorld,view,projection);\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStore[name]) {\n ShaderStore.ShadersStore[name] = shader;\n}\n/** @internal */\nexport const gaussianSplattingVertexShader = { name, shader };\n"]}
1
+ {"version":3,"file":"gaussianSplatting.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/gaussianSplatting.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,qDAAqD,CAAC;AAC7D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,6CAA6C,CAAC;AACrD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,4BAA4B,CAAC;AACpC,OAAO,iCAAiC,CAAC;AAEzC,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;IAClC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/gaussianSplattingVertexDeclaration\";\nimport \"./ShadersInclude/gaussianSplattingUboDeclaration\";\nimport \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport \"./ShadersInclude/fogVertexDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/helperFunctions\";\nimport \"./ShadersInclude/gaussianSplatting\";\nimport \"./ShadersInclude/clipPlaneVertex\";\nimport \"./ShadersInclude/fogVertex\";\nimport \"./ShadersInclude/logDepthVertex\";\n\nconst name = \"gaussianSplattingVertexShader\";\nconst shader = `#include<__decl__gaussianSplattingVertex>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\n#include<helperFunctions>\nuniform vec2 invViewport;uniform vec2 dataTextureSize;uniform vec2 focal;uniform float kernelSize;uniform vec3 eyePosition;uniform float alpha;\n#if IS_COMPOUND\nuniform mat4 partWorld[MAX_PART_COUNT];uniform float partVisibility[MAX_PART_COUNT];\n#endif\nuniform sampler2D covariancesATexture;uniform sampler2D covariancesBTexture;uniform sampler2D centersTexture;uniform sampler2D colorsTexture;\n#if SH_DEGREE>0\nuniform highp usampler2D shTexture0;\n#endif\n#if SH_DEGREE>1\nuniform highp usampler2D shTexture1;\n#endif\n#if SH_DEGREE>2\nuniform highp usampler2D shTexture2;\n#endif\n#if IS_COMPOUND\nuniform sampler2D partIndicesTexture;\n#endif\nvarying vec4 vColor;varying vec2 vPosition;\n#define CUSTOM_VERTEX_DEFINITIONS\n#include<gaussianSplatting>\nvoid main () {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nfloat splatIndex=getSplatIndex(int(position.z+0.5));Splat splat=readSplat(splatIndex);vec3 covA=splat.covA.xyz;vec3 covB=vec3(splat.covA.w,splat.covB.xy);\n#if IS_COMPOUND\nmat4 splatWorld=getPartWorld(splat.partIndex);\n#else\nmat4 splatWorld=world;\n#endif\nvec4 worldPos=splatWorld*vec4(splat.center.xyz,1.0);vColor=splat.color;vPosition=position.xy;\n#if SH_DEGREE>0\nmat3 worldRot=mat3(splatWorld);mat3 normWorldRot=inverseMat3(worldRot);vec3 eyeToSplatLocalSpace=normalize(normWorldRot*(worldPos.xyz-eyePosition));vColor.xyz=splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace);\n#endif\nvColor.w*=alpha;\n#if IS_COMPOUND\nvColor.w*=partVisibility[splat.partIndex];\n#endif\nvec2 scale=vec2(1.,1.);\n#define CUSTOM_VERTEX_UPDATE\ngl_Position=gaussianSplatting(position.xy,worldPos.xyz,scale,covA,covB,splatWorld,view,projection);\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStore[name]) {\n ShaderStore.ShadersStore[name] = shader;\n}\n/** @internal */\nexport const gaussianSplattingVertexShader = { name, shader };\n"]}
@@ -10,11 +10,17 @@ const shader = `#include<clipPlaneFragmentDeclaration>
10
10
  #include<logDepthDeclaration>
11
11
  #include<fogFragmentDeclaration>
12
12
  varying vColor: vec4f;varying vPosition: vec2f;
13
+ #define CUSTOM_FRAGMENT_DEFINITIONS
13
14
  #include<gaussianSplattingFragmentDeclaration>
14
15
  @fragment
15
16
  fn main(input: FragmentInputs)->FragmentOutputs {
17
+ #define CUSTOM_FRAGMENT_MAIN_BEGIN
16
18
  #include<clipPlaneFragment>
17
- fragmentOutputs.color=gaussianColor(input.vColor,input.vPosition);}
19
+ var finalColor: vec4f=gaussianColor(input.vColor,input.vPosition);
20
+ #define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR
21
+ fragmentOutputs.color=finalColor;
22
+ #define CUSTOM_FRAGMENT_MAIN_END
23
+ }
18
24
  `;
19
25
  // Sideeffect
20
26
  if (!ShaderStore.ShadersStoreWGSL[name]) {
@@ -1 +1 @@
1
- {"version":3,"file":"gaussianSplatting.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplatting.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,+CAA+C,CAAC;AACvD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,yCAAyC,CAAC;AACjD,OAAO,uDAAuD,CAAC;AAC/D,OAAO,oCAAoC,CAAC;AAE5C,MAAM,IAAI,GAAG,8BAA8B,CAAC;AAC5C,MAAM,MAAM,GAAG;;;;;;;;;CASd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/clipPlaneFragmentDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/fogFragmentDeclaration\";\nimport \"./ShadersInclude/gaussianSplattingFragmentDeclaration\";\nimport \"./ShadersInclude/clipPlaneFragment\";\n\nconst name = \"gaussianSplattingPixelShader\";\nconst shader = `#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvarying vColor: vec4f;varying vPosition: vec2f;\n#include<gaussianSplattingFragmentDeclaration>\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#include<clipPlaneFragment>\nfragmentOutputs.color=gaussianColor(input.vColor,input.vPosition);}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const gaussianSplattingPixelShaderWGSL = { name, shader };\n"]}
1
+ {"version":3,"file":"gaussianSplatting.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplatting.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,+CAA+C,CAAC;AACvD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,yCAAyC,CAAC;AACjD,OAAO,uDAAuD,CAAC;AAC/D,OAAO,oCAAoC,CAAC;AAE5C,MAAM,IAAI,GAAG,8BAA8B,CAAC;AAC5C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;CAed,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/clipPlaneFragmentDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/fogFragmentDeclaration\";\nimport \"./ShadersInclude/gaussianSplattingFragmentDeclaration\";\nimport \"./ShadersInclude/clipPlaneFragment\";\n\nconst name = \"gaussianSplattingPixelShader\";\nconst shader = `#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvarying vColor: vec4f;varying vPosition: vec2f;\n#define CUSTOM_FRAGMENT_DEFINITIONS\n#include<gaussianSplattingFragmentDeclaration>\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar finalColor: vec4f=gaussianColor(input.vColor,input.vPosition);\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\nfragmentOutputs.color=finalColor;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const gaussianSplattingPixelShaderWGSL = { name, shader };\n"]}
@@ -35,9 +35,12 @@ var shTexture2: texture_2d<u32>;
35
35
  var partIndicesTexture: texture_2d<f32>;
36
36
  #endif
37
37
  varying vColor: vec4f;varying vPosition: vec2f;
38
+ #define CUSTOM_VERTEX_DEFINITIONS
38
39
  #include<gaussianSplatting>
39
40
  @vertex
40
- fn main(input : VertexInputs)->FragmentInputs {let splatIndex: f32=getSplatIndex(i32(input.position.z+0.5),input.splatIndex0,input.splatIndex1,input.splatIndex2,input.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);
41
+ fn main(input : VertexInputs)->FragmentInputs {
42
+ #define CUSTOM_VERTEX_MAIN_BEGIN
43
+ let splatIndex: f32=getSplatIndex(i32(input.position.z+0.5),input.splatIndex0,input.splatIndex1,input.splatIndex2,input.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);
41
44
  #if IS_COMPOUND
42
45
  let splatWorld: mat4x4f=getPartWorld(splat.partIndex);
43
46
  #else
@@ -52,10 +55,13 @@ vertexOutputs.vColor=vec4f(splat.color.xyz,splat.color.w*uniforms.alpha);
52
55
  #if IS_COMPOUND
53
56
  vertexOutputs.vColor.w*=uniforms.partVisibility[splat.partIndex];
54
57
  #endif
55
- vertexOutputs.position=gaussianSplatting(input.position.xy,worldPos.xyz,vec2f(1.0,1.0),covA,covB,splatWorld,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize);
58
+ let scale: vec2f=vec2f(1.,1.);
59
+ #define CUSTOM_VERTEX_UPDATE
60
+ vertexOutputs.position=gaussianSplatting(input.position.xy,worldPos.xyz,scale,covA,covB,splatWorld,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize);
56
61
  #include<clipPlaneVertex>
57
62
  #include<fogVertex>
58
63
  #include<logDepthVertex>
64
+ #define CUSTOM_VERTEX_MAIN_END
59
65
  }
60
66
  `;
61
67
  // Sideeffect
@@ -1 +1 @@
1
- {"version":3,"file":"gaussianSplatting.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplatting.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,6CAA6C,CAAC;AACrD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,4BAA4B,CAAC;AACpC,OAAO,iCAAiC,CAAC;AAEzC,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Cd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/sceneUboDeclaration\";\nimport \"./ShadersInclude/meshUboDeclaration\";\nimport \"./ShadersInclude/helperFunctions\";\nimport \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport \"./ShadersInclude/fogVertexDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/gaussianSplatting\";\nimport \"./ShadersInclude/clipPlaneVertex\";\nimport \"./ShadersInclude/fogVertex\";\nimport \"./ShadersInclude/logDepthVertex\";\n\nconst name = \"gaussianSplattingVertexShader\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n#include<helperFunctions>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\nattribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform eyePosition: vec3f;uniform alpha: f32;\n#if IS_COMPOUND\nuniform partWorld: array<mat4x4<f32>,MAX_PART_COUNT>;uniform partVisibility: array<f32,MAX_PART_COUNT>;\n#endif\nvar covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;\n#if SH_DEGREE>0\nvar shTexture0: texture_2d<u32>;\n#endif\n#if SH_DEGREE>1\nvar shTexture1: texture_2d<u32>;\n#endif\n#if SH_DEGREE>2\nvar shTexture2: texture_2d<u32>;\n#endif\n#if IS_COMPOUND\nvar partIndicesTexture: texture_2d<f32>;\n#endif\nvarying vColor: vec4f;varying vPosition: vec2f;\n#include<gaussianSplatting>\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {let splatIndex: f32=getSplatIndex(i32(input.position.z+0.5),input.splatIndex0,input.splatIndex1,input.splatIndex2,input.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);\n#if IS_COMPOUND\nlet splatWorld: mat4x4f=getPartWorld(splat.partIndex);\n#else\nlet splatWorld: mat4x4f=mesh.world;\n#endif\nlet worldPos: vec4f=splatWorld*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=input.position.xy;\n#if SH_DEGREE>0\nlet worldRot: mat3x3f= mat3x3f(splatWorld[0].xyz,splatWorld[1].xyz,splatWorld[2].xyz);let normWorldRot: mat3x3f=inverseMat3(worldRot);var eyeToSplatLocalSpace: vec3f=normalize(normWorldRot*(worldPos.xyz-uniforms.eyePosition.xyz));vertexOutputs.vColor=vec4f(splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);\n#else\nvertexOutputs.vColor=vec4f(splat.color.xyz,splat.color.w*uniforms.alpha);\n#endif\n#if IS_COMPOUND\nvertexOutputs.vColor.w*=uniforms.partVisibility[splat.partIndex];\n#endif\nvertexOutputs.position=gaussianSplatting(input.position.xy,worldPos.xyz,vec2f(1.0,1.0),covA,covB,splatWorld,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize);\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const gaussianSplattingVertexShaderWGSL = { name, shader };\n"]}
1
+ {"version":3,"file":"gaussianSplatting.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplatting.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,6CAA6C,CAAC;AACrD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,4BAA4B,CAAC;AACpC,OAAO,iCAAiC,CAAC;AAEzC,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/sceneUboDeclaration\";\nimport \"./ShadersInclude/meshUboDeclaration\";\nimport \"./ShadersInclude/helperFunctions\";\nimport \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport \"./ShadersInclude/fogVertexDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/gaussianSplatting\";\nimport \"./ShadersInclude/clipPlaneVertex\";\nimport \"./ShadersInclude/fogVertex\";\nimport \"./ShadersInclude/logDepthVertex\";\n\nconst name = \"gaussianSplattingVertexShader\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n#include<helperFunctions>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\nattribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform eyePosition: vec3f;uniform alpha: f32;\n#if IS_COMPOUND\nuniform partWorld: array<mat4x4<f32>,MAX_PART_COUNT>;uniform partVisibility: array<f32,MAX_PART_COUNT>;\n#endif\nvar covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;\n#if SH_DEGREE>0\nvar shTexture0: texture_2d<u32>;\n#endif\n#if SH_DEGREE>1\nvar shTexture1: texture_2d<u32>;\n#endif\n#if SH_DEGREE>2\nvar shTexture2: texture_2d<u32>;\n#endif\n#if IS_COMPOUND\nvar partIndicesTexture: texture_2d<f32>;\n#endif\nvarying vColor: vec4f;varying vPosition: vec2f;\n#define CUSTOM_VERTEX_DEFINITIONS\n#include<gaussianSplatting>\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nlet splatIndex: f32=getSplatIndex(i32(input.position.z+0.5),input.splatIndex0,input.splatIndex1,input.splatIndex2,input.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);\n#if IS_COMPOUND\nlet splatWorld: mat4x4f=getPartWorld(splat.partIndex);\n#else\nlet splatWorld: mat4x4f=mesh.world;\n#endif\nlet worldPos: vec4f=splatWorld*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=input.position.xy;\n#if SH_DEGREE>0\nlet worldRot: mat3x3f= mat3x3f(splatWorld[0].xyz,splatWorld[1].xyz,splatWorld[2].xyz);let normWorldRot: mat3x3f=inverseMat3(worldRot);var eyeToSplatLocalSpace: vec3f=normalize(normWorldRot*(worldPos.xyz-uniforms.eyePosition.xyz));vertexOutputs.vColor=vec4f(splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);\n#else\nvertexOutputs.vColor=vec4f(splat.color.xyz,splat.color.w*uniforms.alpha);\n#endif\n#if IS_COMPOUND\nvertexOutputs.vColor.w*=uniforms.partVisibility[splat.partIndex];\n#endif\nlet scale: vec2f=vec2f(1.,1.);\n#define CUSTOM_VERTEX_UPDATE\nvertexOutputs.position=gaussianSplatting(input.position.xy,worldPos.xyz,scale,covA,covB,splatWorld,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize);\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const gaussianSplattingVertexShaderWGSL = { name, shader };\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/core",
3
- "version": "8.50.5",
3
+ "version": "8.51.0",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",