@babylonjs/serializers 5.0.0-beta.8 → 5.0.0-beta.8-snapshot

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 (79) hide show
  1. package/package.json +20 -105
  2. package/OBJ/index.d.ts +0 -1
  3. package/OBJ/index.js +0 -2
  4. package/OBJ/index.js.map +0 -1
  5. package/OBJ/objSerializer.d.ts +0 -21
  6. package/OBJ/objSerializer.js +0 -160
  7. package/OBJ/objSerializer.js.map +0 -1
  8. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +0 -38
  9. package/glTF/2.0/Extensions/KHR_lights_punctual.js +0 -174
  10. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +0 -1
  11. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +0 -24
  12. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +0 -91
  13. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +0 -1
  14. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +0 -24
  15. package/glTF/2.0/Extensions/KHR_materials_sheen.js +0 -74
  16. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +0 -1
  17. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +0 -21
  18. package/glTF/2.0/Extensions/KHR_materials_unlit.js +0 -52
  19. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +0 -1
  20. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +0 -34
  21. package/glTF/2.0/Extensions/KHR_texture_transform.js +0 -137
  22. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +0 -1
  23. package/glTF/2.0/Extensions/index.d.ts +0 -5
  24. package/glTF/2.0/Extensions/index.js +0 -6
  25. package/glTF/2.0/Extensions/index.js.map +0 -1
  26. package/glTF/2.0/glTFAnimation.d.ts +0 -200
  27. package/glTF/2.0/glTFAnimation.js +0 -840
  28. package/glTF/2.0/glTFAnimation.js.map +0 -1
  29. package/glTF/2.0/glTFData.d.ts +0 -19
  30. package/glTF/2.0/glTFData.js +0 -53
  31. package/glTF/2.0/glTFData.js.map +0 -1
  32. package/glTF/2.0/glTFExporter.d.ts +0 -445
  33. package/glTF/2.0/glTFExporter.js +0 -1943
  34. package/glTF/2.0/glTFExporter.js.map +0 -1
  35. package/glTF/2.0/glTFExporterExtension.d.ts +0 -74
  36. package/glTF/2.0/glTFExporterExtension.js +0 -3
  37. package/glTF/2.0/glTFExporterExtension.js.map +0 -1
  38. package/glTF/2.0/glTFMaterialExporter.d.ts +0 -230
  39. package/glTF/2.0/glTFMaterialExporter.js +0 -1143
  40. package/glTF/2.0/glTFMaterialExporter.js.map +0 -1
  41. package/glTF/2.0/glTFSerializer.d.ts +0 -60
  42. package/glTF/2.0/glTFSerializer.js +0 -63
  43. package/glTF/2.0/glTFSerializer.js.map +0 -1
  44. package/glTF/2.0/glTFUtilities.d.ts +0 -96
  45. package/glTF/2.0/glTFUtilities.js +0 -196
  46. package/glTF/2.0/glTFUtilities.js.map +0 -1
  47. package/glTF/2.0/index.d.ts +0 -8
  48. package/glTF/2.0/index.js +0 -9
  49. package/glTF/2.0/index.js.map +0 -1
  50. package/glTF/2.0/shaders/textureTransform.fragment.d.ts +0 -5
  51. package/glTF/2.0/shaders/textureTransform.fragment.js +0 -7
  52. package/glTF/2.0/shaders/textureTransform.fragment.js.map +0 -1
  53. package/glTF/glTFFileExporter.d.ts +0 -20
  54. package/glTF/glTFFileExporter.js +0 -3
  55. package/glTF/glTFFileExporter.js.map +0 -1
  56. package/glTF/index.d.ts +0 -2
  57. package/glTF/index.js +0 -3
  58. package/glTF/index.js.map +0 -1
  59. package/index.d.ts +0 -3
  60. package/index.js.map +0 -1
  61. package/legacy/legacy-glTF2Serializer.d.ts +0 -2
  62. package/legacy/legacy-glTF2Serializer.js +0 -44
  63. package/legacy/legacy-glTF2Serializer.js.map +0 -1
  64. package/legacy/legacy-objSerializer.d.ts +0 -1
  65. package/legacy/legacy-objSerializer.js +0 -13
  66. package/legacy/legacy-objSerializer.js.map +0 -1
  67. package/legacy/legacy-stlSerializer.d.ts +0 -1
  68. package/legacy/legacy-stlSerializer.js +0 -13
  69. package/legacy/legacy-stlSerializer.js.map +0 -1
  70. package/legacy/legacy.d.ts +0 -4
  71. package/legacy/legacy.js +0 -5
  72. package/legacy/legacy.js.map +0 -1
  73. package/readme.md +0 -29
  74. package/stl/index.d.ts +0 -1
  75. package/stl/index.js +0 -2
  76. package/stl/index.js.map +0 -1
  77. package/stl/stlSerializer.d.ts +0 -17
  78. package/stl/stlSerializer.js +0 -108
  79. package/stl/stlSerializer.js.map +0 -1
@@ -1,230 +0,0 @@
1
- import { ITextureInfo, ImageMimeType, IMaterial, IMaterialPbrMetallicRoughness } from "babylonjs-gltf2interface";
2
- import { Nullable } from "@babylonjs/core/types";
3
- import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture";
4
- import { _Exporter } from "./glTFExporter";
5
- declare type Material = import("@babylonjs/core/Materials/material").Material;
6
- declare type StandardMaterial = import("@babylonjs/core/Materials/standardMaterial").StandardMaterial;
7
- declare type PBRBaseMaterial = import("@babylonjs/core/Materials/PBR/pbrBaseMaterial").PBRBaseMaterial;
8
- declare type PBRMetallicRoughnessMaterial = import("@babylonjs/core/Materials/PBR/pbrMetallicRoughnessMaterial").PBRMetallicRoughnessMaterial;
9
- /**
10
- * Utility methods for working with glTF material conversion properties. This class should only be used internally
11
- * @hidden
12
- */
13
- export declare class _GLTFMaterialExporter {
14
- /**
15
- * Represents the dielectric specular values for R, G and B
16
- */
17
- private static readonly _DielectricSpecular;
18
- /**
19
- * Allows the maximum specular power to be defined for material calculations
20
- */
21
- private static readonly _MaxSpecularPower;
22
- /**
23
- * Mapping to store textures
24
- */
25
- private _textureMap;
26
- /**
27
- * Numeric tolerance value
28
- */
29
- private static readonly _Epsilon;
30
- /**
31
- * Reference to the glTF Exporter
32
- */
33
- private _exporter;
34
- constructor(exporter: _Exporter);
35
- /**
36
- * Specifies if two colors are approximately equal in value
37
- * @param color1 first color to compare to
38
- * @param color2 second color to compare to
39
- * @param epsilon threshold value
40
- */
41
- private static FuzzyEquals;
42
- /**
43
- * Gets the materials from a Babylon scene and converts them to glTF materials
44
- * @param scene babylonjs scene
45
- * @param mimeType texture mime type
46
- * @param images array of images
47
- * @param textures array of textures
48
- * @param materials set of materials
49
- * @param imageData mapping of texture names to base64 textures
50
- * @param hasTextureCoords specifies if texture coordinates are present on the material
51
- */
52
- _convertMaterialsToGLTFAsync(exportMaterials: Set<Material>, mimeType: ImageMimeType, hasTextureCoords: boolean): Promise<void>;
53
- /**
54
- * Makes a copy of the glTF material without the texture parameters
55
- * @param originalMaterial original glTF material
56
- * @returns glTF material without texture parameters
57
- */
58
- _stripTexturesFromMaterial(originalMaterial: IMaterial): IMaterial;
59
- /**
60
- * Specifies if the material has any texture parameters present
61
- * @param material glTF Material
62
- * @returns boolean specifying if texture parameters are present
63
- */
64
- _hasTexturesPresent(material: IMaterial): boolean;
65
- _getTextureInfo(babylonTexture: Nullable<BaseTexture>): Nullable<ITextureInfo>;
66
- /**
67
- * Converts a Babylon StandardMaterial to a glTF Metallic Roughness Material
68
- * @param babylonStandardMaterial
69
- * @returns glTF Metallic Roughness Material representation
70
- */
71
- _convertToGLTFPBRMetallicRoughness(babylonStandardMaterial: StandardMaterial): IMaterialPbrMetallicRoughness;
72
- /**
73
- * Computes the metallic factor
74
- * @param diffuse diffused value
75
- * @param specular specular value
76
- * @param oneMinusSpecularStrength one minus the specular strength
77
- * @returns metallic value
78
- */
79
- static _SolveMetallic(diffuse: number, specular: number, oneMinusSpecularStrength: number): number;
80
- /**
81
- * Sets the glTF alpha mode to a glTF material from the Babylon Material
82
- * @param glTFMaterial glTF material
83
- * @param babylonMaterial Babylon material
84
- */
85
- private static _SetAlphaMode;
86
- /**
87
- * Converts a Babylon Standard Material to a glTF Material
88
- * @param babylonStandardMaterial BJS Standard Material
89
- * @param mimeType mime type to use for the textures
90
- * @param images array of glTF image interfaces
91
- * @param textures array of glTF texture interfaces
92
- * @param materials array of glTF material interfaces
93
- * @param imageData map of image file name to data
94
- * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
95
- */
96
- _convertStandardMaterialAsync(babylonStandardMaterial: StandardMaterial, mimeType: ImageMimeType, hasTextureCoords: boolean): Promise<IMaterial>;
97
- private _finishMaterial;
98
- /**
99
- * Converts a Babylon PBR Metallic Roughness Material to a glTF Material
100
- * @param babylonPBRMetalRoughMaterial BJS PBR Metallic Roughness Material
101
- * @param mimeType mime type to use for the textures
102
- * @param images array of glTF image interfaces
103
- * @param textures array of glTF texture interfaces
104
- * @param materials array of glTF material interfaces
105
- * @param imageData map of image file name to data
106
- * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
107
- */
108
- _convertPBRMetallicRoughnessMaterialAsync(babylonPBRMetalRoughMaterial: PBRMetallicRoughnessMaterial, mimeType: ImageMimeType, hasTextureCoords: boolean): Promise<IMaterial>;
109
- /**
110
- * Converts an image typed array buffer to a base64 image
111
- * @param buffer typed array buffer
112
- * @param width width of the image
113
- * @param height height of the image
114
- * @param mimeType mimetype of the image
115
- * @returns base64 image string
116
- */
117
- private _createBase64FromCanvasAsync;
118
- /**
119
- * Generates a white texture based on the specified width and height
120
- * @param width width of the texture in pixels
121
- * @param height height of the texture in pixels
122
- * @param scene babylonjs scene
123
- * @returns white texture
124
- */
125
- private _createWhiteTexture;
126
- /**
127
- * Resizes the two source textures to the same dimensions. If a texture is null, a default white texture is generated. If both textures are null, returns null
128
- * @param texture1 first texture to resize
129
- * @param texture2 second texture to resize
130
- * @param scene babylonjs scene
131
- * @returns resized textures or null
132
- */
133
- private _resizeTexturesToSameDimensions;
134
- /**
135
- * Converts an array of pixels to a Float32Array
136
- * Throws an error if the pixel format is not supported
137
- * @param pixels - array buffer containing pixel values
138
- * @returns Float32 of pixels
139
- */
140
- private _convertPixelArrayToFloat32;
141
- /**
142
- * Convert Specular Glossiness Textures to Metallic Roughness
143
- * See link below for info on the material conversions from PBR Metallic/Roughness and Specular/Glossiness
144
- * @link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/examples/convert-between-workflows-bjs/js/babylon.pbrUtilities.js
145
- * @param diffuseTexture texture used to store diffuse information
146
- * @param specularGlossinessTexture texture used to store specular and glossiness information
147
- * @param factors specular glossiness material factors
148
- * @param mimeType the mime type to use for the texture
149
- * @returns pbr metallic roughness interface or null
150
- */
151
- private _convertSpecularGlossinessTexturesToMetallicRoughnessAsync;
152
- /**
153
- * Converts specular glossiness material properties to metallic roughness
154
- * @param specularGlossiness interface with specular glossiness material properties
155
- * @returns interface with metallic roughness material properties
156
- */
157
- private _convertSpecularGlossinessToMetallicRoughness;
158
- /**
159
- * Calculates the surface reflectance, independent of lighting conditions
160
- * @param color Color source to calculate brightness from
161
- * @returns number representing the perceived brightness, or zero if color is undefined
162
- */
163
- private _getPerceivedBrightness;
164
- /**
165
- * Returns the maximum color component value
166
- * @param color
167
- * @returns maximum color component value, or zero if color is null or undefined
168
- */
169
- private _getMaxComponent;
170
- /**
171
- * Convert a PBRMaterial (Metallic/Roughness) to Metallic Roughness factors
172
- * @param babylonPBRMaterial BJS PBR Metallic Roughness Material
173
- * @param mimeType mime type to use for the textures
174
- * @param images array of glTF image interfaces
175
- * @param textures array of glTF texture interfaces
176
- * @param glTFPbrMetallicRoughness glTF PBR Metallic Roughness interface
177
- * @param imageData map of image file name to data
178
- * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
179
- * @returns glTF PBR Metallic Roughness factors
180
- */
181
- private _convertMetalRoughFactorsToMetallicRoughnessAsync;
182
- private _getGLTFTextureSampler;
183
- private _getGLTFTextureWrapMode;
184
- private _getGLTFTextureWrapModesSampler;
185
- /**
186
- * Convert a PBRMaterial (Specular/Glossiness) to Metallic Roughness factors
187
- * @param babylonPBRMaterial BJS PBR Metallic Roughness Material
188
- * @param mimeType mime type to use for the textures
189
- * @param images array of glTF image interfaces
190
- * @param textures array of glTF texture interfaces
191
- * @param glTFPbrMetallicRoughness glTF PBR Metallic Roughness interface
192
- * @param imageData map of image file name to data
193
- * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
194
- * @returns glTF PBR Metallic Roughness factors
195
- */
196
- private _convertSpecGlossFactorsToMetallicRoughnessAsync;
197
- /**
198
- * Converts a Babylon PBR Base Material to a glTF Material
199
- * @param babylonPBRMaterial BJS PBR Base Material
200
- * @param mimeType mime type to use for the textures
201
- * @param images array of glTF image interfaces
202
- * @param textures array of glTF texture interfaces
203
- * @param materials array of glTF material interfaces
204
- * @param imageData map of image file name to data
205
- * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
206
- */
207
- _convertPBRMaterialAsync(babylonPBRMaterial: PBRBaseMaterial, mimeType: ImageMimeType, hasTextureCoords: boolean): Promise<IMaterial>;
208
- private setMetallicRoughnessPbrMaterial;
209
- private getPixelsFromTexture;
210
- /**
211
- * Extracts a texture from a Babylon texture into file data and glTF data
212
- * @param babylonTexture Babylon texture to extract
213
- * @param mimeType Mime Type of the babylonTexture
214
- * @return glTF texture info, or null if the texture format is not supported
215
- */
216
- _exportTextureAsync(babylonTexture: BaseTexture, mimeType: ImageMimeType): Promise<Nullable<ITextureInfo>>;
217
- _exportTextureInfoAsync(babylonTexture: BaseTexture, mimeType: ImageMimeType): Promise<Nullable<ITextureInfo>>;
218
- /**
219
- * Builds a texture from base64 string
220
- * @param base64Texture base64 texture string
221
- * @param baseTextureName Name to use for the texture
222
- * @param mimeType image mime type for the texture
223
- * @param images array of images
224
- * @param textures array of textures
225
- * @param imageData map of image data
226
- * @returns glTF texture info, or null if the texture format is not supported
227
- */
228
- private _getTextureInfoFromBase64;
229
- }
230
- export {};