@babylonjs/smart-filters 0.4.3-alpha → 0.6.0-alpha

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 (139) hide show
  1. package/dist/blocks/baseBlock.d.ts +6 -0
  2. package/dist/blocks/baseBlock.d.ts.map +1 -1
  3. package/dist/blocks/baseBlock.js +8 -0
  4. package/dist/blocks/baseBlock.js.map +1 -1
  5. package/dist/blocks/customShaderBlock.d.ts +55 -0
  6. package/dist/blocks/customShaderBlock.d.ts.map +1 -0
  7. package/dist/blocks/customShaderBlock.js +139 -0
  8. package/dist/blocks/customShaderBlock.js.map +1 -0
  9. package/dist/blocks/inputBlock.deserializer.d.ts +1 -1
  10. package/dist/blocks/inputBlock.deserializer.d.ts.map +1 -1
  11. package/dist/blocks/inputBlock.serializer.d.ts +1 -1
  12. package/dist/blocks/inputBlock.serializer.d.ts.map +1 -1
  13. package/dist/blocks/inputBlock.serializer.js +3 -3
  14. package/dist/blocks/inputBlock.serializer.js.map +1 -1
  15. package/dist/blocks/shaderBlock.d.ts +3 -7
  16. package/dist/blocks/shaderBlock.d.ts.map +1 -1
  17. package/dist/blocks/shaderBlock.js +45 -15
  18. package/dist/blocks/shaderBlock.js.map +1 -1
  19. package/dist/blocks/textureOptions.d.ts +47 -0
  20. package/dist/blocks/textureOptions.d.ts.map +1 -0
  21. package/dist/blocks/textureOptions.js +37 -0
  22. package/dist/blocks/textureOptions.js.map +1 -0
  23. package/dist/command/command.d.ts +2 -3
  24. package/dist/command/command.d.ts.map +1 -1
  25. package/dist/command/command.js.map +1 -1
  26. package/dist/command/commandBufferDebugger.js +1 -1
  27. package/dist/command/commandBufferDebugger.js.map +1 -1
  28. package/dist/connection/connectionPointType.d.ts +4 -0
  29. package/dist/connection/connectionPointType.d.ts.map +1 -1
  30. package/dist/editorUtils/editableInPropertyPage.d.ts +4 -0
  31. package/dist/editorUtils/editableInPropertyPage.d.ts.map +1 -1
  32. package/dist/editorUtils/editableInPropertyPage.js +1 -0
  33. package/dist/editorUtils/editableInPropertyPage.js.map +1 -1
  34. package/dist/index.d.ts +2 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +2 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/optimization/smartFilterOptimizer.d.ts +1 -1
  39. package/dist/optimization/smartFilterOptimizer.d.ts.map +1 -1
  40. package/dist/optimization/smartFilterOptimizer.js +10 -9
  41. package/dist/optimization/smartFilterOptimizer.js.map +1 -1
  42. package/dist/runtime/renderTargetGenerator.d.ts +8 -1
  43. package/dist/runtime/renderTargetGenerator.d.ts.map +1 -1
  44. package/dist/runtime/renderTargetGenerator.js +37 -18
  45. package/dist/runtime/renderTargetGenerator.js.map +1 -1
  46. package/dist/serialization/importCustomShaderBlockDefinition.d.ts +11 -0
  47. package/dist/serialization/importCustomShaderBlockDefinition.d.ts.map +1 -0
  48. package/dist/serialization/importCustomShaderBlockDefinition.js +80 -0
  49. package/dist/serialization/importCustomShaderBlockDefinition.js.map +1 -0
  50. package/dist/serialization/index.d.ts +1 -0
  51. package/dist/serialization/index.d.ts.map +1 -1
  52. package/dist/serialization/index.js +1 -0
  53. package/dist/serialization/index.js.map +1 -1
  54. package/dist/serialization/serializedBlockDefinition.d.ts +7 -0
  55. package/dist/serialization/serializedBlockDefinition.d.ts.map +1 -0
  56. package/dist/serialization/serializedBlockDefinition.js +2 -0
  57. package/dist/serialization/serializedBlockDefinition.js.map +1 -0
  58. package/dist/serialization/serializedSmartFilter.d.ts +1 -1
  59. package/dist/serialization/serializedSmartFilter.d.ts.map +1 -1
  60. package/dist/serialization/smartFilterDeserializer.d.ts +12 -4
  61. package/dist/serialization/smartFilterDeserializer.d.ts.map +1 -1
  62. package/dist/serialization/smartFilterDeserializer.js +63 -34
  63. package/dist/serialization/smartFilterDeserializer.js.map +1 -1
  64. package/dist/serialization/smartFilterSerializer.d.ts +2 -2
  65. package/dist/serialization/smartFilterSerializer.d.ts.map +1 -1
  66. package/dist/serialization/smartFilterSerializer.js +9 -6
  67. package/dist/serialization/smartFilterSerializer.js.map +1 -1
  68. package/dist/serialization/v1/blockSerialization.types.d.ts +55 -0
  69. package/dist/serialization/v1/blockSerialization.types.d.ts.map +1 -0
  70. package/dist/serialization/v1/blockSerialization.types.js +7 -0
  71. package/dist/serialization/v1/blockSerialization.types.js.map +1 -0
  72. package/dist/serialization/v1/defaultBlockSerializer.d.ts +1 -1
  73. package/dist/serialization/v1/defaultBlockSerializer.d.ts.map +1 -1
  74. package/dist/serialization/v1/defaultBlockSerializer.js +1 -1
  75. package/dist/serialization/v1/defaultBlockSerializer.js.map +1 -1
  76. package/dist/serialization/v1/index.d.ts +1 -1
  77. package/dist/serialization/v1/index.d.ts.map +1 -1
  78. package/dist/serialization/v1/index.js +1 -1
  79. package/dist/serialization/v1/index.js.map +1 -1
  80. package/dist/serialization/v1/{serialization.types.d.ts → smartFilterSerialization.types.d.ts} +12 -11
  81. package/dist/serialization/v1/smartFilterSerialization.types.d.ts.map +1 -0
  82. package/dist/serialization/v1/smartFilterSerialization.types.js +2 -0
  83. package/dist/serialization/v1/smartFilterSerialization.types.js.map +1 -0
  84. package/dist/utils/buildTools/buildShaders.js +1 -1
  85. package/dist/utils/buildTools/buildShaders.js.map +1 -1
  86. package/dist/utils/buildTools/convertShaderForHardcodedBlock.d.ts +13 -0
  87. package/dist/utils/buildTools/convertShaderForHardcodedBlock.d.ts.map +1 -0
  88. package/dist/utils/buildTools/convertShaderForHardcodedBlock.js +116 -0
  89. package/dist/utils/buildTools/convertShaderForHardcodedBlock.js.map +1 -0
  90. package/dist/utils/buildTools/shaderCode.types.d.ts +43 -0
  91. package/dist/utils/buildTools/shaderCode.types.d.ts.map +1 -0
  92. package/dist/utils/buildTools/shaderCode.types.js +2 -0
  93. package/dist/utils/buildTools/shaderCode.types.js.map +1 -0
  94. package/dist/utils/buildTools/shaderConverter.d.ts +56 -8
  95. package/dist/utils/buildTools/shaderConverter.d.ts.map +1 -1
  96. package/dist/utils/buildTools/shaderConverter.js +87 -137
  97. package/dist/utils/buildTools/shaderConverter.js.map +1 -1
  98. package/dist/utils/buildTools/watchShaders.js +2 -2
  99. package/dist/utils/buildTools/watchShaders.js.map +1 -1
  100. package/dist/utils/renderTargetUtils.js +3 -3
  101. package/dist/utils/renderTargetUtils.js.map +1 -1
  102. package/dist/utils/shaderCodeUtils.d.ts +1 -42
  103. package/dist/utils/shaderCodeUtils.d.ts.map +1 -1
  104. package/dist/utils/shaderCodeUtils.js.map +1 -1
  105. package/package.json +1 -1
  106. package/readme.md +19 -15
  107. package/src/blocks/baseBlock.ts +9 -0
  108. package/src/blocks/customShaderBlock.ts +217 -0
  109. package/src/blocks/inputBlock.deserializer.ts +1 -1
  110. package/src/blocks/inputBlock.serializer.ts +4 -4
  111. package/src/blocks/shaderBlock.ts +36 -15
  112. package/src/blocks/textureOptions.ts +57 -0
  113. package/src/command/command.ts +2 -3
  114. package/src/command/commandBufferDebugger.ts +1 -1
  115. package/src/connection/connectionPointType.ts +11 -0
  116. package/src/editorUtils/editableInPropertyPage.ts +5 -0
  117. package/src/index.ts +2 -0
  118. package/src/optimization/smartFilterOptimizer.ts +11 -10
  119. package/src/runtime/renderTargetGenerator.ts +55 -20
  120. package/src/serialization/importCustomShaderBlockDefinition.ts +85 -0
  121. package/src/serialization/index.ts +1 -0
  122. package/src/serialization/serializedBlockDefinition.ts +7 -0
  123. package/src/serialization/serializedSmartFilter.ts +1 -1
  124. package/src/serialization/smartFilterDeserializer.ts +106 -52
  125. package/src/serialization/smartFilterSerializer.ts +11 -7
  126. package/src/serialization/v1/blockSerialization.types.ts +63 -0
  127. package/src/serialization/v1/defaultBlockSerializer.ts +2 -2
  128. package/src/serialization/v1/index.ts +1 -1
  129. package/src/serialization/v1/{serialization.types.ts → smartFilterSerialization.types.ts} +11 -10
  130. package/src/utils/buildTools/buildShaders.ts +1 -1
  131. package/src/utils/buildTools/convertShaderForHardcodedBlock.ts +149 -0
  132. package/src/utils/buildTools/shaderCode.types.ts +49 -0
  133. package/src/utils/buildTools/shaderConverter.ts +158 -178
  134. package/src/utils/buildTools/watchShaders.ts +2 -2
  135. package/src/utils/renderTargetUtils.ts +3 -3
  136. package/src/utils/shaderCodeUtils.ts +1 -50
  137. package/dist/serialization/v1/serialization.types.d.ts.map +0 -1
  138. package/dist/serialization/v1/serialization.types.js +0 -2
  139. package/dist/serialization/v1/serialization.types.js.map +0 -1
@@ -0,0 +1,63 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Data Types Used For Block Serialization
4
+ * ----------------------------------------------------------------------------
5
+ */
6
+
7
+ import type { AllConnectionPointTypes, ConnectionPointValue } from "../../connection/connectionPointType";
8
+ import type { ShaderProgram } from "../../utils/shaderCodeUtils";
9
+
10
+ /**
11
+ * The V1 definition of a serialized block. A block definition is loaded by a CustomShaderBlock and defines how a
12
+ * blockType works. This should not be confused with an ISerializedBockV1, which is a serialized instance of a block in a
13
+ * serialized SmartFilter graph. It is referenced by blockType in a serialized SmartFilter.
14
+ */
15
+ export type SerializedBlockDefinitionV1 = {
16
+ /**
17
+ * The version of the block definition format (format of the serialized data, not the version of the block definition itself).
18
+ */
19
+ formatVersion: 1;
20
+
21
+ /**
22
+ * The type used to refer to the block in serialized SmartFilters and in the editor UI.
23
+ * The application doing the deserialization will use this to instantiate the correct block definition.
24
+ * Block types are expected to be unique and their behavior should be semantically equivalent across implementations
25
+ * (their results must be similar enough that the differences are not perceivable).
26
+ */
27
+ blockType: string;
28
+
29
+ /**
30
+ * The shader program for the block.
31
+ */
32
+ shaderProgram: ShaderProgram;
33
+
34
+ /**
35
+ * The input connection points of the block.
36
+ */
37
+ inputConnectionPoints: SerializedInputConnectionPointV1[];
38
+
39
+ /**
40
+ * If true, the optimizer will not attempt to optimize this block.
41
+ */
42
+ disableOptimization: boolean;
43
+ };
44
+
45
+ /**
46
+ * A V1 input connection point of a serialized block definition.
47
+ */
48
+ export type SerializedInputConnectionPointV1<U extends AllConnectionPointTypes = AllConnectionPointTypes> = {
49
+ /**
50
+ * The name of the connection point.
51
+ */
52
+ name: string;
53
+
54
+ /**
55
+ * The type of the connection point.
56
+ */
57
+ type: U;
58
+
59
+ /**
60
+ * The optional default value of the connection point.
61
+ */
62
+ defaultValue?: ConnectionPointValue<U>;
63
+ };
@@ -1,5 +1,5 @@
1
1
  import type { BaseBlock } from "../../blocks/baseBlock";
2
- import type { ISerializedBlockV1, SerializeBlockV1 } from "./serialization.types";
2
+ import type { ISerializedBlockV1, SerializeBlockV1 } from "./smartFilterSerialization.types";
3
3
 
4
4
  /**
5
5
  * The default V1 block serializer which can be used for any block that relies only on ConnectionPoints
@@ -11,7 +11,7 @@ export const defaultBlockSerializer: SerializeBlockV1 = (block: BaseBlock): ISer
11
11
  return {
12
12
  name: block.name,
13
13
  uniqueId: block.uniqueId,
14
- className: block.getClassName(),
14
+ blockType: block.blockType,
15
15
  comments: block.comments,
16
16
  data: undefined,
17
17
  };
@@ -1,2 +1,2 @@
1
1
  export * from "./defaultBlockSerializer.js";
2
- export * from "./serialization.types.js";
2
+ export * from "./smartFilterSerialization.types.js";
@@ -14,8 +14,8 @@ import type { IEditorData } from "@babylonjs/shared-ui-components/nodeGraphSyste
14
14
  * V1 Serialized Smart Filter
15
15
  */
16
16
  export type SerializedSmartFilterV1 = {
17
- /** The version of the serialized data */
18
- version: 1;
17
+ /** The format version of the serialized data (not the version of the SmartFilter itself).*/
18
+ formatVersion: 1;
19
19
 
20
20
  /** The SmartFilter name */
21
21
  name: string;
@@ -34,7 +34,8 @@ export type SerializedSmartFilterV1 = {
34
34
  };
35
35
 
36
36
  /**
37
- * V1 Serialized Block
37
+ * V1 format of a block in a serialized Smart Filter.
38
+ * Not to be confused with a SerializedBlockDefinitionV1 which serializes the definition of a CustomShaderBlock.
38
39
  */
39
40
  export interface ISerializedBlockV1 {
40
41
  /** The name of the block */
@@ -43,8 +44,8 @@ export interface ISerializedBlockV1 {
43
44
  /** The unique ID of the block - correlates with the ID in the editorData for block position, etc. */
44
45
  uniqueId: number;
45
46
 
46
- /** The class name of the block */
47
- className: string;
47
+ /** The blockType of the block - used to determine how to instantiate the block during deserialization */
48
+ blockType: string;
48
49
 
49
50
  /** The comments for the block */
50
51
  comments: Nullable<string>;
@@ -82,13 +83,13 @@ export interface ISerializedConnectionV1 {
82
83
  export type SerializeBlockV1 = (block: BaseBlock) => ISerializedBlockV1;
83
84
 
84
85
  /**
85
- * A V1 block serializer
86
+ * A V1 serializer for blocks in a SmartFilter
86
87
  */
87
88
  export interface IBlockSerializerV1 {
88
- /** The className of the block that this serializer can serialize */
89
- className: string;
89
+ /** The blockType of the block that this serializer can serialize */
90
+ blockType: string;
90
91
 
91
- /** The function that serializes the block */
92
+ /** The function that serializes the block in the Smart Filter */
92
93
  serialize: SerializeBlockV1;
93
94
  }
94
95
 
@@ -99,7 +100,7 @@ export interface IBlockSerializerV1 {
99
100
  */
100
101
 
101
102
  /**
102
- * A function that deserializes a block from a V1 serialized block object
103
+ * A function that deserializes a V1 block in a SmartFilter
103
104
  */
104
105
  export type DeserializeBlockV1 = (
105
106
  smartFilter: SmartFilter,
@@ -5,7 +5,7 @@
5
5
  * @example node buildShaders.js <shaderPath> <importPath>
6
6
  */
7
7
 
8
- import { convertShaders } from "./shaderConverter.js";
8
+ import { convertShaders } from "./convertShaderForHardcodedBlock.js";
9
9
 
10
10
  const externalArguments = process.argv.slice(2);
11
11
  if (externalArguments.length >= 2 && externalArguments[0] && externalArguments[1]) {
@@ -0,0 +1,149 @@
1
+ import * as fs from "fs";
2
+ import * as path from "path";
3
+ import { parseFragmentShader } from "./shaderConverter.js";
4
+
5
+ const TYPE_IMPORT_PATH = "@TYPE_IMPORT_PATH@";
6
+ const VERTEX_SHADER = "@VERTEX_SHADER@";
7
+ const UNIFORMS = "@UNIFORMS@";
8
+ const CONSTS_VALUE = "@CONSTS@";
9
+ const CONSTS_PROPERTY = "@CONSTS_PROPERTY@";
10
+ const MAIN_INPUT_NAME = "@MAIN_INPUT_NAME@";
11
+ const MAIN_FUNCTION_NAME = "@MAIN_FUNCTION_NAME@";
12
+ const FUNCTIONS = "@FUNCTIONS@";
13
+ const FUNCTION_NAME = "@FUNCTION_NAME@";
14
+ const FUNCTION_CODE = "@FUNCTION_CODE@";
15
+ const UNIFORM_NAMES = "@UNIFORM_NAMES@";
16
+
17
+ const ConstsTemplate = `
18
+ const: \`${CONSTS_VALUE}\`,`;
19
+
20
+ const FunctionTemplate = `
21
+ {
22
+ name: "${FUNCTION_NAME}",
23
+ code: \`
24
+ ${FUNCTION_CODE}
25
+ \`,
26
+ },`;
27
+
28
+ const CodeLinePrefix = " ";
29
+ const UniformLinePrefix = " ";
30
+ const ConstLinePrefix = " ";
31
+
32
+ const ShaderTemplate = `import type { ShaderProgram } from "${TYPE_IMPORT_PATH}";
33
+
34
+ /**
35
+ * The shader program for the block.
36
+ */
37
+ export const shaderProgram: ShaderProgram = {
38
+ vertex: ${VERTEX_SHADER},
39
+ fragment: {
40
+ uniform: \`${UNIFORMS}\`,${CONSTS_PROPERTY}
41
+ mainInputTexture: "${MAIN_INPUT_NAME}",
42
+ mainFunctionName: "${MAIN_FUNCTION_NAME}",
43
+ functions: [${FUNCTIONS}
44
+ ],
45
+ },
46
+ };
47
+
48
+ /**
49
+ * The uniform names for this shader, to be used in the shader binding so
50
+ * that the names are always in sync.
51
+ */
52
+ export const uniforms = {
53
+ ${UNIFORM_NAMES}
54
+ };
55
+ `;
56
+
57
+ const UniformNameLinePrefix = " ";
58
+
59
+ /**
60
+ * Converts a single shader to a .ts file which can be imported by a hardcoded block
61
+ * @param fragmentShaderPath - The path to the fragment file for the shader
62
+ * @param importPath - The path to import the ShaderProgram type from
63
+ */
64
+ export function convertShaderForHardcodedBlock(fragmentShaderPath: string, importPath: string): void {
65
+ console.log(`Processing fragment shader: ${fragmentShaderPath}`);
66
+
67
+ // See if there is a corresponding vertex shader
68
+ let vertexShader: string | undefined = undefined;
69
+ const vertexShaderPath = fragmentShaderPath.replace(".fragment.glsl", ".vertex.glsl");
70
+ if (fs.existsSync(vertexShaderPath)) {
71
+ vertexShader = fs.readFileSync(vertexShaderPath, "utf8");
72
+ }
73
+ if (vertexShader) {
74
+ console.log("Found vertex shader");
75
+ }
76
+
77
+ // Read the fragment shader
78
+ const fragmentShader = fs.readFileSync(fragmentShaderPath, "utf8");
79
+ const fragmentShaderInfo = parseFragmentShader(fragmentShader);
80
+
81
+ // Write the shader TS file
82
+ const shaderFile = fragmentShaderPath.replace(".fragment.glsl", ".shader.ts");
83
+ const functionsSection: string[] = [];
84
+ for (const shaderFunction of fragmentShaderInfo.shaderCode.functions) {
85
+ functionsSection.push(
86
+ FunctionTemplate.replace(FUNCTION_NAME, shaderFunction.name).replace(
87
+ FUNCTION_CODE,
88
+ addLinePrefixes(shaderFunction.code, CodeLinePrefix)
89
+ )
90
+ );
91
+ }
92
+ const finalContents = ShaderTemplate.replace(VERTEX_SHADER, vertexShader ? `\`${vertexShader}\`` : "undefined")
93
+ .replace(TYPE_IMPORT_PATH, importPath)
94
+ .replace(UNIFORMS, "\n" + addLinePrefixes(fragmentShaderInfo.shaderCode.uniform || "", UniformLinePrefix))
95
+ .replace(MAIN_FUNCTION_NAME, fragmentShaderInfo.shaderCode.mainFunctionName)
96
+ .replace(MAIN_INPUT_NAME, fragmentShaderInfo.shaderCode.mainInputTexture || '""')
97
+ .replace(
98
+ CONSTS_PROPERTY,
99
+ fragmentShaderInfo.shaderCode.const
100
+ ? ConstsTemplate.replace(
101
+ CONSTS_VALUE,
102
+ addLinePrefixes(fragmentShaderInfo.shaderCode.const, ConstLinePrefix)
103
+ )
104
+ : ""
105
+ )
106
+ .replace(FUNCTIONS, functionsSection.join(""))
107
+ .replace(
108
+ UNIFORM_NAMES,
109
+ addLinePrefixes(
110
+ fragmentShaderInfo.uniforms.map((u) => `${u.name}: "${u.name}",`).join("\n"),
111
+ UniformNameLinePrefix
112
+ )
113
+ );
114
+
115
+ fs.writeFileSync(shaderFile, finalContents);
116
+ }
117
+
118
+ /**
119
+ * Converts .fragment.glsl and vertex.glsl file pairs into .shader.ts files which export a ShaderProgram object.
120
+ * @param shaderPath - The path to the .glsl files to convert.
121
+ * @param importPath - The path to import the ShaderProgram type from.
122
+ */
123
+ export function convertShaders(shaderPath: string, importPath: string) {
124
+ // Get all files in the path
125
+ const allFiles = fs.readdirSync(shaderPath, { withFileTypes: true, recursive: true });
126
+
127
+ // Find all fragment shaders (excluding the template)
128
+ const fragmentShaderFiles = allFiles.filter(
129
+ (file) => file.isFile() && file.name.endsWith(".fragment.glsl") && !file.name.endsWith("template.fragment.glsl")
130
+ );
131
+
132
+ // Convert all shaders
133
+ for (const fragmentShaderFile of fragmentShaderFiles) {
134
+ convertShaderForHardcodedBlock(path.join(fragmentShaderFile.path, fragmentShaderFile.name), importPath);
135
+ }
136
+ }
137
+
138
+ /**
139
+ * Prefixes each line in the input
140
+ * @param input - The input string
141
+ * @param prefix - The prefix to add to each line
142
+ * @returns The input with each line prefixed
143
+ */
144
+ function addLinePrefixes(input: string, prefix: string): string {
145
+ return input
146
+ .split("\n")
147
+ .map((line) => prefix + line)
148
+ .join("\n");
149
+ }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Describes a shader function.
3
+ */
4
+ export type ShaderFunction = {
5
+ /**
6
+ * The name of the function.
7
+ */
8
+ name: string;
9
+
10
+ /**
11
+ * The code of the function.
12
+ */
13
+ code: string;
14
+ };
15
+
16
+ /**
17
+ * Describes a shader code.
18
+ */
19
+ export type ShaderCode = {
20
+ /**
21
+ * The declaration of the const variables.
22
+ */
23
+ const?: string;
24
+
25
+ /**
26
+ * The declaration of the uniform variables.
27
+ */
28
+ uniform?: string;
29
+
30
+ /**
31
+ * The declaration of the uniform variables that should be common for all ShaderBlock instances using this shader code.
32
+ */
33
+ uniformSingle?: string;
34
+
35
+ /**
36
+ * The name of the main function.
37
+ */
38
+ mainFunctionName: string;
39
+
40
+ /**
41
+ * The name of the input texture which is passed through if the block is disabled.
42
+ */
43
+ mainInputTexture?: string;
44
+
45
+ /**
46
+ * The list of functions used in the shader.
47
+ */
48
+ functions: ShaderFunction[];
49
+ };