docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
listlengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
Tools.LoadFile(runtime.rootUrl + source.uri, data => { GLTFFileLoader.CreateTextureAsync(runtime, textureInfo, new Uint8Array(data), source.mimeType, onSuccess, onError); }, null, null, true, onError);
<mask> if (GLTFUtils.IsBase64(source.uri)) { <mask> setTimeout(() => onSuccess(new Uint8Array(GLTFUtils.DecodeBase64(source.uri)))); <mask> } <mask> else { <mask> Tools.LoadFile(gltfRuntime.rootUrl + source.uri, data => onSuccess(new Uint8Array(data)), null, null, true, onError); <mask> } <mask> } <mask> <mask> public static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { <mask> var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove public static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> add public static CreateTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, buffer: ArrayBufferView, mimeType: string, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index]; if (!texture || texture.source === undefined || texture.sampler === undefined) { onError(); return; } </s> remove public static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> add public static LoadTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index]; </s> remove return gltfRuntime; } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var buffer: IGLTFBuffer = gltfRuntime.buffers[id]; if (GLTFUtils.IsBase64(buffer.uri)) { setTimeout(() => onSuccess(new Uint8Array(GLTFUtils.DecodeBase64(buffer.uri)))); } else { Tools.LoadFile(gltfRuntime.rootUrl + buffer.uri, data => onSuccess(new Uint8Array(data)), null, null, true, onError); </s> add material.babylonMaterial.useEmissiveAsIllumination = (material.emissiveFactor || material.emissiveTexture) ? true : false; material.babylonMaterial.emissiveColor = material.emissiveFactor ? Color3.FromArray(material.emissiveFactor) : new Color3(0, 0, 0); if (material.emissiveTexture) { GLTFFileLoader.LoadTextureAsync(runtime, material.emissiveTexture, babylonTexture => { material.babylonMaterial.emissiveTexture = babylonTexture; }, () => Tools.Warn("Failed to load normal texture")); </s> remove if (GLTFUtils.IsBase64(source.uri)) { setTimeout(() => onSuccess(new Uint8Array(GLTFUtils.DecodeBase64(source.uri)))); </s> add if (source.uri === undefined) { var bufferView: IGLTFBufferView = runtime.gltf.bufferViews[source.bufferView]; var buffer = GLTFUtils.GetBufferFromBufferView(runtime, bufferView, 0, bufferView.byteLength, EComponentType.UNSIGNED_BYTE); GLTFFileLoader.CreateTextureAsync(runtime, textureInfo, buffer, source.mimeType, onSuccess, onError); } else if (GLTFUtils.IsBase64(source.uri)) { GLTFFileLoader.CreateTextureAsync(runtime, textureInfo, new Uint8Array(GLTFUtils.DecodeBase64(source.uri)), source.mimeType, onSuccess, onError); </s> remove public static LoadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(GLTFFileLoaderBase.CreateRuntime(JSON.parse(<string>data), scene, rootUrl)); }); }); } public static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(); }); }); } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.LoadTextureBufferAsync(gltfRuntime, id, buffer => GLTFFileLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError), onError); } public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError); }); } private static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }); } private static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }, () => { GLTFFileLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }); </s> add public static PostCreateRuntime(runtime: IGLTFRuntime): void { for (var extensionName in GLTFFileLoader.Extensions) { var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.postCreateRuntime) { extension.postCreateRuntime(runtime); } }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
public static CreateTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, buffer: ArrayBufferView, mimeType: string, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index]; if (!texture || texture.source === undefined || texture.sampler === undefined) { onError(); return; }
<mask> Tools.LoadFile(gltfRuntime.rootUrl + source.uri, data => onSuccess(new Uint8Array(data)), null, null, true, onError); <mask> } <mask> } <mask> <mask> public static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { <mask> var texture: IGLTFTexture = gltfRuntime.textures[id]; <mask> <mask> if (texture.babylonTexture) { <mask> onSuccess(texture.babylonTexture); <mask> return; <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove Tools.LoadFile(gltfRuntime.rootUrl + source.uri, data => onSuccess(new Uint8Array(data)), null, null, true, onError); </s> add Tools.LoadFile(runtime.rootUrl + source.uri, data => { GLTFFileLoader.CreateTextureAsync(runtime, textureInfo, new Uint8Array(data), source.mimeType, onSuccess, onError); }, null, null, true, onError); </s> remove public static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> add public static LoadTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index]; </s> remove return gltfRuntime; } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var buffer: IGLTFBuffer = gltfRuntime.buffers[id]; if (GLTFUtils.IsBase64(buffer.uri)) { setTimeout(() => onSuccess(new Uint8Array(GLTFUtils.DecodeBase64(buffer.uri)))); } else { Tools.LoadFile(gltfRuntime.rootUrl + buffer.uri, data => onSuccess(new Uint8Array(data)), null, null, true, onError); </s> add material.babylonMaterial.useEmissiveAsIllumination = (material.emissiveFactor || material.emissiveTexture) ? true : false; material.babylonMaterial.emissiveColor = material.emissiveFactor ? Color3.FromArray(material.emissiveFactor) : new Color3(0, 0, 0); if (material.emissiveTexture) { GLTFFileLoader.LoadTextureAsync(runtime, material.emissiveTexture, babylonTexture => { material.babylonMaterial.emissiveTexture = babylonTexture; }, () => Tools.Warn("Failed to load normal texture")); </s> remove if (!texture || !texture.source) { </s> add if (!texture || texture.source === undefined || texture.sampler === undefined) { </s> remove public static LoadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(GLTFFileLoaderBase.CreateRuntime(JSON.parse(<string>data), scene, rootUrl)); }); }); } public static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(); }); }); } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.LoadTextureBufferAsync(gltfRuntime, id, buffer => GLTFFileLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError), onError); } public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError); }); } private static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }); } private static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }, () => { GLTFFileLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }); </s> add public static PostCreateRuntime(runtime: IGLTFRuntime): void { for (var extensionName in GLTFFileLoader.Extensions) { var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.postCreateRuntime) { extension.postCreateRuntime(runtime); } }
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
var sampler: IGLTFSampler = runtime.gltf.samplers[texture.sampler];
<mask> onSuccess(texture.babylonTexture); <mask> return; <mask> } <mask> <mask> var sampler: IGLTFSampler = gltfRuntime.samplers[texture.sampler]; <mask> <mask> var createMipMaps = <mask> (sampler.minFilter === ETextureFilterType.NEAREST_MIPMAP_NEAREST) || <mask> (sampler.minFilter === ETextureFilterType.NEAREST_MIPMAP_LINEAR) || <mask> (sampler.minFilter === ETextureFilterType.LINEAR_MIPMAP_NEAREST) || </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove (sampler.minFilter === ETextureFilterType.NEAREST_MIPMAP_NEAREST) || (sampler.minFilter === ETextureFilterType.NEAREST_MIPMAP_LINEAR) || (sampler.minFilter === ETextureFilterType.LINEAR_MIPMAP_NEAREST) || (sampler.minFilter === ETextureFilterType.LINEAR_MIPMAP_LINEAR); </s> add (sampler.minFilter === ETextureMinFilter.NEAREST_MIPMAP_NEAREST) || (sampler.minFilter === ETextureMinFilter.NEAREST_MIPMAP_LINEAR) || (sampler.minFilter === ETextureMinFilter.LINEAR_MIPMAP_NEAREST) || (sampler.minFilter === ETextureMinFilter.LINEAR_MIPMAP_LINEAR); </s> remove var blob = new Blob([buffer]); </s> add var blob = new Blob([buffer], { type: mimeType }); </s> remove public static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> add public static CreateTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, buffer: ArrayBufferView, mimeType: string, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index]; if (!texture || texture.source === undefined || texture.sampler === undefined) { onError(); return; } </s> remove if (!texture || !texture.source) { </s> add if (!texture || texture.source === undefined || texture.sampler === undefined) { </s> remove if (gltfRuntime.importOnlyMeshes && !meshIncluded) { if (gltfRuntime.importMeshesNames.indexOf(node.name) !== -1 || gltfRuntime.importMeshesNames.length === 0) { </s> add if (runtime.importOnlyMeshes && !meshIncluded) { if (runtime.importMeshesNames.indexOf(node.name) !== -1 || runtime.importMeshesNames.length === 0) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
(sampler.minFilter === ETextureMinFilter.NEAREST_MIPMAP_NEAREST) || (sampler.minFilter === ETextureMinFilter.NEAREST_MIPMAP_LINEAR) || (sampler.minFilter === ETextureMinFilter.LINEAR_MIPMAP_NEAREST) || (sampler.minFilter === ETextureMinFilter.LINEAR_MIPMAP_LINEAR);
<mask> <mask> var sampler: IGLTFSampler = gltfRuntime.samplers[texture.sampler]; <mask> <mask> var createMipMaps = <mask> (sampler.minFilter === ETextureFilterType.NEAREST_MIPMAP_NEAREST) || <mask> (sampler.minFilter === ETextureFilterType.NEAREST_MIPMAP_LINEAR) || <mask> (sampler.minFilter === ETextureFilterType.LINEAR_MIPMAP_NEAREST) || <mask> (sampler.minFilter === ETextureFilterType.LINEAR_MIPMAP_LINEAR); <mask> <mask> var samplingMode = Texture.BILINEAR_SAMPLINGMODE; <mask> <mask> var blob = new Blob([buffer]); <mask> var blobURL = URL.createObjectURL(blob); </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove var sampler: IGLTFSampler = gltfRuntime.samplers[texture.sampler]; </s> add var sampler: IGLTFSampler = runtime.gltf.samplers[texture.sampler]; </s> remove var blob = new Blob([buffer]); </s> add var blob = new Blob([buffer], { type: mimeType }); </s> remove var newTexture = new Texture(blobURL, gltfRuntime.scene, !createMipMaps, true, samplingMode, revokeBlobURL, revokeBlobURL); newTexture.wrapU = GLTFUtils.GetWrapMode(sampler.wrapS); newTexture.wrapV = GLTFUtils.GetWrapMode(sampler.wrapT); newTexture.name = id; </s> add texture.babylonTexture = new Texture(blobURL, runtime.babylonScene, !createMipMaps, true, samplingMode, revokeBlobURL, revokeBlobURL); texture.babylonTexture.coordinatesIndex = textureInfo.texCoord === undefined ? 0 : textureInfo.texCoord; texture.babylonTexture.wrapU = GLTFUtils.GetWrapMode(sampler.wrapS); texture.babylonTexture.wrapV = GLTFUtils.GetWrapMode(sampler.wrapT); texture.babylonTexture.name = texture.name; </s> remove var orthographicCamera: IGLTFCameraOrthographic = camera[camera.type]; var orthoCamera = new FreeCamera(node.camera, Vector3.Zero(), gltfRuntime.scene); </s> add var orthographicCamera = camera.orthographic; var orthoCamera = new FreeCamera(node.name || "camera" + node.camera, Vector3.Zero(), runtime.babylonScene); </s> remove var perspectiveCamera: IGLTFCameraPerspective = camera[camera.type]; var persCamera = new FreeCamera(node.camera, Vector3.Zero(), gltfRuntime.scene); </s> add var perspectiveCamera = camera.perspective; var persCamera = new FreeCamera(node.name || "camera" + node.camera, Vector3.Zero(), runtime.babylonScene);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
var blob = new Blob([buffer], { type: mimeType });
<mask> (sampler.minFilter === ETextureFilterType.LINEAR_MIPMAP_LINEAR); <mask> <mask> var samplingMode = Texture.BILINEAR_SAMPLINGMODE; <mask> <mask> var blob = new Blob([buffer]); <mask> var blobURL = URL.createObjectURL(blob); <mask> var revokeBlobURL = () => URL.revokeObjectURL(blobURL); <mask> var newTexture = new Texture(blobURL, gltfRuntime.scene, !createMipMaps, true, samplingMode, revokeBlobURL, revokeBlobURL); <mask> newTexture.wrapU = GLTFUtils.GetWrapMode(sampler.wrapS); <mask> newTexture.wrapV = GLTFUtils.GetWrapMode(sampler.wrapT); </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove var newTexture = new Texture(blobURL, gltfRuntime.scene, !createMipMaps, true, samplingMode, revokeBlobURL, revokeBlobURL); newTexture.wrapU = GLTFUtils.GetWrapMode(sampler.wrapS); newTexture.wrapV = GLTFUtils.GetWrapMode(sampler.wrapT); newTexture.name = id; </s> add texture.babylonTexture = new Texture(blobURL, runtime.babylonScene, !createMipMaps, true, samplingMode, revokeBlobURL, revokeBlobURL); texture.babylonTexture.coordinatesIndex = textureInfo.texCoord === undefined ? 0 : textureInfo.texCoord; texture.babylonTexture.wrapU = GLTFUtils.GetWrapMode(sampler.wrapS); texture.babylonTexture.wrapV = GLTFUtils.GetWrapMode(sampler.wrapT); texture.babylonTexture.name = texture.name; </s> remove (sampler.minFilter === ETextureFilterType.NEAREST_MIPMAP_NEAREST) || (sampler.minFilter === ETextureFilterType.NEAREST_MIPMAP_LINEAR) || (sampler.minFilter === ETextureFilterType.LINEAR_MIPMAP_NEAREST) || (sampler.minFilter === ETextureFilterType.LINEAR_MIPMAP_LINEAR); </s> add (sampler.minFilter === ETextureMinFilter.NEAREST_MIPMAP_NEAREST) || (sampler.minFilter === ETextureMinFilter.NEAREST_MIPMAP_LINEAR) || (sampler.minFilter === ETextureMinFilter.LINEAR_MIPMAP_NEAREST) || (sampler.minFilter === ETextureMinFilter.LINEAR_MIPMAP_LINEAR); </s> remove texture.babylonTexture = newTexture; onSuccess(newTexture); </s> add onSuccess(texture.babylonTexture); </s> remove var geometry = new Geometry(id, gltfRuntime.scene, vertexData, false, newMesh); </s> add var geometry = new Geometry(name, runtime.babylonScene, vertexData, false, babylonMesh); </s> remove var sampler: IGLTFSampler = gltfRuntime.samplers[texture.sampler]; </s> add var sampler: IGLTFSampler = runtime.gltf.samplers[texture.sampler];
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
texture.babylonTexture = new Texture(blobURL, runtime.babylonScene, !createMipMaps, true, samplingMode, revokeBlobURL, revokeBlobURL); texture.babylonTexture.coordinatesIndex = textureInfo.texCoord === undefined ? 0 : textureInfo.texCoord; texture.babylonTexture.wrapU = GLTFUtils.GetWrapMode(sampler.wrapS); texture.babylonTexture.wrapV = GLTFUtils.GetWrapMode(sampler.wrapT); texture.babylonTexture.name = texture.name;
<mask> <mask> var blob = new Blob([buffer]); <mask> var blobURL = URL.createObjectURL(blob); <mask> var revokeBlobURL = () => URL.revokeObjectURL(blobURL); <mask> var newTexture = new Texture(blobURL, gltfRuntime.scene, !createMipMaps, true, samplingMode, revokeBlobURL, revokeBlobURL); <mask> newTexture.wrapU = GLTFUtils.GetWrapMode(sampler.wrapS); <mask> newTexture.wrapV = GLTFUtils.GetWrapMode(sampler.wrapT); <mask> newTexture.name = id; <mask> <mask> texture.babylonTexture = newTexture; <mask> onSuccess(newTexture); <mask> } <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove var blob = new Blob([buffer]); </s> add var blob = new Blob([buffer], { type: mimeType }); </s> remove texture.babylonTexture = newTexture; onSuccess(newTexture); </s> add onSuccess(texture.babylonTexture); </s> remove (sampler.minFilter === ETextureFilterType.NEAREST_MIPMAP_NEAREST) || (sampler.minFilter === ETextureFilterType.NEAREST_MIPMAP_LINEAR) || (sampler.minFilter === ETextureFilterType.LINEAR_MIPMAP_NEAREST) || (sampler.minFilter === ETextureFilterType.LINEAR_MIPMAP_LINEAR); </s> add (sampler.minFilter === ETextureMinFilter.NEAREST_MIPMAP_NEAREST) || (sampler.minFilter === ETextureMinFilter.NEAREST_MIPMAP_LINEAR) || (sampler.minFilter === ETextureMinFilter.LINEAR_MIPMAP_NEAREST) || (sampler.minFilter === ETextureMinFilter.LINEAR_MIPMAP_LINEAR); </s> remove var geometry = new Geometry(id, gltfRuntime.scene, vertexData, false, newMesh); </s> add var geometry = new Geometry(name, runtime.babylonScene, vertexData, false, babylonMesh); </s> remove if (!newMesh.material) { newMesh.material = multiMat; </s> add var multiMat = new MultiMaterial(name, runtime.babylonScene); if (!babylonMesh.material) { babylonMesh.material = multiMat;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
onSuccess(texture.babylonTexture);
<mask> newTexture.wrapU = GLTFUtils.GetWrapMode(sampler.wrapS); <mask> newTexture.wrapV = GLTFUtils.GetWrapMode(sampler.wrapT); <mask> newTexture.name = id; <mask> <mask> texture.babylonTexture = newTexture; <mask> onSuccess(newTexture); <mask> } <mask> <mask> public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): void { <mask> var shader: IGLTFShader = gltfRuntime.shaders[id]; <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): void { var shader: IGLTFShader = gltfRuntime.shaders[id]; if (GLTFUtils.IsBase64(shader.uri)) { var shaderString = atob(shader.uri.split(",")[1]); onSuccess(shaderString); } else { Tools.LoadFile(gltfRuntime.rootUrl + shader.uri, onSuccess, null, null, false, onError); } } </s> add /** * Import meshes */ public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { scene.useRightHandedSystem = true; </s> remove var newTexture = new Texture(blobURL, gltfRuntime.scene, !createMipMaps, true, samplingMode, revokeBlobURL, revokeBlobURL); newTexture.wrapU = GLTFUtils.GetWrapMode(sampler.wrapS); newTexture.wrapV = GLTFUtils.GetWrapMode(sampler.wrapT); newTexture.name = id; </s> add texture.babylonTexture = new Texture(blobURL, runtime.babylonScene, !createMipMaps, true, samplingMode, revokeBlobURL, revokeBlobURL); texture.babylonTexture.coordinatesIndex = textureInfo.texCoord === undefined ? 0 : textureInfo.texCoord; texture.babylonTexture.wrapU = GLTFUtils.GetWrapMode(sampler.wrapS); texture.babylonTexture.wrapV = GLTFUtils.GetWrapMode(sampler.wrapT); texture.babylonTexture.name = texture.name; </s> remove public static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> add public static LoadTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index]; </s> remove public static LoadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(GLTFFileLoaderBase.CreateRuntime(JSON.parse(<string>data), scene, rootUrl)); }); }); } public static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(); }); }); } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.LoadTextureBufferAsync(gltfRuntime, id, buffer => GLTFFileLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError), onError); } public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError); }); } private static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }); } private static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }, () => { GLTFFileLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }); </s> add public static PostCreateRuntime(runtime: IGLTFRuntime): void { for (var extensionName in GLTFFileLoader.Extensions) { var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.postCreateRuntime) { extension.postCreateRuntime(runtime); } } </s> remove private _loadShadersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { var hasShaders = false; </s> add private _loadBufferAsync(runtime: IGLTFRuntime, index: number, onSuccess: () => void, onError: () => void): void { var buffer = runtime.gltf.buffers[index];
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
/** * Import meshes */ public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { scene.useRightHandedSystem = true;
<mask> texture.babylonTexture = newTexture; <mask> onSuccess(newTexture); <mask> } <mask> <mask> public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): void { <mask> var shader: IGLTFShader = gltfRuntime.shaders[id]; <mask> <mask> if (GLTFUtils.IsBase64(shader.uri)) { <mask> var shaderString = atob(shader.uri.split(",")[1]); <mask> onSuccess(shaderString); <mask> } <mask> else { <mask> Tools.LoadFile(gltfRuntime.rootUrl + shader.uri, onSuccess, null, null, false, onError); <mask> } <mask> } <mask> <mask> public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { <mask> var material: IGLTFMaterial = gltfRuntime.materials[id]; <mask> var technique: IGLTFTechnique = gltfRuntime.techniques[material.technique]; <mask> if (!technique) { </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { var material: IGLTFMaterial = gltfRuntime.materials[id]; var technique: IGLTFTechnique = gltfRuntime.techniques[material.technique]; if (!technique) { var defaultMaterial = new StandardMaterial(id, gltfRuntime.scene); defaultMaterial.diffuseColor = new Color3(0.5, 0.5, 0.5); defaultMaterial.sideOrientation = Material.CounterClockWiseSideOrientation; onSuccess(defaultMaterial); </s> add var runtime = this._createRuntime(scene, data, rootUrl, true); if (!runtime) { if (onError) onError(); </s> remove texture.babylonTexture = newTexture; onSuccess(newTexture); </s> add onSuccess(texture.babylonTexture); </s> remove public static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> add public static LoadTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index]; </s> remove public static LoadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(GLTFFileLoaderBase.CreateRuntime(JSON.parse(<string>data), scene, rootUrl)); }); }); } public static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(); }); }); } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.LoadTextureBufferAsync(gltfRuntime, id, buffer => GLTFFileLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError), onError); } public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError); }); } private static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }); } private static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }, () => { GLTFFileLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }); </s> add public static PostCreateRuntime(runtime: IGLTFRuntime): void { for (var extensionName in GLTFFileLoader.Extensions) { var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.postCreateRuntime) { extension.postCreateRuntime(runtime); } } </s> remove public static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> add public static CreateTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, buffer: ArrayBufferView, mimeType: string, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index]; if (!texture || texture.source === undefined || texture.sampler === undefined) { onError(); return; }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
var runtime = this._createRuntime(scene, data, rootUrl, true); if (!runtime) { if (onError) onError();
<mask> Tools.LoadFile(gltfRuntime.rootUrl + shader.uri, onSuccess, null, null, false, onError); <mask> } <mask> } <mask> <mask> public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { <mask> var material: IGLTFMaterial = gltfRuntime.materials[id]; <mask> var technique: IGLTFTechnique = gltfRuntime.techniques[material.technique]; <mask> if (!technique) { <mask> var defaultMaterial = new StandardMaterial(id, gltfRuntime.scene); <mask> defaultMaterial.diffuseColor = new Color3(0.5, 0.5, 0.5); <mask> defaultMaterial.sideOrientation = Material.CounterClockWiseSideOrientation; <mask> onSuccess(defaultMaterial); <mask> return; <mask> } <mask> <mask> var program: IGLTFProgram = gltfRuntime.programs[technique.program]; <mask> var states: IGLTFTechniqueStates = technique.states; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): void { var shader: IGLTFShader = gltfRuntime.shaders[id]; if (GLTFUtils.IsBase64(shader.uri)) { var shaderString = atob(shader.uri.split(",")[1]); onSuccess(shaderString); } else { Tools.LoadFile(gltfRuntime.rootUrl + shader.uri, onSuccess, null, null, false, onError); } } </s> add /** * Import meshes */ public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { scene.useRightHandedSystem = true; </s> remove public static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> add public static LoadTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index]; </s> remove public static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> add public static CreateTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, buffer: ArrayBufferView, mimeType: string, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index]; if (!texture || texture.source === undefined || texture.sampler === undefined) { onError(); return; } </s> remove Tools.LoadFile(gltfRuntime.rootUrl + source.uri, data => onSuccess(new Uint8Array(data)), null, null, true, onError); </s> add Tools.LoadFile(runtime.rootUrl + source.uri, data => { GLTFFileLoader.CreateTextureAsync(runtime, textureInfo, new Uint8Array(data), source.mimeType, onSuccess, onError); }, null, null, true, onError); </s> remove return gltfRuntime; } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var buffer: IGLTFBuffer = gltfRuntime.buffers[id]; if (GLTFUtils.IsBase64(buffer.uri)) { setTimeout(() => onSuccess(new Uint8Array(GLTFUtils.DecodeBase64(buffer.uri)))); } else { Tools.LoadFile(gltfRuntime.rootUrl + buffer.uri, data => onSuccess(new Uint8Array(data)), null, null, true, onError); </s> add material.babylonMaterial.useEmissiveAsIllumination = (material.emissiveFactor || material.emissiveTexture) ? true : false; material.babylonMaterial.emissiveColor = material.emissiveFactor ? Color3.FromArray(material.emissiveFactor) : new Color3(0, 0, 0); if (material.emissiveTexture) { GLTFFileLoader.LoadTextureAsync(runtime, material.emissiveTexture, babylonTexture => { material.babylonMaterial.emissiveTexture = babylonTexture; }, () => Tools.Warn("Failed to load normal texture"));
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
if (meshesNames === "") { runtime.importMeshesNames = [];
<mask> onSuccess(defaultMaterial); <mask> return; <mask> } <mask> <mask> var program: IGLTFProgram = gltfRuntime.programs[technique.program]; <mask> var states: IGLTFTechniqueStates = technique.states; <mask> <mask> var vertexShader: string = Effect.ShadersStore[program.vertexShader + "VertexShader"]; <mask> var pixelShader: string = Effect.ShadersStore[program.fragmentShader + "PixelShader"]; <mask> var newVertexShader = ""; <mask> var newPixelShader = ""; <mask> <mask> var vertexTokenizer = new Tokenizer(vertexShader); <mask> var pixelTokenizer = new Tokenizer(pixelShader); <mask> <mask> var unTreatedUniforms: Object = {}; <mask> var uniforms = []; <mask> var attributes = []; <mask> var samplers = []; <mask> <mask> // Fill uniform, sampler2D and attributes <mask> for (var unif in technique.uniforms) { <mask> var uniform = technique.uniforms[unif]; <mask> var uniformParameter: IGLTFTechniqueParameter = technique.parameters[uniform]; <mask> <mask> unTreatedUniforms[unif] = uniformParameter; <mask> <mask> if (uniformParameter.semantic && !uniformParameter.node && !uniformParameter.source) { <mask> var transformIndex = glTFTransforms.indexOf(uniformParameter.semantic); <mask> if (transformIndex !== -1) { <mask> uniforms.push(babylonTransforms[transformIndex]); <mask> delete unTreatedUniforms[unif]; <mask> } <mask> else { <mask> uniforms.push(unif); <mask> } <mask> } <mask> else if (uniformParameter.type === EParameterType.SAMPLER_2D) { <mask> samplers.push(unif); <mask> } <mask> else { <mask> uniforms.push(unif); <mask> } <mask> } <mask> <mask> for (var attr in technique.attributes) { <mask> var attribute = technique.attributes[attr]; <mask> var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove /** * Returns the appropriate uniform if already handled by babylon */ var parseShaderUniforms = (tokenizer: Tokenizer, technique: IGLTFTechnique, unTreatedUniforms: Object): string => { for (var unif in technique.uniforms) { var uniform = technique.uniforms[unif]; var uniformParameter: IGLTFTechniqueParameter = technique.parameters[uniform]; if (tokenizer.currentIdentifier === unif) { if (uniformParameter.semantic && !uniformParameter.source && !uniformParameter.node) { var transformIndex = glTFTransforms.indexOf(uniformParameter.semantic); if (transformIndex !== -1) { delete unTreatedUniforms[unif]; return babylonTransforms[transformIndex]; } } } </s> add public getLength(): number { return this._arrayBuffer.byteLength; </s> remove for (var attr in technique.attributes) { var attribute = technique.attributes[attr]; var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; if (attributeParameter.semantic) { attributes.push(getAttribute(attributeParameter)); } </s> add else if (typeof meshesNames === "string") { runtime.importMeshesNames = [meshesNames]; } else if (meshesNames && !(meshesNames instanceof Array)) { runtime.importMeshesNames = [meshesNames]; } else { runtime.importMeshesNames = []; Tools.Warn("Argument meshesNames must be of type string or string[]"); </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newVertexShader += vertexTokenizer.currentString; continue; } var foundAttribute = false; </s> add var meshes = []; var skeletons = []; </s> remove for (var attr in technique.attributes) { var attribute = technique.attributes[attr]; var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; </s> add // Fill arrays of meshes and skeletons for (var nde in runtime.gltf.nodes) { var node: IGLTFNode = runtime.gltf.nodes[nde]; </s> remove if (vertexTokenizer.currentIdentifier === attr && attributeParameter.semantic) { newVertexShader += getAttribute(attributeParameter); foundAttribute = true; break; } </s> add if (node.babylonNode instanceof AbstractMesh) { meshes.push(<AbstractMesh>node.babylonNode);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
else if (typeof meshesNames === "string") { runtime.importMeshesNames = [meshesNames]; } else if (meshesNames && !(meshesNames instanceof Array)) { runtime.importMeshesNames = [meshesNames]; } else { runtime.importMeshesNames = []; Tools.Warn("Argument meshesNames must be of type string or string[]");
<mask> else { <mask> uniforms.push(unif); <mask> } <mask> } <mask> <mask> for (var attr in technique.attributes) { <mask> var attribute = technique.attributes[attr]; <mask> var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; <mask> <mask> if (attributeParameter.semantic) { <mask> attributes.push(getAttribute(attributeParameter)); <mask> } <mask> } <mask> <mask> // Configure vertex shader <mask> while (!vertexTokenizer.isEnd() && vertexTokenizer.getNextToken()) { <mask> var tokenType = vertexTokenizer.currentToken; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newVertexShader += vertexTokenizer.currentString; continue; } var foundAttribute = false; </s> add var meshes = []; var skeletons = []; </s> remove // Configure vertex shader while (!vertexTokenizer.isEnd() && vertexTokenizer.getNextToken()) { var tokenType = vertexTokenizer.currentToken; </s> add // Load scene importScene(runtime); </s> remove if (vertexTokenizer.currentIdentifier === attr && attributeParameter.semantic) { newVertexShader += getAttribute(attributeParameter); foundAttribute = true; break; } </s> add if (node.babylonNode instanceof AbstractMesh) { meshes.push(<AbstractMesh>node.babylonNode); </s> remove for (var attr in technique.attributes) { var attribute = technique.attributes[attr]; var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; </s> add // Fill arrays of meshes and skeletons for (var nde in runtime.gltf.nodes) { var node: IGLTFNode = runtime.gltf.nodes[nde]; </s> remove var program: IGLTFProgram = gltfRuntime.programs[technique.program]; var states: IGLTFTechniqueStates = technique.states; var vertexShader: string = Effect.ShadersStore[program.vertexShader + "VertexShader"]; var pixelShader: string = Effect.ShadersStore[program.fragmentShader + "PixelShader"]; var newVertexShader = ""; var newPixelShader = ""; var vertexTokenizer = new Tokenizer(vertexShader); var pixelTokenizer = new Tokenizer(pixelShader); var unTreatedUniforms: Object = {}; var uniforms = []; var attributes = []; var samplers = []; // Fill uniform, sampler2D and attributes for (var unif in technique.uniforms) { var uniform = technique.uniforms[unif]; var uniformParameter: IGLTFTechniqueParameter = technique.parameters[uniform]; unTreatedUniforms[unif] = uniformParameter; if (uniformParameter.semantic && !uniformParameter.node && !uniformParameter.source) { var transformIndex = glTFTransforms.indexOf(uniformParameter.semantic); if (transformIndex !== -1) { uniforms.push(babylonTransforms[transformIndex]); delete unTreatedUniforms[unif]; } else { uniforms.push(unif); } } else if (uniformParameter.type === EParameterType.SAMPLER_2D) { samplers.push(unif); } else { uniforms.push(unif); } </s> add if (meshesNames === "") { runtime.importMeshesNames = [];
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
// Load scene importScene(runtime);
<mask> attributes.push(getAttribute(attributeParameter)); <mask> } <mask> } <mask> <mask> // Configure vertex shader <mask> while (!vertexTokenizer.isEnd() && vertexTokenizer.getNextToken()) { <mask> var tokenType = vertexTokenizer.currentToken; <mask> <mask> if (tokenType !== ETokenType.IDENTIFIER) { <mask> newVertexShader += vertexTokenizer.currentString; <mask> continue; <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newVertexShader += vertexTokenizer.currentString; continue; } var foundAttribute = false; </s> add var meshes = []; var skeletons = []; </s> remove // Configure pixel shader while (!pixelTokenizer.isEnd() && pixelTokenizer.getNextToken()) { var tokenType = pixelTokenizer.currentToken; </s> add for (var skl in runtime.gltf.skins) { var skin: IGLTFSkin = runtime.gltf.skins[skl]; </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newPixelShader += pixelTokenizer.currentString; continue; </s> add if (skin.babylonSkeleton instanceof Skeleton) { skeletons.push(skin.babylonSkeleton); </s> remove for (var attr in technique.attributes) { var attribute = technique.attributes[attr]; var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; if (attributeParameter.semantic) { attributes.push(getAttribute(attributeParameter)); } </s> add else if (typeof meshesNames === "string") { runtime.importMeshesNames = [meshesNames]; } else if (meshesNames && !(meshesNames instanceof Array)) { runtime.importMeshesNames = [meshesNames]; } else { runtime.importMeshesNames = []; Tools.Warn("Argument meshesNames must be of type string or string[]"); </s> remove if (foundAttribute) { continue; } newVertexShader += parseShaderUniforms(vertexTokenizer, technique, unTreatedUniforms); </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
var meshes = []; var skeletons = [];
<mask> // Configure vertex shader <mask> while (!vertexTokenizer.isEnd() && vertexTokenizer.getNextToken()) { <mask> var tokenType = vertexTokenizer.currentToken; <mask> <mask> if (tokenType !== ETokenType.IDENTIFIER) { <mask> newVertexShader += vertexTokenizer.currentString; <mask> continue; <mask> } <mask> <mask> var foundAttribute = false; <mask> <mask> for (var attr in technique.attributes) { <mask> var attribute = technique.attributes[attr]; <mask> var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove // Configure vertex shader while (!vertexTokenizer.isEnd() && vertexTokenizer.getNextToken()) { var tokenType = vertexTokenizer.currentToken; </s> add // Load scene importScene(runtime); </s> remove for (var attr in technique.attributes) { var attribute = technique.attributes[attr]; var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; if (attributeParameter.semantic) { attributes.push(getAttribute(attributeParameter)); } </s> add else if (typeof meshesNames === "string") { runtime.importMeshesNames = [meshesNames]; } else if (meshesNames && !(meshesNames instanceof Array)) { runtime.importMeshesNames = [meshesNames]; } else { runtime.importMeshesNames = []; Tools.Warn("Argument meshesNames must be of type string or string[]"); </s> remove if (vertexTokenizer.currentIdentifier === attr && attributeParameter.semantic) { newVertexShader += getAttribute(attributeParameter); foundAttribute = true; break; } </s> add if (node.babylonNode instanceof AbstractMesh) { meshes.push(<AbstractMesh>node.babylonNode); </s> remove for (var attr in technique.attributes) { var attribute = technique.attributes[attr]; var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; </s> add // Fill arrays of meshes and skeletons for (var nde in runtime.gltf.nodes) { var node: IGLTFNode = runtime.gltf.nodes[nde]; </s> remove // Configure pixel shader while (!pixelTokenizer.isEnd() && pixelTokenizer.getNextToken()) { var tokenType = pixelTokenizer.currentToken; </s> add for (var skl in runtime.gltf.skins) { var skin: IGLTFSkin = runtime.gltf.skins[skl];
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
// Fill arrays of meshes and skeletons for (var nde in runtime.gltf.nodes) { var node: IGLTFNode = runtime.gltf.nodes[nde];
<mask> } <mask> <mask> var foundAttribute = false; <mask> <mask> for (var attr in technique.attributes) { <mask> var attribute = technique.attributes[attr]; <mask> var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; <mask> <mask> if (vertexTokenizer.currentIdentifier === attr && attributeParameter.semantic) { <mask> newVertexShader += getAttribute(attributeParameter); <mask> foundAttribute = true; <mask> break; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove if (vertexTokenizer.currentIdentifier === attr && attributeParameter.semantic) { newVertexShader += getAttribute(attributeParameter); foundAttribute = true; break; } </s> add if (node.babylonNode instanceof AbstractMesh) { meshes.push(<AbstractMesh>node.babylonNode); </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newVertexShader += vertexTokenizer.currentString; continue; } var foundAttribute = false; </s> add var meshes = []; var skeletons = []; </s> remove for (var attr in technique.attributes) { var attribute = technique.attributes[attr]; var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; if (attributeParameter.semantic) { attributes.push(getAttribute(attributeParameter)); } </s> add else if (typeof meshesNames === "string") { runtime.importMeshesNames = [meshesNames]; } else if (meshesNames && !(meshesNames instanceof Array)) { runtime.importMeshesNames = [meshesNames]; } else { runtime.importMeshesNames = []; Tools.Warn("Argument meshesNames must be of type string or string[]"); </s> remove var program: IGLTFProgram = gltfRuntime.programs[technique.program]; var states: IGLTFTechniqueStates = technique.states; var vertexShader: string = Effect.ShadersStore[program.vertexShader + "VertexShader"]; var pixelShader: string = Effect.ShadersStore[program.fragmentShader + "PixelShader"]; var newVertexShader = ""; var newPixelShader = ""; var vertexTokenizer = new Tokenizer(vertexShader); var pixelTokenizer = new Tokenizer(pixelShader); var unTreatedUniforms: Object = {}; var uniforms = []; var attributes = []; var samplers = []; // Fill uniform, sampler2D and attributes for (var unif in technique.uniforms) { var uniform = technique.uniforms[unif]; var uniformParameter: IGLTFTechniqueParameter = technique.parameters[uniform]; unTreatedUniforms[unif] = uniformParameter; if (uniformParameter.semantic && !uniformParameter.node && !uniformParameter.source) { var transformIndex = glTFTransforms.indexOf(uniformParameter.semantic); if (transformIndex !== -1) { uniforms.push(babylonTransforms[transformIndex]); delete unTreatedUniforms[unif]; } else { uniforms.push(unif); } } else if (uniformParameter.type === EParameterType.SAMPLER_2D) { samplers.push(unif); } else { uniforms.push(unif); } </s> add if (meshesNames === "") { runtime.importMeshesNames = []; </s> remove if (foundAttribute) { continue; } newVertexShader += parseShaderUniforms(vertexTokenizer, technique, unTreatedUniforms); </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
if (node.babylonNode instanceof AbstractMesh) { meshes.push(<AbstractMesh>node.babylonNode);
<mask> for (var attr in technique.attributes) { <mask> var attribute = technique.attributes[attr]; <mask> var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; <mask> <mask> if (vertexTokenizer.currentIdentifier === attr && attributeParameter.semantic) { <mask> newVertexShader += getAttribute(attributeParameter); <mask> foundAttribute = true; <mask> break; <mask> } <mask> } <mask> <mask> if (foundAttribute) { <mask> continue; <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove for (var attr in technique.attributes) { var attribute = technique.attributes[attr]; var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; </s> add // Fill arrays of meshes and skeletons for (var nde in runtime.gltf.nodes) { var node: IGLTFNode = runtime.gltf.nodes[nde]; </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newVertexShader += vertexTokenizer.currentString; continue; } var foundAttribute = false; </s> add var meshes = []; var skeletons = []; </s> remove for (var attr in technique.attributes) { var attribute = technique.attributes[attr]; var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; if (attributeParameter.semantic) { attributes.push(getAttribute(attributeParameter)); } </s> add else if (typeof meshesNames === "string") { runtime.importMeshesNames = [meshesNames]; } else if (meshesNames && !(meshesNames instanceof Array)) { runtime.importMeshesNames = [meshesNames]; } else { runtime.importMeshesNames = []; Tools.Warn("Argument meshesNames must be of type string or string[]"); </s> remove if (foundAttribute) { continue; } newVertexShader += parseShaderUniforms(vertexTokenizer, technique, unTreatedUniforms); </s> add </s> remove var program: IGLTFProgram = gltfRuntime.programs[technique.program]; var states: IGLTFTechniqueStates = technique.states; var vertexShader: string = Effect.ShadersStore[program.vertexShader + "VertexShader"]; var pixelShader: string = Effect.ShadersStore[program.fragmentShader + "PixelShader"]; var newVertexShader = ""; var newPixelShader = ""; var vertexTokenizer = new Tokenizer(vertexShader); var pixelTokenizer = new Tokenizer(pixelShader); var unTreatedUniforms: Object = {}; var uniforms = []; var attributes = []; var samplers = []; // Fill uniform, sampler2D and attributes for (var unif in technique.uniforms) { var uniform = technique.uniforms[unif]; var uniformParameter: IGLTFTechniqueParameter = technique.parameters[uniform]; unTreatedUniforms[unif] = uniformParameter; if (uniformParameter.semantic && !uniformParameter.node && !uniformParameter.source) { var transformIndex = glTFTransforms.indexOf(uniformParameter.semantic); if (transformIndex !== -1) { uniforms.push(babylonTransforms[transformIndex]); delete unTreatedUniforms[unif]; } else { uniforms.push(unif); } } else if (uniformParameter.type === EParameterType.SAMPLER_2D) { samplers.push(unif); } else { uniforms.push(unif); } </s> add if (meshesNames === "") { runtime.importMeshesNames = [];
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
<mask> foundAttribute = true; <mask> break; <mask> } <mask> } <mask> <mask> if (foundAttribute) { <mask> continue; <mask> } <mask> <mask> newVertexShader += parseShaderUniforms(vertexTokenizer, technique, unTreatedUniforms); <mask> } <mask> <mask> // Configure pixel shader <mask> while (!pixelTokenizer.isEnd() && pixelTokenizer.getNextToken()) { <mask> var tokenType = pixelTokenizer.currentToken; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove // Configure pixel shader while (!pixelTokenizer.isEnd() && pixelTokenizer.getNextToken()) { var tokenType = pixelTokenizer.currentToken; </s> add for (var skl in runtime.gltf.skins) { var skin: IGLTFSkin = runtime.gltf.skins[skl]; </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newPixelShader += pixelTokenizer.currentString; continue; </s> add if (skin.babylonSkeleton instanceof Skeleton) { skeletons.push(skin.babylonSkeleton); </s> remove // Configure vertex shader while (!vertexTokenizer.isEnd() && vertexTokenizer.getNextToken()) { var tokenType = vertexTokenizer.currentToken; </s> add // Load scene importScene(runtime); </s> remove if (vertexTokenizer.currentIdentifier === attr && attributeParameter.semantic) { newVertexShader += getAttribute(attributeParameter); foundAttribute = true; break; } </s> add if (node.babylonNode instanceof AbstractMesh) { meshes.push(<AbstractMesh>node.babylonNode); </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newVertexShader += vertexTokenizer.currentString; continue; } var foundAttribute = false; </s> add var meshes = []; var skeletons = [];
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
for (var skl in runtime.gltf.skins) { var skin: IGLTFSkin = runtime.gltf.skins[skl];
<mask> <mask> newVertexShader += parseShaderUniforms(vertexTokenizer, technique, unTreatedUniforms); <mask> } <mask> <mask> // Configure pixel shader <mask> while (!pixelTokenizer.isEnd() && pixelTokenizer.getNextToken()) { <mask> var tokenType = pixelTokenizer.currentToken; <mask> <mask> if (tokenType !== ETokenType.IDENTIFIER) { <mask> newPixelShader += pixelTokenizer.currentString; <mask> continue; <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newPixelShader += pixelTokenizer.currentString; continue; </s> add if (skin.babylonSkeleton instanceof Skeleton) { skeletons.push(skin.babylonSkeleton); </s> remove if (foundAttribute) { continue; } newVertexShader += parseShaderUniforms(vertexTokenizer, technique, unTreatedUniforms); </s> add </s> remove newPixelShader += parseShaderUniforms(pixelTokenizer, technique, unTreatedUniforms); </s> add </s> remove // Configure vertex shader while (!vertexTokenizer.isEnd() && vertexTokenizer.getNextToken()) { var tokenType = vertexTokenizer.currentToken; </s> add // Load scene importScene(runtime); </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newVertexShader += vertexTokenizer.currentString; continue; } var foundAttribute = false; </s> add var meshes = []; var skeletons = [];
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
if (skin.babylonSkeleton instanceof Skeleton) { skeletons.push(skin.babylonSkeleton);
<mask> // Configure pixel shader <mask> while (!pixelTokenizer.isEnd() && pixelTokenizer.getNextToken()) { <mask> var tokenType = pixelTokenizer.currentToken; <mask> <mask> if (tokenType !== ETokenType.IDENTIFIER) { <mask> newPixelShader += pixelTokenizer.currentString; <mask> continue; <mask> } <mask> <mask> newPixelShader += parseShaderUniforms(pixelTokenizer, technique, unTreatedUniforms); <mask> } <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove // Configure pixel shader while (!pixelTokenizer.isEnd() && pixelTokenizer.getNextToken()) { var tokenType = pixelTokenizer.currentToken; </s> add for (var skl in runtime.gltf.skins) { var skin: IGLTFSkin = runtime.gltf.skins[skl]; </s> remove newPixelShader += parseShaderUniforms(pixelTokenizer, technique, unTreatedUniforms); </s> add </s> remove if (foundAttribute) { continue; } newVertexShader += parseShaderUniforms(vertexTokenizer, technique, unTreatedUniforms); </s> add </s> remove // Configure vertex shader while (!vertexTokenizer.isEnd() && vertexTokenizer.getNextToken()) { var tokenType = vertexTokenizer.currentToken; </s> add // Load scene importScene(runtime); </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newVertexShader += vertexTokenizer.currentString; continue; } var foundAttribute = false; </s> add var meshes = []; var skeletons = [];
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
<mask> if (tokenType !== ETokenType.IDENTIFIER) { <mask> newPixelShader += pixelTokenizer.currentString; <mask> continue; <mask> } <mask> <mask> newPixelShader += parseShaderUniforms(pixelTokenizer, technique, unTreatedUniforms); <mask> } <mask> <mask> // Create shader material <mask> var shaderPath = { <mask> vertex: program.vertexShader + id, </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newPixelShader += pixelTokenizer.currentString; continue; </s> add if (skin.babylonSkeleton instanceof Skeleton) { skeletons.push(skin.babylonSkeleton); </s> remove // Configure pixel shader while (!pixelTokenizer.isEnd() && pixelTokenizer.getNextToken()) { var tokenType = pixelTokenizer.currentToken; </s> add for (var skl in runtime.gltf.skins) { var skin: IGLTFSkin = runtime.gltf.skins[skl]; </s> remove // Create shader material var shaderPath = { vertex: program.vertexShader + id, fragment: program.fragmentShader + id }; var options = { attributes: attributes, uniforms: uniforms, samplers: samplers, needAlphaBlending: states && states.enable && states.enable.indexOf(3042) !== -1 }; </s> add // Load buffers, materials, etc. this._loadBuffersAsync(runtime, () => { importMaterials(runtime); postLoad(runtime); </s> remove // Configure vertex shader while (!vertexTokenizer.isEnd() && vertexTokenizer.getNextToken()) { var tokenType = vertexTokenizer.currentToken; </s> add // Load scene importScene(runtime); </s> remove if (foundAttribute) { continue; } newVertexShader += parseShaderUniforms(vertexTokenizer, technique, unTreatedUniforms); </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
// Load buffers, materials, etc. this._loadBuffersAsync(runtime, () => { importMaterials(runtime); postLoad(runtime);
<mask> <mask> newPixelShader += parseShaderUniforms(pixelTokenizer, technique, unTreatedUniforms); <mask> } <mask> <mask> // Create shader material <mask> var shaderPath = { <mask> vertex: program.vertexShader + id, <mask> fragment: program.fragmentShader + id <mask> }; <mask> <mask> var options = { <mask> attributes: attributes, <mask> uniforms: uniforms, <mask> samplers: samplers, <mask> needAlphaBlending: states && states.enable && states.enable.indexOf(3042) !== -1 <mask> }; <mask> <mask> Effect.ShadersStore[program.vertexShader + id + "VertexShader"] = newVertexShader; <mask> Effect.ShadersStore[program.fragmentShader + id + "PixelShader"] = newPixelShader; <mask> <mask> var shaderMaterial = new ShaderMaterial(id, gltfRuntime.scene, shaderPath, options); </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove newPixelShader += parseShaderUniforms(pixelTokenizer, technique, unTreatedUniforms); </s> add </s> remove Effect.ShadersStore[program.vertexShader + id + "VertexShader"] = newVertexShader; Effect.ShadersStore[program.fragmentShader + id + "PixelShader"] = newPixelShader; var shaderMaterial = new ShaderMaterial(id, gltfRuntime.scene, shaderPath, options); shaderMaterial.onError = onShaderCompileError(program, shaderMaterial, onError); shaderMaterial.onCompiled = onShaderCompileSuccess(gltfRuntime, shaderMaterial, technique, material, unTreatedUniforms, onSuccess); shaderMaterial.sideOrientation = Material.CounterClockWiseSideOrientation; if (states && states.functions) { var functions = states.functions; if (functions.cullFace && functions.cullFace[0] !== ECullingType.BACK) { shaderMaterial.backFaceCulling = false; } var blendFunc = functions.blendFuncSeparate; if (blendFunc) { if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_ALPHA && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_COMBINE; } else if (blendFunc[0] === EBlendingFunction.ONE && blendFunc[1] === EBlendingFunction.ONE && blendFunc[2] === EBlendingFunction.ZERO && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_ONEONE; } else if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE && blendFunc[2] === EBlendingFunction.ZERO && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_ADD; } else if (blendFunc[0] === EBlendingFunction.ZERO && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_COLOR && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_SUBTRACT; } else if (blendFunc[0] === EBlendingFunction.DST_COLOR && blendFunc[1] === EBlendingFunction.ZERO && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_MULTIPLY; } else if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_COLOR && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_MAXIMIZED; } </s> add if (!GLTFFileLoader.IncrementalLoading && onSuccess) { onSuccess(meshes, null, skeletons); </s> remove Effect.ShadersStore["GLTFDefaultMaterialVertexShader"] = [ "precision highp float;", "", "uniform mat4 worldView;", "uniform mat4 projection;", "", "attribute vec3 position;", "", "void main(void)", "{", " gl_Position = projection * worldView * vec4(position, 1.0);", "}" ].join("\n"); Effect.ShadersStore["GLTFDefaultMaterialPixelShader"] = [ "precision highp float;", "", "uniform vec4 u_emission;", "", "void main(void)", "{", " gl_FragColor = u_emission;", "}" ].join("\n"); var shaderPath = { vertex: "GLTFDefaultMaterial", fragment: "GLTFDefaultMaterial" }; var options = { attributes: ["position"], uniforms: ["worldView", "projection", "u_emission"], samplers: [], needAlphaBlending: false }; GLTFUtils._DefaultMaterial = new ShaderMaterial("GLTFDefaultMaterial", scene, shaderPath, options); GLTFUtils._DefaultMaterial.setColor4("u_emission", new Color4(0.5, 0.5, 0.5, 1.0)); </s> add var material = new PBRMaterial("gltf_default", scene); material.sideOrientation = Material.CounterClockWiseSideOrientation; material.albedoColor = new Color3(0.5, 0.5, 0.5); material.metallic = 0; material.roughness = 0.5; GLTFUtils._DefaultMaterial = material; </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newPixelShader += pixelTokenizer.currentString; continue; </s> add if (skin.babylonSkeleton instanceof Skeleton) { skeletons.push(skin.babylonSkeleton); </s> remove Tools.Warn("Joint named " + skins.jointNames[i] + " does not exist"); </s> add Tools.Warn("Joint named " + skin.jointNames[i] + " does not exist");
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
if (!GLTFFileLoader.IncrementalLoading && onSuccess) { onSuccess(meshes, null, skeletons);
<mask> samplers: samplers, <mask> needAlphaBlending: states && states.enable && states.enable.indexOf(3042) !== -1 <mask> }; <mask> <mask> Effect.ShadersStore[program.vertexShader + id + "VertexShader"] = newVertexShader; <mask> Effect.ShadersStore[program.fragmentShader + id + "PixelShader"] = newPixelShader; <mask> <mask> var shaderMaterial = new ShaderMaterial(id, gltfRuntime.scene, shaderPath, options); <mask> shaderMaterial.onError = onShaderCompileError(program, shaderMaterial, onError); <mask> shaderMaterial.onCompiled = onShaderCompileSuccess(gltfRuntime, shaderMaterial, technique, material, unTreatedUniforms, onSuccess); <mask> shaderMaterial.sideOrientation = Material.CounterClockWiseSideOrientation; <mask> <mask> if (states && states.functions) { <mask> var functions = states.functions; <mask> if (functions.cullFace && functions.cullFace[0] !== ECullingType.BACK) { <mask> shaderMaterial.backFaceCulling = false; <mask> } <mask> <mask> var blendFunc = functions.blendFuncSeparate; <mask> if (blendFunc) { <mask> if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_ALPHA && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { <mask> shaderMaterial.alphaMode = Engine.ALPHA_COMBINE; <mask> } <mask> else if (blendFunc[0] === EBlendingFunction.ONE && blendFunc[1] === EBlendingFunction.ONE && blendFunc[2] === EBlendingFunction.ZERO && blendFunc[3] === EBlendingFunction.ONE) { <mask> shaderMaterial.alphaMode = Engine.ALPHA_ONEONE; <mask> } <mask> else if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE && blendFunc[2] === EBlendingFunction.ZERO && blendFunc[3] === EBlendingFunction.ONE) { <mask> shaderMaterial.alphaMode = Engine.ALPHA_ADD; <mask> } <mask> else if (blendFunc[0] === EBlendingFunction.ZERO && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_COLOR && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { <mask> shaderMaterial.alphaMode = Engine.ALPHA_SUBTRACT; <mask> } <mask> else if (blendFunc[0] === EBlendingFunction.DST_COLOR && blendFunc[1] === EBlendingFunction.ZERO && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { <mask> shaderMaterial.alphaMode = Engine.ALPHA_MULTIPLY; <mask> } <mask> else if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_COLOR && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { <mask> shaderMaterial.alphaMode = Engine.ALPHA_MAXIMIZED; <mask> } <mask> } <mask> } <mask> } <mask> } <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove } } } /** * glTF File Loader Plugin */ export class GLTFFileLoader implements ISceneLoaderPluginAsync { /** * Public members */ public extensions: ISceneLoaderPluginExtensions = { ".gltf": { isBinary: false }, ".glb": { isBinary: true } }; /** * Private members */ // None /** * Static members */ public static HomogeneousCoordinates: boolean = false; public static IncrementalLoading: boolean = true; public static Extensions: { [name: string]: GLTFFileLoaderExtension } = {}; </s> add }, onError); </s> remove else if (node.camera && !node.babylonNode && !gltfRuntime.importOnlyMeshes) { var camera: IGLTFCamera = gltfRuntime.cameras[node.camera]; </s> add else if (node.camera !== undefined && !node.babylonNode && !runtime.importOnlyMeshes) { var camera = runtime.gltf.cameras[node.camera]; </s> remove // Create shader material var shaderPath = { vertex: program.vertexShader + id, fragment: program.fragmentShader + id }; var options = { attributes: attributes, uniforms: uniforms, samplers: samplers, needAlphaBlending: states && states.enable && states.enable.indexOf(3042) !== -1 }; </s> add // Load buffers, materials, etc. this._loadBuffersAsync(runtime, () => { importMaterials(runtime); postLoad(runtime); </s> remove if (gltfRuntime.importOnlyMeshes && !meshIncluded) { if (gltfRuntime.importMeshesNames.indexOf(node.name) !== -1 || gltfRuntime.importMeshesNames.length === 0) { </s> add if (runtime.importOnlyMeshes && !meshIncluded) { if (runtime.importMeshesNames.indexOf(node.name) !== -1 || runtime.importMeshesNames.length === 0) { </s> remove if (!node.jointName && meshIncluded) { newNode = importNode(gltfRuntime, node, id, parent); </s> add if (node.jointName === undefined && meshIncluded) { newNode = importNode(runtime, node, parent);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
}, onError);
<mask> else if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_COLOR && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { <mask> shaderMaterial.alphaMode = Engine.ALPHA_MAXIMIZED; <mask> } <mask> } <mask> } <mask> } <mask> } <mask> <mask> /** <mask> * glTF File Loader Plugin <mask> */ <mask> export class GLTFFileLoader implements ISceneLoaderPluginAsync { <mask> /** <mask> * Public members <mask> */ <mask> public extensions: ISceneLoaderPluginExtensions = { <mask> ".gltf": { isBinary: false }, <mask> ".glb": { isBinary: true } <mask> }; <mask> <mask> /** <mask> * Private members <mask> */ <mask> // None <mask> <mask> /** <mask> * Static members <mask> */ <mask> public static HomogeneousCoordinates: boolean = false; <mask> public static IncrementalLoading: boolean = true; <mask> <mask> public static Extensions: { [name: string]: GLTFFileLoaderExtension } = {}; <mask> <mask> public static RegisterExtension(extension: GLTFFileLoaderExtension): void { <mask> if (GLTFFileLoader.Extensions[extension.name]) { <mask> Tools.Error("Tool with the same name \"" + extension.name + "\" already exists"); <mask> return; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove public static RegisterExtension(extension: GLTFFileLoaderExtension): void { if (GLTFFileLoader.Extensions[extension.name]) { Tools.Error("Tool with the same name \"" + extension.name + "\" already exists"); return; </s> add if (GLTFFileLoader.IncrementalLoading && onSuccess) { onSuccess(meshes, null, skeletons); </s> remove if (parsedData.nodes) { parseObject(parsedData.nodes, "nodes", gltfRuntime); } </s> add /** * Static members */ public static HomogeneousCoordinates: boolean = false; public static IncrementalLoading: boolean = true; </s> remove Effect.ShadersStore[program.vertexShader + id + "VertexShader"] = newVertexShader; Effect.ShadersStore[program.fragmentShader + id + "PixelShader"] = newPixelShader; var shaderMaterial = new ShaderMaterial(id, gltfRuntime.scene, shaderPath, options); shaderMaterial.onError = onShaderCompileError(program, shaderMaterial, onError); shaderMaterial.onCompiled = onShaderCompileSuccess(gltfRuntime, shaderMaterial, technique, material, unTreatedUniforms, onSuccess); shaderMaterial.sideOrientation = Material.CounterClockWiseSideOrientation; if (states && states.functions) { var functions = states.functions; if (functions.cullFace && functions.cullFace[0] !== ECullingType.BACK) { shaderMaterial.backFaceCulling = false; } var blendFunc = functions.blendFuncSeparate; if (blendFunc) { if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_ALPHA && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_COMBINE; } else if (blendFunc[0] === EBlendingFunction.ONE && blendFunc[1] === EBlendingFunction.ONE && blendFunc[2] === EBlendingFunction.ZERO && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_ONEONE; } else if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE && blendFunc[2] === EBlendingFunction.ZERO && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_ADD; } else if (blendFunc[0] === EBlendingFunction.ZERO && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_COLOR && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_SUBTRACT; } else if (blendFunc[0] === EBlendingFunction.DST_COLOR && blendFunc[1] === EBlendingFunction.ZERO && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_MULTIPLY; } else if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_COLOR && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_MAXIMIZED; } </s> add if (!GLTFFileLoader.IncrementalLoading && onSuccess) { onSuccess(meshes, null, skeletons); </s> remove if (parsedData.textures) { parseObject(parsedData.textures, "textures", gltfRuntime); </s> add public static RegisterExtension(extension: GLTFFileLoaderExtension): void { if (GLTFFileLoader.Extensions[extension.name]) { Tools.Error("Tool with the same name \"" + extension.name + "\" already exists"); return; </s> remove export class GLTFFileLoaderBase { public static CreateRuntime(parsedData: any, scene: Scene, rootUrl: string): IGLTFRuntime { var gltfRuntime: IGLTFRuntime = { extensions: {}, accessors: {}, buffers: {}, bufferViews: {}, meshes: {}, lights: {}, cameras: {}, nodes: {}, images: {}, textures: {}, shaders: {}, programs: {}, samplers: {}, techniques: {}, materials: {}, animations: {}, skins: {}, extensionsUsed: [], scenes: {}, buffersCount: 0, shaderscount: 0, scene: scene, rootUrl: rootUrl, loadedBufferCount: 0, loadedBufferViews: {}, loadedShaderCount: 0, importOnlyMeshes: false, dummyNodes: [] } // Parse if (parsedData.extensions) { parseObject(parsedData.extensions, "extensions", gltfRuntime); } if (parsedData.extensionsUsed) { parseObject(parsedData.extensionsUsed, "extensionsUsed", gltfRuntime); } if (parsedData.buffers) { parseBuffers(parsedData.buffers, gltfRuntime); } if (parsedData.bufferViews) { parseObject(parsedData.bufferViews, "bufferViews", gltfRuntime); } if (parsedData.accessors) { parseObject(parsedData.accessors, "accessors", gltfRuntime); } if (parsedData.meshes) { parseObject(parsedData.meshes, "meshes", gltfRuntime); } if (parsedData.lights) { parseObject(parsedData.lights, "lights", gltfRuntime); } </s> add export class GLTFFileLoader implements ISceneLoaderPluginAsync { /** * Public members */ public extensions: ISceneLoaderPluginExtensions = { ".gltf": { isBinary: false }, ".glb": { isBinary: true } };
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
if (GLTFFileLoader.IncrementalLoading && onSuccess) { onSuccess(meshes, null, skeletons);
<mask> public static IncrementalLoading: boolean = true; <mask> <mask> public static Extensions: { [name: string]: GLTFFileLoaderExtension } = {}; <mask> <mask> public static RegisterExtension(extension: GLTFFileLoaderExtension): void { <mask> if (GLTFFileLoader.Extensions[extension.name]) { <mask> Tools.Error("Tool with the same name \"" + extension.name + "\" already exists"); <mask> return; <mask> } <mask> <mask> GLTFFileLoader.Extensions[extension.name] = extension; <mask> } <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove } } } /** * glTF File Loader Plugin */ export class GLTFFileLoader implements ISceneLoaderPluginAsync { /** * Public members */ public extensions: ISceneLoaderPluginExtensions = { ".gltf": { isBinary: false }, ".glb": { isBinary: true } }; /** * Private members */ // None /** * Static members */ public static HomogeneousCoordinates: boolean = false; public static IncrementalLoading: boolean = true; public static Extensions: { [name: string]: GLTFFileLoaderExtension } = {}; </s> add }, onError); </s> remove if (parsedData.textures) { parseObject(parsedData.textures, "textures", gltfRuntime); </s> add public static RegisterExtension(extension: GLTFFileLoaderExtension): void { if (GLTFFileLoader.Extensions[extension.name]) { Tools.Error("Tool with the same name \"" + extension.name + "\" already exists"); return; </s> remove GLTFFileLoader.Extensions[extension.name] = extension; </s> add return true; </s> remove if (parsedData.images) { parseObject(parsedData.images, "images", gltfRuntime); } </s> add public static Extensions: { [name: string]: GLTFFileLoaderExtension } = {}; </s> remove if (parsedData.nodes) { parseObject(parsedData.nodes, "nodes", gltfRuntime); } </s> add /** * Static members */ public static HomogeneousCoordinates: boolean = false; public static IncrementalLoading: boolean = true;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
return true;
<mask> Tools.Error("Tool with the same name \"" + extension.name + "\" already exists"); <mask> return; <mask> } <mask> <mask> GLTFFileLoader.Extensions[extension.name] = extension; <mask> } <mask> <mask> /** <mask> * Import meshes <mask> */ </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove public static RegisterExtension(extension: GLTFFileLoaderExtension): void { if (GLTFFileLoader.Extensions[extension.name]) { Tools.Error("Tool with the same name \"" + extension.name + "\" already exists"); return; </s> add if (GLTFFileLoader.IncrementalLoading && onSuccess) { onSuccess(meshes, null, skeletons); </s> remove if (parsedData.textures) { parseObject(parsedData.textures, "textures", gltfRuntime); </s> add public static RegisterExtension(extension: GLTFFileLoaderExtension): void { if (GLTFFileLoader.Extensions[extension.name]) { Tools.Error("Tool with the same name \"" + extension.name + "\" already exists"); return; </s> remove } } } /** * glTF File Loader Plugin */ export class GLTFFileLoader implements ISceneLoaderPluginAsync { /** * Public members */ public extensions: ISceneLoaderPluginExtensions = { ".gltf": { isBinary: false }, ".glb": { isBinary: true } }; /** * Private members */ // None /** * Static members */ public static HomogeneousCoordinates: boolean = false; public static IncrementalLoading: boolean = true; public static Extensions: { [name: string]: GLTFFileLoaderExtension } = {}; </s> add }, onError); </s> remove * Import meshes </s> add * Load scene </s> remove if (parsedData.shaders) { parseShaders(parsedData.shaders, gltfRuntime); } </s> add GLTFFileLoader.Extensions[extension.name] = extension; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
* Load scene
<mask> GLTFFileLoader.Extensions[extension.name] = extension; <mask> } <mask> <mask> /** <mask> * Import meshes <mask> */ <mask> public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { <mask> scene.useRightHandedSystem = true; <mask> <mask> var gltfRuntime = GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { </s> add public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean { </s> remove public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): void { var shader: IGLTFShader = gltfRuntime.shaders[id]; if (GLTFUtils.IsBase64(shader.uri)) { var shaderString = atob(shader.uri.split(",")[1]); onSuccess(shaderString); } else { Tools.LoadFile(gltfRuntime.rootUrl + shader.uri, onSuccess, null, null, false, onError); } } </s> add /** * Import meshes */ public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { scene.useRightHandedSystem = true; </s> remove var gltfRuntime = GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { gltfRuntime.importOnlyMeshes = true; if (meshesNames === "") { gltfRuntime.importMeshesNames = []; } else if (typeof meshesNames === "string") { gltfRuntime.importMeshesNames = [meshesNames]; } else if (meshesNames && !(meshesNames instanceof Array)) { gltfRuntime.importMeshesNames = [meshesNames]; } else { gltfRuntime.importMeshesNames = []; Tools.Warn("Argument meshesNames must be of type string or string[]"); } // Create nodes this._createNodes(gltfRuntime); var meshes = []; var skeletons = []; // Fill arrays of meshes and skeletons for (var nde in gltfRuntime.nodes) { var node: IGLTFNode = gltfRuntime.nodes[nde]; if (node.babylonNode instanceof AbstractMesh) { meshes.push(<AbstractMesh>node.babylonNode); } } </s> add var runtime = this._createRuntime(scene, data, rootUrl, false); if (!runtime) { if (onError) onError(); return; } </s> remove /** * Load scene */ public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean { scene.useRightHandedSystem = true; GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { // Load runtime extensios GLTFFileLoaderExtension.LoadRuntimeExtensionsAsync(gltfRuntime, () => { // Create nodes this._createNodes(gltfRuntime); // Load buffers, shaders, materials, etc. this._loadBuffersAsync(gltfRuntime, () => { this._loadShadersAsync(gltfRuntime, () => { importMaterials(gltfRuntime); postLoad(gltfRuntime); if (!GLTFFileLoader.IncrementalLoading) { onSuccess(); } }); }); </s> add private _loadBuffersAsync(runtime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { if (runtime.gltf.buffers.length == 0) { onSuccess(); return; } </s> remove if (shaderString) { Effect.ShadersStore[sha + (shader.type === EShaderType.VERTEX ? "VertexShader" : "PixelShader")] = shaderString; } </s> add private _createRuntime(scene: Scene, data: any, rootUrl: string, importOnlyMeshes: boolean): IGLTFRuntime { var runtime: IGLTFRuntime = { gltf: null,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean {
<mask> <mask> /** <mask> * Import meshes <mask> */ <mask> public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { <mask> scene.useRightHandedSystem = true; <mask> <mask> var gltfRuntime = GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { <mask> gltfRuntime.importOnlyMeshes = true; <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove * Import meshes </s> add * Load scene </s> remove public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): void { var shader: IGLTFShader = gltfRuntime.shaders[id]; if (GLTFUtils.IsBase64(shader.uri)) { var shaderString = atob(shader.uri.split(",")[1]); onSuccess(shaderString); } else { Tools.LoadFile(gltfRuntime.rootUrl + shader.uri, onSuccess, null, null, false, onError); } } </s> add /** * Import meshes */ public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { scene.useRightHandedSystem = true; </s> remove var gltfRuntime = GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { gltfRuntime.importOnlyMeshes = true; if (meshesNames === "") { gltfRuntime.importMeshesNames = []; } else if (typeof meshesNames === "string") { gltfRuntime.importMeshesNames = [meshesNames]; } else if (meshesNames && !(meshesNames instanceof Array)) { gltfRuntime.importMeshesNames = [meshesNames]; } else { gltfRuntime.importMeshesNames = []; Tools.Warn("Argument meshesNames must be of type string or string[]"); } // Create nodes this._createNodes(gltfRuntime); var meshes = []; var skeletons = []; // Fill arrays of meshes and skeletons for (var nde in gltfRuntime.nodes) { var node: IGLTFNode = gltfRuntime.nodes[nde]; if (node.babylonNode instanceof AbstractMesh) { meshes.push(<AbstractMesh>node.babylonNode); } } </s> add var runtime = this._createRuntime(scene, data, rootUrl, false); if (!runtime) { if (onError) onError(); return; } </s> remove /** * Load scene */ public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean { scene.useRightHandedSystem = true; GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { // Load runtime extensios GLTFFileLoaderExtension.LoadRuntimeExtensionsAsync(gltfRuntime, () => { // Create nodes this._createNodes(gltfRuntime); // Load buffers, shaders, materials, etc. this._loadBuffersAsync(gltfRuntime, () => { this._loadShadersAsync(gltfRuntime, () => { importMaterials(gltfRuntime); postLoad(gltfRuntime); if (!GLTFFileLoader.IncrementalLoading) { onSuccess(); } }); }); </s> add private _loadBuffersAsync(runtime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { if (runtime.gltf.buffers.length == 0) { onSuccess(); return; } </s> remove if (shaderString) { Effect.ShadersStore[sha + (shader.type === EShaderType.VERTEX ? "VertexShader" : "PixelShader")] = shaderString; } </s> add private _createRuntime(scene: Scene, data: any, rootUrl: string, importOnlyMeshes: boolean): IGLTFRuntime { var runtime: IGLTFRuntime = { gltf: null,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
var runtime = this._createRuntime(scene, data, rootUrl, false); if (!runtime) { if (onError) onError(); return; }
<mask> */ <mask> public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { <mask> scene.useRightHandedSystem = true; <mask> <mask> var gltfRuntime = GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { <mask> gltfRuntime.importOnlyMeshes = true; <mask> <mask> if (meshesNames === "") { <mask> gltfRuntime.importMeshesNames = []; <mask> } <mask> else if (typeof meshesNames === "string") { <mask> gltfRuntime.importMeshesNames = [meshesNames]; <mask> } <mask> else if (meshesNames && !(meshesNames instanceof Array)) { <mask> gltfRuntime.importMeshesNames = [meshesNames]; <mask> } <mask> else { <mask> gltfRuntime.importMeshesNames = []; <mask> Tools.Warn("Argument meshesNames must be of type string or string[]"); <mask> } <mask> <mask> // Create nodes <mask> this._createNodes(gltfRuntime); <mask> <mask> var meshes = []; <mask> var skeletons = []; <mask> <mask> // Fill arrays of meshes and skeletons <mask> for (var nde in gltfRuntime.nodes) { <mask> var node: IGLTFNode = gltfRuntime.nodes[nde]; <mask> <mask> if (node.babylonNode instanceof AbstractMesh) { <mask> meshes.push(<AbstractMesh>node.babylonNode); <mask> } <mask> } <mask> <mask> for (var skl in gltfRuntime.skins) { <mask> var skin: IGLTFSkins = gltfRuntime.skins[skl]; <mask> <mask> if (skin.babylonSkeleton instanceof Skeleton) { </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove for (var attr in technique.attributes) { var attribute = technique.attributes[attr]; var attributeParameter: IGLTFTechniqueParameter = technique.parameters[attribute]; if (attributeParameter.semantic) { attributes.push(getAttribute(attributeParameter)); } </s> add else if (typeof meshesNames === "string") { runtime.importMeshesNames = [meshesNames]; } else if (meshesNames && !(meshesNames instanceof Array)) { runtime.importMeshesNames = [meshesNames]; } else { runtime.importMeshesNames = []; Tools.Warn("Argument meshesNames must be of type string or string[]"); </s> remove * Import meshes </s> add * Load scene </s> remove public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { </s> add public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean { </s> remove public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): void { var shader: IGLTFShader = gltfRuntime.shaders[id]; if (GLTFUtils.IsBase64(shader.uri)) { var shaderString = atob(shader.uri.split(",")[1]); onSuccess(shaderString); } else { Tools.LoadFile(gltfRuntime.rootUrl + shader.uri, onSuccess, null, null, false, onError); } } </s> add /** * Import meshes */ public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { scene.useRightHandedSystem = true; </s> remove for (var skl in gltfRuntime.skins) { var skin: IGLTFSkins = gltfRuntime.skins[skl]; </s> add importScene(runtime);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
importScene(runtime);
<mask> meshes.push(<AbstractMesh>node.babylonNode); <mask> } <mask> } <mask> <mask> for (var skl in gltfRuntime.skins) { <mask> var skin: IGLTFSkins = gltfRuntime.skins[skl]; <mask> <mask> if (skin.babylonSkeleton instanceof Skeleton) { <mask> skeletons.push(skin.babylonSkeleton); <mask> } <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove if (skin.babylonSkeleton instanceof Skeleton) { skeletons.push(skin.babylonSkeleton); } } // Load buffers, shaders, materials, etc. this._loadBuffersAsync(gltfRuntime, () => { this._loadShadersAsync(gltfRuntime, () => { importMaterials(gltfRuntime); postLoad(gltfRuntime); </s> add this._loadBuffersAsync(runtime, () => { importMaterials(runtime); postLoad(runtime); </s> remove var gltfRuntime = GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { gltfRuntime.importOnlyMeshes = true; if (meshesNames === "") { gltfRuntime.importMeshesNames = []; } else if (typeof meshesNames === "string") { gltfRuntime.importMeshesNames = [meshesNames]; } else if (meshesNames && !(meshesNames instanceof Array)) { gltfRuntime.importMeshesNames = [meshesNames]; } else { gltfRuntime.importMeshesNames = []; Tools.Warn("Argument meshesNames must be of type string or string[]"); } // Create nodes this._createNodes(gltfRuntime); var meshes = []; var skeletons = []; // Fill arrays of meshes and skeletons for (var nde in gltfRuntime.nodes) { var node: IGLTFNode = gltfRuntime.nodes[nde]; if (node.babylonNode instanceof AbstractMesh) { meshes.push(<AbstractMesh>node.babylonNode); } } </s> add var runtime = this._createRuntime(scene, data, rootUrl, false); if (!runtime) { if (onError) onError(); return; } </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newPixelShader += pixelTokenizer.currentString; continue; </s> add if (skin.babylonSkeleton instanceof Skeleton) { skeletons.push(skin.babylonSkeleton); </s> remove if (vertexTokenizer.currentIdentifier === attr && attributeParameter.semantic) { newVertexShader += getAttribute(attributeParameter); foundAttribute = true; break; } </s> add if (node.babylonNode instanceof AbstractMesh) { meshes.push(<AbstractMesh>node.babylonNode); </s> remove // Configure pixel shader while (!pixelTokenizer.isEnd() && pixelTokenizer.getNextToken()) { var tokenType = pixelTokenizer.currentToken; </s> add for (var skl in runtime.gltf.skins) { var skin: IGLTFSkin = runtime.gltf.skins[skl];
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
this._loadBuffersAsync(runtime, () => { importMaterials(runtime); postLoad(runtime);
<mask> <mask> for (var skl in gltfRuntime.skins) { <mask> var skin: IGLTFSkins = gltfRuntime.skins[skl]; <mask> <mask> if (skin.babylonSkeleton instanceof Skeleton) { <mask> skeletons.push(skin.babylonSkeleton); <mask> } <mask> } <mask> <mask> // Load buffers, shaders, materials, etc. <mask> this._loadBuffersAsync(gltfRuntime, () => { <mask> this._loadShadersAsync(gltfRuntime, () => { <mask> importMaterials(gltfRuntime); <mask> postLoad(gltfRuntime); <mask> <mask> if (!GLTFFileLoader.IncrementalLoading && onSuccess) { <mask> onSuccess(meshes, null, skeletons); <mask> } <mask> }); </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove if (!GLTFFileLoader.IncrementalLoading && onSuccess) { onSuccess(meshes, null, skeletons); } }); }); if (GLTFFileLoader.IncrementalLoading && onSuccess) { onSuccess(meshes, null, skeletons); </s> add if (!GLTFFileLoader.IncrementalLoading) { onSuccess(); </s> remove for (var skl in gltfRuntime.skins) { var skin: IGLTFSkins = gltfRuntime.skins[skl]; </s> add importScene(runtime); </s> remove /** * Load scene */ public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean { scene.useRightHandedSystem = true; GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { // Load runtime extensios GLTFFileLoaderExtension.LoadRuntimeExtensionsAsync(gltfRuntime, () => { // Create nodes this._createNodes(gltfRuntime); // Load buffers, shaders, materials, etc. this._loadBuffersAsync(gltfRuntime, () => { this._loadShadersAsync(gltfRuntime, () => { importMaterials(gltfRuntime); postLoad(gltfRuntime); if (!GLTFFileLoader.IncrementalLoading) { onSuccess(); } }); }); </s> add private _loadBuffersAsync(runtime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { if (runtime.gltf.buffers.length == 0) { onSuccess(); return; } </s> remove var gltfRuntime = GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { gltfRuntime.importOnlyMeshes = true; if (meshesNames === "") { gltfRuntime.importMeshesNames = []; } else if (typeof meshesNames === "string") { gltfRuntime.importMeshesNames = [meshesNames]; } else if (meshesNames && !(meshesNames instanceof Array)) { gltfRuntime.importMeshesNames = [meshesNames]; } else { gltfRuntime.importMeshesNames = []; Tools.Warn("Argument meshesNames must be of type string or string[]"); } // Create nodes this._createNodes(gltfRuntime); var meshes = []; var skeletons = []; // Fill arrays of meshes and skeletons for (var nde in gltfRuntime.nodes) { var node: IGLTFNode = gltfRuntime.nodes[nde]; if (node.babylonNode instanceof AbstractMesh) { meshes.push(<AbstractMesh>node.babylonNode); } } </s> add var runtime = this._createRuntime(scene, data, rootUrl, false); if (!runtime) { if (onError) onError(); return; } </s> remove if (tokenType !== ETokenType.IDENTIFIER) { newPixelShader += pixelTokenizer.currentString; continue; </s> add if (skin.babylonSkeleton instanceof Skeleton) { skeletons.push(skin.babylonSkeleton);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
if (!GLTFFileLoader.IncrementalLoading) { onSuccess();
<mask> this._loadShadersAsync(gltfRuntime, () => { <mask> importMaterials(gltfRuntime); <mask> postLoad(gltfRuntime); <mask> <mask> if (!GLTFFileLoader.IncrementalLoading && onSuccess) { <mask> onSuccess(meshes, null, skeletons); <mask> } <mask> }); <mask> }); <mask> <mask> if (GLTFFileLoader.IncrementalLoading && onSuccess) { <mask> onSuccess(meshes, null, skeletons); <mask> } <mask> }, onError); <mask> <mask> return true; <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove if (skin.babylonSkeleton instanceof Skeleton) { skeletons.push(skin.babylonSkeleton); } } // Load buffers, shaders, materials, etc. this._loadBuffersAsync(gltfRuntime, () => { this._loadShadersAsync(gltfRuntime, () => { importMaterials(gltfRuntime); postLoad(gltfRuntime); </s> add this._loadBuffersAsync(runtime, () => { importMaterials(runtime); postLoad(runtime); </s> remove public static RegisterExtension(extension: GLTFFileLoaderExtension): void { if (GLTFFileLoader.Extensions[extension.name]) { Tools.Error("Tool with the same name \"" + extension.name + "\" already exists"); return; </s> add if (GLTFFileLoader.IncrementalLoading && onSuccess) { onSuccess(meshes, null, skeletons); </s> remove /** * Load scene */ public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean { scene.useRightHandedSystem = true; GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { // Load runtime extensios GLTFFileLoaderExtension.LoadRuntimeExtensionsAsync(gltfRuntime, () => { // Create nodes this._createNodes(gltfRuntime); // Load buffers, shaders, materials, etc. this._loadBuffersAsync(gltfRuntime, () => { this._loadShadersAsync(gltfRuntime, () => { importMaterials(gltfRuntime); postLoad(gltfRuntime); if (!GLTFFileLoader.IncrementalLoading) { onSuccess(); } }); }); </s> add private _loadBuffersAsync(runtime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { if (runtime.gltf.buffers.length == 0) { onSuccess(); return; } </s> remove Effect.ShadersStore[program.vertexShader + id + "VertexShader"] = newVertexShader; Effect.ShadersStore[program.fragmentShader + id + "PixelShader"] = newPixelShader; var shaderMaterial = new ShaderMaterial(id, gltfRuntime.scene, shaderPath, options); shaderMaterial.onError = onShaderCompileError(program, shaderMaterial, onError); shaderMaterial.onCompiled = onShaderCompileSuccess(gltfRuntime, shaderMaterial, technique, material, unTreatedUniforms, onSuccess); shaderMaterial.sideOrientation = Material.CounterClockWiseSideOrientation; if (states && states.functions) { var functions = states.functions; if (functions.cullFace && functions.cullFace[0] !== ECullingType.BACK) { shaderMaterial.backFaceCulling = false; } var blendFunc = functions.blendFuncSeparate; if (blendFunc) { if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_ALPHA && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_COMBINE; } else if (blendFunc[0] === EBlendingFunction.ONE && blendFunc[1] === EBlendingFunction.ONE && blendFunc[2] === EBlendingFunction.ZERO && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_ONEONE; } else if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE && blendFunc[2] === EBlendingFunction.ZERO && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_ADD; } else if (blendFunc[0] === EBlendingFunction.ZERO && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_COLOR && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_SUBTRACT; } else if (blendFunc[0] === EBlendingFunction.DST_COLOR && blendFunc[1] === EBlendingFunction.ZERO && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_MULTIPLY; } else if (blendFunc[0] === EBlendingFunction.SRC_ALPHA && blendFunc[1] === EBlendingFunction.ONE_MINUS_SRC_COLOR && blendFunc[2] === EBlendingFunction.ONE && blendFunc[3] === EBlendingFunction.ONE) { shaderMaterial.alphaMode = Engine.ALPHA_MAXIMIZED; } </s> add if (!GLTFFileLoader.IncrementalLoading && onSuccess) { onSuccess(meshes, null, skeletons); </s> remove }, onError); return true; </s> add });
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
if (GLTFFileLoader.IncrementalLoading) { onSuccess(); }
<mask> }, onError); <mask> <mask> return true; <mask> } <mask> <mask> private _loadBuffersAsync(runtime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { <mask> if (runtime.gltf.buffers.length == 0) { </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove /** * Load scene */ public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean { scene.useRightHandedSystem = true; GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { // Load runtime extensios GLTFFileLoaderExtension.LoadRuntimeExtensionsAsync(gltfRuntime, () => { // Create nodes this._createNodes(gltfRuntime); // Load buffers, shaders, materials, etc. this._loadBuffersAsync(gltfRuntime, () => { this._loadShadersAsync(gltfRuntime, () => { importMaterials(gltfRuntime); postLoad(gltfRuntime); if (!GLTFFileLoader.IncrementalLoading) { onSuccess(); } }); }); </s> add private _loadBuffersAsync(runtime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { if (runtime.gltf.buffers.length == 0) { onSuccess(); return; } </s> remove public static LoadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(GLTFFileLoaderBase.CreateRuntime(JSON.parse(<string>data), scene, rootUrl)); }); }); } public static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(); }); }); } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.LoadTextureBufferAsync(gltfRuntime, id, buffer => GLTFFileLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError), onError); } public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError); }); } private static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }); } private static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }, () => { GLTFFileLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }); </s> add public static PostCreateRuntime(runtime: IGLTFRuntime): void { for (var extensionName in GLTFFileLoader.Extensions) { var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.postCreateRuntime) { extension.postCreateRuntime(runtime); } } </s> remove private _loadShadersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { var hasShaders = false; </s> add private _loadBufferAsync(runtime: IGLTFRuntime, index: number, onSuccess: () => void, onError: () => void): void { var buffer = runtime.gltf.buffers[index]; </s> remove }, onError); return true; </s> add }); </s> remove public static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> add public static LoadTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index];
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
private _loadBuffersAsync(runtime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { if (runtime.gltf.buffers.length == 0) { onSuccess(); return; }
<mask> <mask> return true; <mask> } <mask> <mask> /** <mask> * Load scene <mask> */ <mask> public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean { <mask> scene.useRightHandedSystem = true; <mask> <mask> GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { <mask> // Load runtime extensios <mask> GLTFFileLoaderExtension.LoadRuntimeExtensionsAsync(gltfRuntime, () => { <mask> // Create nodes <mask> this._createNodes(gltfRuntime); <mask> <mask> // Load buffers, shaders, materials, etc. <mask> this._loadBuffersAsync(gltfRuntime, () => { <mask> this._loadShadersAsync(gltfRuntime, () => { <mask> importMaterials(gltfRuntime); <mask> postLoad(gltfRuntime); <mask> <mask> if (!GLTFFileLoader.IncrementalLoading) { <mask> onSuccess(); <mask> } <mask> }); <mask> }); <mask> <mask> if (GLTFFileLoader.IncrementalLoading) { <mask> onSuccess(); <mask> } <mask> }, onError); </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { </s> add public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean { </s> remove if (skin.babylonSkeleton instanceof Skeleton) { skeletons.push(skin.babylonSkeleton); } } // Load buffers, shaders, materials, etc. this._loadBuffersAsync(gltfRuntime, () => { this._loadShadersAsync(gltfRuntime, () => { importMaterials(gltfRuntime); postLoad(gltfRuntime); </s> add this._loadBuffersAsync(runtime, () => { importMaterials(runtime); postLoad(runtime); </s> remove * Import meshes </s> add * Load scene </s> remove public static LoadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(GLTFFileLoaderBase.CreateRuntime(JSON.parse(<string>data), scene, rootUrl)); }); }); } public static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(); }); }); } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.LoadTextureBufferAsync(gltfRuntime, id, buffer => GLTFFileLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError), onError); } public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError); }); } private static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }); } private static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }, () => { GLTFFileLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }); </s> add public static PostCreateRuntime(runtime: IGLTFRuntime): void { for (var extensionName in GLTFFileLoader.Extensions) { var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.postCreateRuntime) { extension.postCreateRuntime(runtime); } } </s> remove if (!GLTFFileLoader.IncrementalLoading && onSuccess) { onSuccess(meshes, null, skeletons); } }); }); if (GLTFFileLoader.IncrementalLoading && onSuccess) { onSuccess(meshes, null, skeletons); </s> add if (!GLTFFileLoader.IncrementalLoading) { onSuccess();
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
var loadedCount = 0; runtime.gltf.buffers.forEach((buffer, index) => { this._loadBufferAsync(runtime, index, () => { if (++loadedCount >= runtime.gltf.buffers.length) {
<mask> } <mask> }); <mask> }); <mask> <mask> if (GLTFFileLoader.IncrementalLoading) { <mask> onSuccess(); <mask> } <mask> }, onError); <mask> }, onError); <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove }, onError); return true; </s> add }); </s> remove if (!GLTFFileLoader.IncrementalLoading && onSuccess) { onSuccess(meshes, null, skeletons); } }); }); if (GLTFFileLoader.IncrementalLoading && onSuccess) { onSuccess(meshes, null, skeletons); </s> add if (!GLTFFileLoader.IncrementalLoading) { onSuccess(); </s> remove /** * Load scene */ public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean { scene.useRightHandedSystem = true; GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { // Load runtime extensios GLTFFileLoaderExtension.LoadRuntimeExtensionsAsync(gltfRuntime, () => { // Create nodes this._createNodes(gltfRuntime); // Load buffers, shaders, materials, etc. this._loadBuffersAsync(gltfRuntime, () => { this._loadShadersAsync(gltfRuntime, () => { importMaterials(gltfRuntime); postLoad(gltfRuntime); if (!GLTFFileLoader.IncrementalLoading) { onSuccess(); } }); }); </s> add private _loadBuffersAsync(runtime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { if (runtime.gltf.buffers.length == 0) { onSuccess(); return; } </s> remove public static LoadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(GLTFFileLoaderBase.CreateRuntime(JSON.parse(<string>data), scene, rootUrl)); }); }); } public static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(); }); }); } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.LoadTextureBufferAsync(gltfRuntime, id, buffer => GLTFFileLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError), onError); } public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError); }); } private static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }); } private static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }, () => { GLTFFileLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }); </s> add public static PostCreateRuntime(runtime: IGLTFRuntime): void { for (var extensionName in GLTFFileLoader.Extensions) { var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.postCreateRuntime) { extension.postCreateRuntime(runtime); } }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
});
<mask> if (GLTFFileLoader.IncrementalLoading) { <mask> onSuccess(); <mask> } <mask> }, onError); <mask> }, onError); <mask> <mask> return true; <mask> } <mask> <mask> private _loadShadersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { <mask> var hasShaders = false; <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove var processShader = (sha: string, shader: IGLTFShader) => { GLTFFileLoaderExtension.LoadShaderStringAsync(gltfRuntime, sha, shaderString => { gltfRuntime.loadedShaderCount++; </s> add if (buffer.uri === undefined) { // buffer.loadedBufferView should already be set in _parseBinary onSuccess(); } else if (GLTFUtils.IsBase64(buffer.uri)) { var data = GLTFUtils.DecodeBase64(buffer.uri); setTimeout(() => { buffer.loadedBufferView = new Uint8Array(data); onSuccess(); }); } else { Tools.LoadFile(runtime.rootUrl + buffer.uri, data => { buffer.loadedBufferView = new Uint8Array(data); onSuccess(); }, null, null, true, onError); } } </s> remove private _loadShadersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { var hasShaders = false; </s> add private _loadBufferAsync(runtime: IGLTFRuntime, index: number, onSuccess: () => void, onError: () => void): void { var buffer = runtime.gltf.buffers[index]; </s> remove if (GLTFFileLoader.IncrementalLoading) { </s> add var loadedCount = 0; runtime.gltf.buffers.forEach((buffer, index) => { this._loadBufferAsync(runtime, index, () => { if (++loadedCount >= runtime.gltf.buffers.length) { </s> remove public static LoadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(GLTFFileLoaderBase.CreateRuntime(JSON.parse(<string>data), scene, rootUrl)); }); }); } public static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(); }); }); } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.LoadTextureBufferAsync(gltfRuntime, id, buffer => GLTFFileLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError), onError); } public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError); }); } private static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }); } private static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }, () => { GLTFFileLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }); </s> add public static PostCreateRuntime(runtime: IGLTFRuntime): void { for (var extensionName in GLTFFileLoader.Extensions) { var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.postCreateRuntime) { extension.postCreateRuntime(runtime); } }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
private _loadBufferAsync(runtime: IGLTFRuntime, index: number, onSuccess: () => void, onError: () => void): void { var buffer = runtime.gltf.buffers[index];
<mask> <mask> return true; <mask> } <mask> <mask> private _loadShadersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { <mask> var hasShaders = false; <mask> <mask> var processShader = (sha: string, shader: IGLTFShader) => { <mask> GLTFFileLoaderExtension.LoadShaderStringAsync(gltfRuntime, sha, shaderString => { <mask> gltfRuntime.loadedShaderCount++; <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove var processShader = (sha: string, shader: IGLTFShader) => { GLTFFileLoaderExtension.LoadShaderStringAsync(gltfRuntime, sha, shaderString => { gltfRuntime.loadedShaderCount++; </s> add if (buffer.uri === undefined) { // buffer.loadedBufferView should already be set in _parseBinary onSuccess(); } else if (GLTFUtils.IsBase64(buffer.uri)) { var data = GLTFUtils.DecodeBase64(buffer.uri); setTimeout(() => { buffer.loadedBufferView = new Uint8Array(data); onSuccess(); }); } else { Tools.LoadFile(runtime.rootUrl + buffer.uri, data => { buffer.loadedBufferView = new Uint8Array(data); onSuccess(); }, null, null, true, onError); } } </s> remove if (shaderString) { Effect.ShadersStore[sha + (shader.type === EShaderType.VERTEX ? "VertexShader" : "PixelShader")] = shaderString; } </s> add private _createRuntime(scene: Scene, data: any, rootUrl: string, importOnlyMeshes: boolean): IGLTFRuntime { var runtime: IGLTFRuntime = { gltf: null, </s> remove }, onError); return true; </s> add }); </s> remove private _loadBuffersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { var hasBuffers = false; </s> add GLTFFileLoaderExtension.PostCreateRuntime(runtime); return runtime; } </s> remove }; </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
if (buffer.uri === undefined) { // buffer.loadedBufferView should already be set in _parseBinary onSuccess(); } else if (GLTFUtils.IsBase64(buffer.uri)) { var data = GLTFUtils.DecodeBase64(buffer.uri); setTimeout(() => { buffer.loadedBufferView = new Uint8Array(data); onSuccess(); }); } else { Tools.LoadFile(runtime.rootUrl + buffer.uri, data => { buffer.loadedBufferView = new Uint8Array(data); onSuccess(); }, null, null, true, onError); } }
<mask> <mask> private _loadShadersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { <mask> var hasShaders = false; <mask> <mask> var processShader = (sha: string, shader: IGLTFShader) => { <mask> GLTFFileLoaderExtension.LoadShaderStringAsync(gltfRuntime, sha, shaderString => { <mask> gltfRuntime.loadedShaderCount++; <mask> <mask> if (shaderString) { <mask> Effect.ShadersStore[sha + (shader.type === EShaderType.VERTEX ? "VertexShader" : "PixelShader")] = shaderString; <mask> } <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove if (shaderString) { Effect.ShadersStore[sha + (shader.type === EShaderType.VERTEX ? "VertexShader" : "PixelShader")] = shaderString; } </s> add private _createRuntime(scene: Scene, data: any, rootUrl: string, importOnlyMeshes: boolean): IGLTFRuntime { var runtime: IGLTFRuntime = { gltf: null, </s> remove private _loadShadersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { var hasShaders = false; </s> add private _loadBufferAsync(runtime: IGLTFRuntime, index: number, onSuccess: () => void, onError: () => void): void { var buffer = runtime.gltf.buffers[index]; </s> remove if (gltfRuntime.loadedShaderCount === gltfRuntime.shaderscount) { onload(); } }, () => { Tools.Error("Error when loading shader program named " + sha + " located at " + shader.uri); }); }; </s> add babylonScene: scene, rootUrl: rootUrl, </s> remove }, onError); return true; </s> add }); </s> remove }; </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
private _createRuntime(scene: Scene, data: any, rootUrl: string, importOnlyMeshes: boolean): IGLTFRuntime { var runtime: IGLTFRuntime = { gltf: null,
<mask> var processShader = (sha: string, shader: IGLTFShader) => { <mask> GLTFFileLoaderExtension.LoadShaderStringAsync(gltfRuntime, sha, shaderString => { <mask> gltfRuntime.loadedShaderCount++; <mask> <mask> if (shaderString) { <mask> Effect.ShadersStore[sha + (shader.type === EShaderType.VERTEX ? "VertexShader" : "PixelShader")] = shaderString; <mask> } <mask> <mask> if (gltfRuntime.loadedShaderCount === gltfRuntime.shaderscount) { <mask> onload(); <mask> } <mask> }, () => { </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove var processShader = (sha: string, shader: IGLTFShader) => { GLTFFileLoaderExtension.LoadShaderStringAsync(gltfRuntime, sha, shaderString => { gltfRuntime.loadedShaderCount++; </s> add if (buffer.uri === undefined) { // buffer.loadedBufferView should already be set in _parseBinary onSuccess(); } else if (GLTFUtils.IsBase64(buffer.uri)) { var data = GLTFUtils.DecodeBase64(buffer.uri); setTimeout(() => { buffer.loadedBufferView = new Uint8Array(data); onSuccess(); }); } else { Tools.LoadFile(runtime.rootUrl + buffer.uri, data => { buffer.loadedBufferView = new Uint8Array(data); onSuccess(); }, null, null, true, onError); } } </s> remove if (gltfRuntime.loadedShaderCount === gltfRuntime.shaderscount) { onload(); } }, () => { Tools.Error("Error when loading shader program named " + sha + " located at " + shader.uri); }); }; </s> add babylonScene: scene, rootUrl: rootUrl, </s> remove private _loadShadersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { var hasShaders = false; </s> add private _loadBufferAsync(runtime: IGLTFRuntime, index: number, onSuccess: () => void, onError: () => void): void { var buffer = runtime.gltf.buffers[index]; </s> remove return gltfRuntime; } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var buffer: IGLTFBuffer = gltfRuntime.buffers[id]; if (GLTFUtils.IsBase64(buffer.uri)) { setTimeout(() => onSuccess(new Uint8Array(GLTFUtils.DecodeBase64(buffer.uri)))); } else { Tools.LoadFile(gltfRuntime.rootUrl + buffer.uri, data => onSuccess(new Uint8Array(data)), null, null, true, onError); </s> add material.babylonMaterial.useEmissiveAsIllumination = (material.emissiveFactor || material.emissiveTexture) ? true : false; material.babylonMaterial.emissiveColor = material.emissiveFactor ? Color3.FromArray(material.emissiveFactor) : new Color3(0, 0, 0); if (material.emissiveTexture) { GLTFFileLoader.LoadTextureAsync(runtime, material.emissiveTexture, babylonTexture => { material.babylonMaterial.emissiveTexture = babylonTexture; }, () => Tools.Warn("Failed to load normal texture")); </s> remove var replaceInString = (str: string, searchValue: string, replaceValue: string) => { while (str.indexOf(searchValue) !== -1) { str = str.replace(searchValue, replaceValue); } return str; }; var getAttribute = (attributeParameter: IGLTFTechniqueParameter) => { if (attributeParameter.semantic === "NORMAL") { return "normal"; } else if (attributeParameter.semantic === "POSITION") { return "position"; } else if (attributeParameter.semantic === "JOINT") { return "matricesIndices"; } else if (attributeParameter.semantic === "WEIGHT") { return "matricesWeights"; } else if (attributeParameter.semantic === "COLOR") { return "color"; } else if (attributeParameter.semantic.indexOf("TEXCOORD_") !== -1) { var channel = Number(attributeParameter.semantic.split("_")[1]); return "uv" + (channel === 0 ? "" : channel + 1); } }; </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
babylonScene: scene, rootUrl: rootUrl,
<mask> if (shaderString) { <mask> Effect.ShadersStore[sha + (shader.type === EShaderType.VERTEX ? "VertexShader" : "PixelShader")] = shaderString; <mask> } <mask> <mask> if (gltfRuntime.loadedShaderCount === gltfRuntime.shaderscount) { <mask> onload(); <mask> } <mask> }, () => { <mask> Tools.Error("Error when loading shader program named " + sha + " located at " + shader.uri); <mask> }); <mask> }; <mask> <mask> for (var sha in gltfRuntime.shaders) { <mask> hasShaders = true; <mask> <mask> var shader: IGLTFShader = gltfRuntime.shaders[sha]; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove for (var sha in gltfRuntime.shaders) { hasShaders = true; </s> add importOnlyMeshes: importOnlyMeshes, </s> remove if (shaderString) { Effect.ShadersStore[sha + (shader.type === EShaderType.VERTEX ? "VertexShader" : "PixelShader")] = shaderString; } </s> add private _createRuntime(scene: Scene, data: any, rootUrl: string, importOnlyMeshes: boolean): IGLTFRuntime { var runtime: IGLTFRuntime = { gltf: null, </s> remove var shader: IGLTFShader = gltfRuntime.shaders[sha]; if (shader) { processShader.bind(this, sha, shader)(); } else { Tools.Error("No shader named: " + sha); } </s> add dummyNodes: [] </s> remove if (gltfRuntime.loadedBufferCount === gltfRuntime.buffersCount) { onload(); } }, () => { Tools.Error("Error when loading buffer named " + buf + " located at " + buffer.uri); }); }; </s> add var length = binaryReader.readUint32(); if (length != data.byteLength) { Tools.Error("Length in header does not match actual data length: " + length + " != " + data.byteLength); return false; } </s> remove for (var buf in gltfRuntime.buffers) { hasBuffers = true; </s> add var contentLength = binaryReader.readUint32(); var contentFormat = <EBinaryContentFormat>binaryReader.readUint32();
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
importOnlyMeshes: importOnlyMeshes,
<mask> Tools.Error("Error when loading shader program named " + sha + " located at " + shader.uri); <mask> }); <mask> }; <mask> <mask> for (var sha in gltfRuntime.shaders) { <mask> hasShaders = true; <mask> <mask> var shader: IGLTFShader = gltfRuntime.shaders[sha]; <mask> if (shader) { <mask> processShader.bind(this, sha, shader)(); <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove if (gltfRuntime.loadedShaderCount === gltfRuntime.shaderscount) { onload(); } }, () => { Tools.Error("Error when loading shader program named " + sha + " located at " + shader.uri); }); }; </s> add babylonScene: scene, rootUrl: rootUrl, </s> remove var shader: IGLTFShader = gltfRuntime.shaders[sha]; if (shader) { processShader.bind(this, sha, shader)(); } else { Tools.Error("No shader named: " + sha); } </s> add dummyNodes: [] </s> remove for (var buf in gltfRuntime.buffers) { hasBuffers = true; </s> add var contentLength = binaryReader.readUint32(); var contentFormat = <EBinaryContentFormat>binaryReader.readUint32(); </s> remove if (gltfRuntime.loadedBufferCount === gltfRuntime.buffersCount) { onload(); } }, () => { Tools.Error("Error when loading buffer named " + buf + " located at " + buffer.uri); }); }; </s> add var length = binaryReader.readUint32(); if (length != data.byteLength) { Tools.Error("Length in header does not match actual data length: " + length + " != " + data.byteLength); return false; } </s> remove Tools.Warn("Joint named " + skins.jointNames[j] + " does not exist when looking for parent"); </s> add Tools.Warn("Joint named " + skin.jointNames[j] + " does not exist when looking for parent");
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
dummyNodes: []
<mask> <mask> for (var sha in gltfRuntime.shaders) { <mask> hasShaders = true; <mask> <mask> var shader: IGLTFShader = gltfRuntime.shaders[sha]; <mask> if (shader) { <mask> processShader.bind(this, sha, shader)(); <mask> } <mask> else { <mask> Tools.Error("No shader named: " + sha); <mask> } <mask> } <mask> <mask> if (!hasShaders) { <mask> onload(); <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove for (var sha in gltfRuntime.shaders) { hasShaders = true; </s> add importOnlyMeshes: importOnlyMeshes, </s> remove if (gltfRuntime.loadedShaderCount === gltfRuntime.shaderscount) { onload(); } }, () => { Tools.Error("Error when loading shader program named " + sha + " located at " + shader.uri); }); }; </s> add babylonScene: scene, rootUrl: rootUrl, </s> remove if (!hasShaders) { onload(); </s> add if (data instanceof ArrayBuffer) { if (!this._parseBinary(runtime, <ArrayBuffer>data)) { return null; } } else { runtime.gltf = JSON.parse(<string>data); </s> remove var buffer: IGLTFBuffer = gltfRuntime.buffers[buf]; if (buffer) { processBuffer.bind(this, buf, buffer)(); } else { Tools.Error("No buffer named: " + buf); } </s> add switch (contentFormat) { case EBinaryContentFormat.JSON: var jsonText = GLTFUtils.DecodeBufferToText(binaryReader.readUint8Array(contentLength)); runtime.gltf = JSON.parse(jsonText); break; default: Tools.Error("Unexpected content format: " + contentFormat); return false; </s> remove if (!hasBuffers) { onload(); </s> add var buffers = runtime.gltf.buffers; if (buffers.length > 0 && buffers[0].uri === undefined) { buffers[0].loadedBufferView = binaryReader.readUint8Array(buffers[0].byteLength);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
if (data instanceof ArrayBuffer) { if (!this._parseBinary(runtime, <ArrayBuffer>data)) { return null; } } else { runtime.gltf = JSON.parse(<string>data);
<mask> Tools.Error("No shader named: " + sha); <mask> } <mask> } <mask> <mask> if (!hasShaders) { <mask> onload(); <mask> } <mask> }; <mask> <mask> private _loadBuffersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { <mask> var hasBuffers = false; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove }; </s> add </s> remove private _loadBuffersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { var hasBuffers = false; </s> add GLTFFileLoaderExtension.PostCreateRuntime(runtime); return runtime; } </s> remove var shader: IGLTFShader = gltfRuntime.shaders[sha]; if (shader) { processShader.bind(this, sha, shader)(); } else { Tools.Error("No shader named: " + sha); } </s> add dummyNodes: [] </s> remove var processBuffer = (buf: string, buffer: IGLTFBuffer) => { GLTFFileLoaderExtension.LoadBufferAsync(gltfRuntime, buf, bufferView => { gltfRuntime.loadedBufferCount++; </s> add private _parseBinary(runtime: IGLTFRuntime, data: ArrayBuffer): boolean { var binaryReader = new BinaryReader(data); </s> remove var buffer: IGLTFBuffer = gltfRuntime.buffers[buf]; if (buffer) { processBuffer.bind(this, buf, buffer)(); } else { Tools.Error("No buffer named: " + buf); } </s> add switch (contentFormat) { case EBinaryContentFormat.JSON: var jsonText = GLTFUtils.DecodeBufferToText(binaryReader.readUint8Array(contentLength)); runtime.gltf = JSON.parse(jsonText); break; default: Tools.Error("Unexpected content format: " + contentFormat); return false;
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
<mask> <mask> if (!hasShaders) { <mask> onload(); <mask> } <mask> }; <mask> <mask> private _loadBuffersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { <mask> var hasBuffers = false; <mask> <mask> var processBuffer = (buf: string, buffer: IGLTFBuffer) => { </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove private _loadBuffersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { var hasBuffers = false; </s> add GLTFFileLoaderExtension.PostCreateRuntime(runtime); return runtime; } </s> remove var processBuffer = (buf: string, buffer: IGLTFBuffer) => { GLTFFileLoaderExtension.LoadBufferAsync(gltfRuntime, buf, bufferView => { gltfRuntime.loadedBufferCount++; </s> add private _parseBinary(runtime: IGLTFRuntime, data: ArrayBuffer): boolean { var binaryReader = new BinaryReader(data); </s> remove if (!hasShaders) { onload(); </s> add if (data instanceof ArrayBuffer) { if (!this._parseBinary(runtime, <ArrayBuffer>data)) { return null; } } else { runtime.gltf = JSON.parse(<string>data); </s> remove private _loadShadersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { var hasShaders = false; </s> add private _loadBufferAsync(runtime: IGLTFRuntime, index: number, onSuccess: () => void, onError: () => void): void { var buffer = runtime.gltf.buffers[index]; </s> remove }, onError); return true; </s> add });
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
GLTFFileLoaderExtension.PostCreateRuntime(runtime); return runtime; }
<mask> onload(); <mask> } <mask> }; <mask> <mask> private _loadBuffersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { <mask> var hasBuffers = false; <mask> <mask> var processBuffer = (buf: string, buffer: IGLTFBuffer) => { <mask> GLTFFileLoaderExtension.LoadBufferAsync(gltfRuntime, buf, bufferView => { <mask> gltfRuntime.loadedBufferCount++; <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove }; </s> add </s> remove var processBuffer = (buf: string, buffer: IGLTFBuffer) => { GLTFFileLoaderExtension.LoadBufferAsync(gltfRuntime, buf, bufferView => { gltfRuntime.loadedBufferCount++; </s> add private _parseBinary(runtime: IGLTFRuntime, data: ArrayBuffer): boolean { var binaryReader = new BinaryReader(data); </s> remove if (bufferView) { if (bufferView.byteLength != gltfRuntime.buffers[buf].byteLength) { Tools.Error("Buffer named " + buf + " is length " + bufferView.byteLength + ". Expected: " + buffer.byteLength); // Improve error message } </s> add var magic = GLTFUtils.DecodeBufferToText(binaryReader.readUint8Array(4)); if (magic != "glTF") { Tools.Error("Unexpected magic: " + magic); return false; } </s> remove if (!hasShaders) { onload(); </s> add if (data instanceof ArrayBuffer) { if (!this._parseBinary(runtime, <ArrayBuffer>data)) { return null; } } else { runtime.gltf = JSON.parse(<string>data); </s> remove private _loadShadersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { var hasShaders = false; </s> add private _loadBufferAsync(runtime: IGLTFRuntime, index: number, onSuccess: () => void, onError: () => void): void { var buffer = runtime.gltf.buffers[index];
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
private _parseBinary(runtime: IGLTFRuntime, data: ArrayBuffer): boolean { var binaryReader = new BinaryReader(data);
<mask> <mask> private _loadBuffersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { <mask> var hasBuffers = false; <mask> <mask> var processBuffer = (buf: string, buffer: IGLTFBuffer) => { <mask> GLTFFileLoaderExtension.LoadBufferAsync(gltfRuntime, buf, bufferView => { <mask> gltfRuntime.loadedBufferCount++; <mask> <mask> if (bufferView) { <mask> if (bufferView.byteLength != gltfRuntime.buffers[buf].byteLength) { <mask> Tools.Error("Buffer named " + buf + " is length " + bufferView.byteLength + ". Expected: " + buffer.byteLength); // Improve error message <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove if (bufferView) { if (bufferView.byteLength != gltfRuntime.buffers[buf].byteLength) { Tools.Error("Buffer named " + buf + " is length " + bufferView.byteLength + ". Expected: " + buffer.byteLength); // Improve error message } </s> add var magic = GLTFUtils.DecodeBufferToText(binaryReader.readUint8Array(4)); if (magic != "glTF") { Tools.Error("Unexpected magic: " + magic); return false; } </s> remove gltfRuntime.loadedBufferViews[buf] = bufferView; } </s> add var version = binaryReader.readUint32(); if (version != 1) { Tools.Error("Unsupported version: " + version); return false; } </s> remove private _loadBuffersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { var hasBuffers = false; </s> add GLTFFileLoaderExtension.PostCreateRuntime(runtime); return runtime; } </s> remove if (gltfRuntime.loadedBufferCount === gltfRuntime.buffersCount) { onload(); } }, () => { Tools.Error("Error when loading buffer named " + buf + " located at " + buffer.uri); }); }; </s> add var length = binaryReader.readUint32(); if (length != data.byteLength) { Tools.Error("Length in header does not match actual data length: " + length + " != " + data.byteLength); return false; } </s> remove }; </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
var magic = GLTFUtils.DecodeBufferToText(binaryReader.readUint8Array(4)); if (magic != "glTF") { Tools.Error("Unexpected magic: " + magic); return false; }
<mask> var processBuffer = (buf: string, buffer: IGLTFBuffer) => { <mask> GLTFFileLoaderExtension.LoadBufferAsync(gltfRuntime, buf, bufferView => { <mask> gltfRuntime.loadedBufferCount++; <mask> <mask> if (bufferView) { <mask> if (bufferView.byteLength != gltfRuntime.buffers[buf].byteLength) { <mask> Tools.Error("Buffer named " + buf + " is length " + bufferView.byteLength + ". Expected: " + buffer.byteLength); // Improve error message <mask> } <mask> <mask> gltfRuntime.loadedBufferViews[buf] = bufferView; <mask> } <mask> <mask> if (gltfRuntime.loadedBufferCount === gltfRuntime.buffersCount) { </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove var processBuffer = (buf: string, buffer: IGLTFBuffer) => { GLTFFileLoaderExtension.LoadBufferAsync(gltfRuntime, buf, bufferView => { gltfRuntime.loadedBufferCount++; </s> add private _parseBinary(runtime: IGLTFRuntime, data: ArrayBuffer): boolean { var binaryReader = new BinaryReader(data); </s> remove gltfRuntime.loadedBufferViews[buf] = bufferView; } </s> add var version = binaryReader.readUint32(); if (version != 1) { Tools.Error("Unsupported version: " + version); return false; } </s> remove if (gltfRuntime.loadedBufferCount === gltfRuntime.buffersCount) { onload(); } }, () => { Tools.Error("Error when loading buffer named " + buf + " located at " + buffer.uri); }); }; </s> add var length = binaryReader.readUint32(); if (length != data.byteLength) { Tools.Error("Length in header does not match actual data length: " + length + " != " + data.byteLength); return false; } </s> remove for (var buf in gltfRuntime.buffers) { hasBuffers = true; </s> add var contentLength = binaryReader.readUint32(); var contentFormat = <EBinaryContentFormat>binaryReader.readUint32(); </s> remove private _loadBuffersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { var hasBuffers = false; </s> add GLTFFileLoaderExtension.PostCreateRuntime(runtime); return runtime; }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
var version = binaryReader.readUint32(); if (version != 1) { Tools.Error("Unsupported version: " + version); return false; }
<mask> if (bufferView.byteLength != gltfRuntime.buffers[buf].byteLength) { <mask> Tools.Error("Buffer named " + buf + " is length " + bufferView.byteLength + ". Expected: " + buffer.byteLength); // Improve error message <mask> } <mask> <mask> gltfRuntime.loadedBufferViews[buf] = bufferView; <mask> } <mask> <mask> if (gltfRuntime.loadedBufferCount === gltfRuntime.buffersCount) { <mask> onload(); <mask> } <mask> }, () => { </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove if (bufferView) { if (bufferView.byteLength != gltfRuntime.buffers[buf].byteLength) { Tools.Error("Buffer named " + buf + " is length " + bufferView.byteLength + ". Expected: " + buffer.byteLength); // Improve error message } </s> add var magic = GLTFUtils.DecodeBufferToText(binaryReader.readUint8Array(4)); if (magic != "glTF") { Tools.Error("Unexpected magic: " + magic); return false; } </s> remove var processBuffer = (buf: string, buffer: IGLTFBuffer) => { GLTFFileLoaderExtension.LoadBufferAsync(gltfRuntime, buf, bufferView => { gltfRuntime.loadedBufferCount++; </s> add private _parseBinary(runtime: IGLTFRuntime, data: ArrayBuffer): boolean { var binaryReader = new BinaryReader(data); </s> remove if (gltfRuntime.loadedBufferCount === gltfRuntime.buffersCount) { onload(); } }, () => { Tools.Error("Error when loading buffer named " + buf + " located at " + buffer.uri); }); }; </s> add var length = binaryReader.readUint32(); if (length != data.byteLength) { Tools.Error("Length in header does not match actual data length: " + length + " != " + data.byteLength); return false; } </s> remove if (gltfRuntime.loadedShaderCount === gltfRuntime.shaderscount) { onload(); } }, () => { Tools.Error("Error when loading shader program named " + sha + " located at " + shader.uri); }); }; </s> add babylonScene: scene, rootUrl: rootUrl, </s> remove Tools.Warn("Creating animation named " + anim + ". But cannot find node named " + targetID + " to attach to"); </s> add Tools.Warn("Creating animation index " + animationIndex + " but cannot find node index " + targetID + " to attach to");
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
var length = binaryReader.readUint32(); if (length != data.byteLength) { Tools.Error("Length in header does not match actual data length: " + length + " != " + data.byteLength); return false; }
<mask> <mask> gltfRuntime.loadedBufferViews[buf] = bufferView; <mask> } <mask> <mask> if (gltfRuntime.loadedBufferCount === gltfRuntime.buffersCount) { <mask> onload(); <mask> } <mask> }, () => { <mask> Tools.Error("Error when loading buffer named " + buf + " located at " + buffer.uri); <mask> }); <mask> }; <mask> <mask> for (var buf in gltfRuntime.buffers) { <mask> hasBuffers = true; <mask> <mask> var buffer: IGLTFBuffer = gltfRuntime.buffers[buf]; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove for (var buf in gltfRuntime.buffers) { hasBuffers = true; </s> add var contentLength = binaryReader.readUint32(); var contentFormat = <EBinaryContentFormat>binaryReader.readUint32(); </s> remove if (gltfRuntime.loadedShaderCount === gltfRuntime.shaderscount) { onload(); } }, () => { Tools.Error("Error when loading shader program named " + sha + " located at " + shader.uri); }); }; </s> add babylonScene: scene, rootUrl: rootUrl, </s> remove gltfRuntime.loadedBufferViews[buf] = bufferView; } </s> add var version = binaryReader.readUint32(); if (version != 1) { Tools.Error("Unsupported version: " + version); return false; } </s> remove for (var sha in gltfRuntime.shaders) { hasShaders = true; </s> add importOnlyMeshes: importOnlyMeshes, </s> remove var buffer: IGLTFBuffer = gltfRuntime.buffers[buf]; if (buffer) { processBuffer.bind(this, buf, buffer)(); } else { Tools.Error("No buffer named: " + buf); } </s> add switch (contentFormat) { case EBinaryContentFormat.JSON: var jsonText = GLTFUtils.DecodeBufferToText(binaryReader.readUint8Array(contentLength)); runtime.gltf = JSON.parse(jsonText); break; default: Tools.Error("Unexpected content format: " + contentFormat); return false;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
var contentLength = binaryReader.readUint32(); var contentFormat = <EBinaryContentFormat>binaryReader.readUint32();
<mask> Tools.Error("Error when loading buffer named " + buf + " located at " + buffer.uri); <mask> }); <mask> }; <mask> <mask> for (var buf in gltfRuntime.buffers) { <mask> hasBuffers = true; <mask> <mask> var buffer: IGLTFBuffer = gltfRuntime.buffers[buf]; <mask> if (buffer) { <mask> processBuffer.bind(this, buf, buffer)(); <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove if (gltfRuntime.loadedBufferCount === gltfRuntime.buffersCount) { onload(); } }, () => { Tools.Error("Error when loading buffer named " + buf + " located at " + buffer.uri); }); }; </s> add var length = binaryReader.readUint32(); if (length != data.byteLength) { Tools.Error("Length in header does not match actual data length: " + length + " != " + data.byteLength); return false; } </s> remove var buffer: IGLTFBuffer = gltfRuntime.buffers[buf]; if (buffer) { processBuffer.bind(this, buf, buffer)(); } else { Tools.Error("No buffer named: " + buf); } </s> add switch (contentFormat) { case EBinaryContentFormat.JSON: var jsonText = GLTFUtils.DecodeBufferToText(binaryReader.readUint8Array(contentLength)); runtime.gltf = JSON.parse(jsonText); break; default: Tools.Error("Unexpected content format: " + contentFormat); return false; </s> remove for (var sha in gltfRuntime.shaders) { hasShaders = true; </s> add importOnlyMeshes: importOnlyMeshes, </s> remove if (gltfRuntime.loadedShaderCount === gltfRuntime.shaderscount) { onload(); } }, () => { Tools.Error("Error when loading shader program named " + sha + " located at " + shader.uri); }); }; </s> add babylonScene: scene, rootUrl: rootUrl, </s> remove var processBuffer = (buf: string, buffer: IGLTFBuffer) => { GLTFFileLoaderExtension.LoadBufferAsync(gltfRuntime, buf, bufferView => { gltfRuntime.loadedBufferCount++; </s> add private _parseBinary(runtime: IGLTFRuntime, data: ArrayBuffer): boolean { var binaryReader = new BinaryReader(data);
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
switch (contentFormat) { case EBinaryContentFormat.JSON: var jsonText = GLTFUtils.DecodeBufferToText(binaryReader.readUint8Array(contentLength)); runtime.gltf = JSON.parse(jsonText); break; default: Tools.Error("Unexpected content format: " + contentFormat); return false;
<mask> <mask> for (var buf in gltfRuntime.buffers) { <mask> hasBuffers = true; <mask> <mask> var buffer: IGLTFBuffer = gltfRuntime.buffers[buf]; <mask> if (buffer) { <mask> processBuffer.bind(this, buf, buffer)(); <mask> } <mask> else { <mask> Tools.Error("No buffer named: " + buf); <mask> } <mask> } <mask> <mask> if (!hasBuffers) { <mask> onload(); <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove for (var buf in gltfRuntime.buffers) { hasBuffers = true; </s> add var contentLength = binaryReader.readUint32(); var contentFormat = <EBinaryContentFormat>binaryReader.readUint32(); </s> remove if (gltfRuntime.loadedBufferCount === gltfRuntime.buffersCount) { onload(); } }, () => { Tools.Error("Error when loading buffer named " + buf + " located at " + buffer.uri); }); }; </s> add var length = binaryReader.readUint32(); if (length != data.byteLength) { Tools.Error("Length in header does not match actual data length: " + length + " != " + data.byteLength); return false; } </s> remove if (!hasBuffers) { onload(); </s> add var buffers = runtime.gltf.buffers; if (buffers.length > 0 && buffers[0].uri === undefined) { buffers[0].loadedBufferView = binaryReader.readUint8Array(buffers[0].byteLength); </s> remove var shader: IGLTFShader = gltfRuntime.shaders[sha]; if (shader) { processShader.bind(this, sha, shader)(); } else { Tools.Error("No shader named: " + sha); } </s> add dummyNodes: [] </s> remove if (!hasShaders) { onload(); </s> add if (data instanceof ArrayBuffer) { if (!this._parseBinary(runtime, <ArrayBuffer>data)) { return null; } } else { runtime.gltf = JSON.parse(<string>data);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
var buffers = runtime.gltf.buffers; if (buffers.length > 0 && buffers[0].uri === undefined) { buffers[0].loadedBufferView = binaryReader.readUint8Array(buffers[0].byteLength);
<mask> Tools.Error("No buffer named: " + buf); <mask> } <mask> } <mask> <mask> if (!hasBuffers) { <mask> onload(); <mask> } <mask> } <mask> <mask> // Creates nodes before loading buffers and shaders <mask> private _createNodes(gltfRuntime: IGLTFRuntime): void { </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove } </s> add </s> remove // Creates nodes before loading buffers and shaders private _createNodes(gltfRuntime: IGLTFRuntime): void { var currentScene = <IGLTFScene>gltfRuntime.currentScene; if (currentScene) { // Only one scene even if multiple scenes are defined for (var i = 0; i < currentScene.nodes.length; i++) { traverseNodes(gltfRuntime, currentScene.nodes[i], null); } </s> add if (binaryReader.getPosition() < binaryReader.getLength()) { Tools.Error("Unexpected extra bytes at end of data"); return false; </s> remove var buffer: IGLTFBuffer = gltfRuntime.buffers[buf]; if (buffer) { processBuffer.bind(this, buf, buffer)(); } else { Tools.Error("No buffer named: " + buf); } </s> add switch (contentFormat) { case EBinaryContentFormat.JSON: var jsonText = GLTFUtils.DecodeBufferToText(binaryReader.readUint8Array(contentLength)); runtime.gltf = JSON.parse(jsonText); break; default: Tools.Error("Unexpected content format: " + contentFormat); return false; </s> remove if (!hasShaders) { onload(); </s> add if (data instanceof ArrayBuffer) { if (!this._parseBinary(runtime, <ArrayBuffer>data)) { return null; } } else { runtime.gltf = JSON.parse(<string>data); </s> remove var shader: IGLTFShader = gltfRuntime.shaders[sha]; if (shader) { processShader.bind(this, sha, shader)(); } else { Tools.Error("No shader named: " + sha); } </s> add dummyNodes: []
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
<mask> <mask> if (!hasBuffers) { <mask> onload(); <mask> } <mask> } <mask> <mask> // Creates nodes before loading buffers and shaders <mask> private _createNodes(gltfRuntime: IGLTFRuntime): void { <mask> var currentScene = <IGLTFScene>gltfRuntime.currentScene; <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove if (!hasBuffers) { onload(); </s> add var buffers = runtime.gltf.buffers; if (buffers.length > 0 && buffers[0].uri === undefined) { buffers[0].loadedBufferView = binaryReader.readUint8Array(buffers[0].byteLength); </s> remove // Creates nodes before loading buffers and shaders private _createNodes(gltfRuntime: IGLTFRuntime): void { var currentScene = <IGLTFScene>gltfRuntime.currentScene; if (currentScene) { // Only one scene even if multiple scenes are defined for (var i = 0; i < currentScene.nodes.length; i++) { traverseNodes(gltfRuntime, currentScene.nodes[i], null); } </s> add if (binaryReader.getPosition() < binaryReader.getLength()) { Tools.Error("Unexpected extra bytes at end of data"); return false; </s> remove /** * do stuff after buffers, shaders are loaded (e.g. hook up materials, load animations, etc.) */ var postLoad = (gltfRuntime: IGLTFRuntime) => { // Nodes var currentScene: IGLTFScene = <IGLTFScene>gltfRuntime.currentScene; </s> add var importScene = (runtime: IGLTFRuntime): void => { var scene = runtime.gltf.scene || 0; var scenes = runtime.gltf.scenes; </s> remove var loadAnimations = (gltfRuntime: IGLTFRuntime) => { for (var anim in gltfRuntime.animations) { var animation: IGLTFAnimation = gltfRuntime.animations[anim]; </s> add var loadAnimations = (runtime: IGLTFRuntime): void => { var animations = runtime.gltf.animations; if (!animations) { return; } for (var animationIndex = 0; animationIndex < animations.length; animationIndex++) { var animation = animations[animationIndex]; if (!animation || !animation.channels) { continue; } </s> remove if (!hasShaders) { onload(); </s> add if (data instanceof ArrayBuffer) { if (!this._parseBinary(runtime, <ArrayBuffer>data)) { return null; } } else { runtime.gltf = JSON.parse(<string>data);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
if (binaryReader.getPosition() < binaryReader.getLength()) { Tools.Error("Unexpected extra bytes at end of data"); return false;
<mask> onload(); <mask> } <mask> } <mask> <mask> // Creates nodes before loading buffers and shaders <mask> private _createNodes(gltfRuntime: IGLTFRuntime): void { <mask> var currentScene = <IGLTFScene>gltfRuntime.currentScene; <mask> <mask> if (currentScene) { <mask> // Only one scene even if multiple scenes are defined <mask> for (var i = 0; i < currentScene.nodes.length; i++) { <mask> traverseNodes(gltfRuntime, currentScene.nodes[i], null); <mask> } <mask> } <mask> else { <mask> // Load all scenes <mask> for (var thing in gltfRuntime.scenes) { <mask> currentScene = <IGLTFScene>gltfRuntime.scenes[thing]; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove else { // Load all scenes for (var thing in gltfRuntime.scenes) { currentScene = <IGLTFScene>gltfRuntime.scenes[thing]; </s> add </s> remove for (var i = 0; i < currentScene.nodes.length; i++) { traverseNodes(gltfRuntime, currentScene.nodes[i], null); } } } } </s> add return true; }; </s> remove } </s> add </s> remove /** * do stuff after buffers, shaders are loaded (e.g. hook up materials, load animations, etc.) */ var postLoad = (gltfRuntime: IGLTFRuntime) => { // Nodes var currentScene: IGLTFScene = <IGLTFScene>gltfRuntime.currentScene; </s> add var importScene = (runtime: IGLTFRuntime): void => { var scene = runtime.gltf.scene || 0; var scenes = runtime.gltf.scenes; </s> remove if (!hasBuffers) { onload(); </s> add var buffers = runtime.gltf.buffers; if (buffers.length > 0 && buffers[0].uri === undefined) { buffers[0].loadedBufferView = binaryReader.readUint8Array(buffers[0].byteLength);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
<mask> for (var i = 0; i < currentScene.nodes.length; i++) { <mask> traverseNodes(gltfRuntime, currentScene.nodes[i], null); <mask> } <mask> } <mask> else { <mask> // Load all scenes <mask> for (var thing in gltfRuntime.scenes) { <mask> currentScene = <IGLTFScene>gltfRuntime.scenes[thing]; <mask> <mask> for (var i = 0; i < currentScene.nodes.length; i++) { <mask> traverseNodes(gltfRuntime, currentScene.nodes[i], null); <mask> } <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove for (var i = 0; i < currentScene.nodes.length; i++) { traverseNodes(gltfRuntime, currentScene.nodes[i], null); } } } } </s> add return true; }; </s> remove // Creates nodes before loading buffers and shaders private _createNodes(gltfRuntime: IGLTFRuntime): void { var currentScene = <IGLTFScene>gltfRuntime.currentScene; if (currentScene) { // Only one scene even if multiple scenes are defined for (var i = 0; i < currentScene.nodes.length; i++) { traverseNodes(gltfRuntime, currentScene.nodes[i], null); } </s> add if (binaryReader.getPosition() < binaryReader.getLength()) { Tools.Error("Unexpected extra bytes at end of data"); return false; </s> remove /** * do stuff after buffers, shaders are loaded (e.g. hook up materials, load animations, etc.) */ var postLoad = (gltfRuntime: IGLTFRuntime) => { // Nodes var currentScene: IGLTFScene = <IGLTFScene>gltfRuntime.currentScene; </s> add var importScene = (runtime: IGLTFRuntime): void => { var scene = runtime.gltf.scene || 0; var scenes = runtime.gltf.scenes; </s> remove traverseNodes(gltfRuntime, node.children[i], newNode, meshIncluded); </s> add traverseNodes(runtime, node.children[i], newNode, meshIncluded); </s> remove for (var i = 0; i < skins.jointNames.length; i++) { var jointNode: IJointNode = getJointNode(gltfRuntime, skins.jointNames[i]); </s> add for (var i = 0; i < skin.jointNames.length; i++) { var jointNode: IJointNode = getJointNode(runtime, skin.jointNames[i]);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
return true; };
<mask> // Load all scenes <mask> for (var thing in gltfRuntime.scenes) { <mask> currentScene = <IGLTFScene>gltfRuntime.scenes[thing]; <mask> <mask> for (var i = 0; i < currentScene.nodes.length; i++) { <mask> traverseNodes(gltfRuntime, currentScene.nodes[i], null); <mask> } <mask> } <mask> } <mask> } <mask> }; <mask> <mask> BABYLON.SceneLoader.RegisterPlugin(new GLTFFileLoader()); <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove else { // Load all scenes for (var thing in gltfRuntime.scenes) { currentScene = <IGLTFScene>gltfRuntime.scenes[thing]; </s> add </s> remove // Creates nodes before loading buffers and shaders private _createNodes(gltfRuntime: IGLTFRuntime): void { var currentScene = <IGLTFScene>gltfRuntime.currentScene; if (currentScene) { // Only one scene even if multiple scenes are defined for (var i = 0; i < currentScene.nodes.length; i++) { traverseNodes(gltfRuntime, currentScene.nodes[i], null); } </s> add if (binaryReader.getPosition() < binaryReader.getLength()) { Tools.Error("Unexpected extra bytes at end of data"); return false; </s> remove /** * do stuff after buffers, shaders are loaded (e.g. hook up materials, load animations, etc.) */ var postLoad = (gltfRuntime: IGLTFRuntime) => { // Nodes var currentScene: IGLTFScene = <IGLTFScene>gltfRuntime.currentScene; </s> add var importScene = (runtime: IGLTFRuntime): void => { var scene = runtime.gltf.scene || 0; var scenes = runtime.gltf.scenes; </s> remove traverseNodes(gltfRuntime, node.children[i], newNode, meshIncluded); </s> add traverseNodes(runtime, node.children[i], newNode, meshIncluded); </s> remove for (var i = 0; i < skins.jointNames.length; i++) { var jointNode: IJointNode = getJointNode(gltfRuntime, skins.jointNames[i]); </s> add for (var i = 0; i < skin.jointNames.length; i++) { var jointNode: IJointNode = getJointNode(runtime, skin.jointNames[i]);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoader.ts
protected postCreateRuntime(runtime: IGLTFRuntime): void {}
<mask> public get name(): string { <mask> return this._name; <mask> } <mask> <mask> /** <mask> * Defines an override for loading the runtime <mask> * Return true to stop further extensions from loading the runtime <mask> */ <mask> public loadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): boolean { <mask> return false; <mask> } <mask> <mask> /** <mask> * Defines an onverride for creating gltf runtime <mask> * Return true to stop further extensions from creating the runtime <mask> */ <mask> public loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): boolean { <mask> return false; <mask> } <mask> <mask> /** <mask> * Defines an override for loading buffers <mask> * Return true to stop further extensions from loading this buffer <mask> */ <mask> public loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean { <mask> return false; <mask> } <mask> <mask> /** <mask> * Defines an override for loading texture buffers <mask> * Return true to stop further extensions from loading this texture data <mask> */ <mask> public loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean { <mask> return false; <mask> } <mask> <mask> /** <mask> * Defines an override for creating textures <mask> * Return true to stop further extensions from loading this texture <mask> */ </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove /** * Defines an override for creating textures * Return true to stop further extensions from loading this texture */ public createTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): boolean { return false; } /** * Defines an override for loading shader strings * Return true to stop further extensions from loading this shader data */ public loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): boolean { return false; } /** * Defines an override for loading materials * Return true to stop further extensions from loading this material */ public loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): boolean { return false; } </s> add // Return true to stop other extensions from loading materials. protected loadMaterial(runtime: IGLTFRuntime, index: number): boolean { return false; } </s> remove /** * Load scene */ public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean { scene.useRightHandedSystem = true; GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { // Load runtime extensios GLTFFileLoaderExtension.LoadRuntimeExtensionsAsync(gltfRuntime, () => { // Create nodes this._createNodes(gltfRuntime); // Load buffers, shaders, materials, etc. this._loadBuffersAsync(gltfRuntime, () => { this._loadShadersAsync(gltfRuntime, () => { importMaterials(gltfRuntime); postLoad(gltfRuntime); if (!GLTFFileLoader.IncrementalLoading) { onSuccess(); } }); }); </s> add private _loadBuffersAsync(runtime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { if (runtime.gltf.buffers.length == 0) { onSuccess(); return; } </s> remove public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { </s> add public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean { </s> remove return gltfRuntime; } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var buffer: IGLTFBuffer = gltfRuntime.buffers[id]; if (GLTFUtils.IsBase64(buffer.uri)) { setTimeout(() => onSuccess(new Uint8Array(GLTFUtils.DecodeBase64(buffer.uri)))); } else { Tools.LoadFile(gltfRuntime.rootUrl + buffer.uri, data => onSuccess(new Uint8Array(data)), null, null, true, onError); </s> add material.babylonMaterial.useEmissiveAsIllumination = (material.emissiveFactor || material.emissiveTexture) ? true : false; material.babylonMaterial.emissiveColor = material.emissiveFactor ? Color3.FromArray(material.emissiveFactor) : new Color3(0, 0, 0); if (material.emissiveTexture) { GLTFFileLoader.LoadTextureAsync(runtime, material.emissiveTexture, babylonTexture => { material.babylonMaterial.emissiveTexture = babylonTexture; }, () => Tools.Warn("Failed to load normal texture")); </s> remove public static LoadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(GLTFFileLoaderBase.CreateRuntime(JSON.parse(<string>data), scene, rootUrl)); }); }); } public static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(); }); }); } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.LoadTextureBufferAsync(gltfRuntime, id, buffer => GLTFFileLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError), onError); } public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError); }); } private static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }); } private static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }, () => { GLTFFileLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }); </s> add public static PostCreateRuntime(runtime: IGLTFRuntime): void { for (var extensionName in GLTFFileLoader.Extensions) { var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.postCreateRuntime) { extension.postCreateRuntime(runtime); } }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderExtension.ts
// Return true to stop other extensions from loading materials. protected loadMaterial(runtime: IGLTFRuntime, index: number): boolean { return false; }
<mask> public loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean { <mask> return false; <mask> } <mask> <mask> /** <mask> * Defines an override for creating textures <mask> * Return true to stop further extensions from loading this texture <mask> */ <mask> public createTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): boolean { <mask> return false; <mask> } <mask> <mask> /** <mask> * Defines an override for loading shader strings <mask> * Return true to stop further extensions from loading this shader data <mask> */ <mask> public loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): boolean { <mask> return false; <mask> } <mask> <mask> /** <mask> * Defines an override for loading materials <mask> * Return true to stop further extensions from loading this material <mask> */ <mask> public loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): boolean { <mask> return false; <mask> } <mask> <mask> // --------- <mask> // Utilities <mask> // --------- <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove /** * Defines an override for loading the runtime * Return true to stop further extensions from loading the runtime */ public loadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): boolean { return false; } /** * Defines an onverride for creating gltf runtime * Return true to stop further extensions from creating the runtime */ public loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): boolean { return false; } /** * Defines an override for loading buffers * Return true to stop further extensions from loading this buffer */ public loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean { return false; } /** * Defines an override for loading texture buffers * Return true to stop further extensions from loading this texture data */ public loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean { return false; } </s> add protected postCreateRuntime(runtime: IGLTFRuntime): void {} </s> remove public static LoadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(GLTFFileLoaderBase.CreateRuntime(JSON.parse(<string>data), scene, rootUrl)); }); }); } public static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(); }); }); } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.LoadTextureBufferAsync(gltfRuntime, id, buffer => GLTFFileLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError), onError); } public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError); }); } private static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }); } private static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }, () => { GLTFFileLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }); </s> add public static PostCreateRuntime(runtime: IGLTFRuntime): void { for (var extensionName in GLTFFileLoader.Extensions) { var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.postCreateRuntime) { extension.postCreateRuntime(runtime); } } </s> remove public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): void { var shader: IGLTFShader = gltfRuntime.shaders[id]; if (GLTFUtils.IsBase64(shader.uri)) { var shaderString = atob(shader.uri.split(",")[1]); onSuccess(shaderString); } else { Tools.LoadFile(gltfRuntime.rootUrl + shader.uri, onSuccess, null, null, false, onError); } } </s> add /** * Import meshes */ public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { scene.useRightHandedSystem = true; </s> remove return gltfRuntime; } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var buffer: IGLTFBuffer = gltfRuntime.buffers[id]; if (GLTFUtils.IsBase64(buffer.uri)) { setTimeout(() => onSuccess(new Uint8Array(GLTFUtils.DecodeBase64(buffer.uri)))); } else { Tools.LoadFile(gltfRuntime.rootUrl + buffer.uri, data => onSuccess(new Uint8Array(data)), null, null, true, onError); </s> add material.babylonMaterial.useEmissiveAsIllumination = (material.emissiveFactor || material.emissiveTexture) ? true : false; material.babylonMaterial.emissiveColor = material.emissiveFactor ? Color3.FromArray(material.emissiveFactor) : new Color3(0, 0, 0); if (material.emissiveTexture) { GLTFFileLoader.LoadTextureAsync(runtime, material.emissiveTexture, babylonTexture => { material.babylonMaterial.emissiveTexture = babylonTexture; }, () => Tools.Warn("Failed to load normal texture")); </s> remove public static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> add public static LoadTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index];
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderExtension.ts
public static PostCreateRuntime(runtime: IGLTFRuntime): void { for (var extensionName in GLTFFileLoader.Extensions) { var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.postCreateRuntime) { extension.postCreateRuntime(runtime); } }
<mask> // --------- <mask> // Utilities <mask> // --------- <mask> <mask> public static LoadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void { <mask> GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { <mask> return loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError); <mask> }, () => { <mask> setTimeout(() => { <mask> onSuccess(GLTFFileLoaderBase.CreateRuntime(JSON.parse(<string>data), scene, rootUrl)); <mask> }); <mask> }); <mask> } <mask> <mask> public static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { <mask> GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { <mask> return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError); <mask> }, () => { <mask> setTimeout(() => { <mask> onSuccess(); <mask> }); <mask> }); <mask> } <mask> <mask> public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void): void { <mask> GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { <mask> return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError); <mask> }, () => { <mask> GLTFFileLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError); <mask> }); <mask> } <mask> <mask> public static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void { <mask> GLTFFileLoaderExtension.LoadTextureBufferAsync(gltfRuntime, id, <mask> buffer => GLTFFileLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError), <mask> onError); <mask> } <mask> <mask> public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void { <mask> GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { <mask> return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError); <mask> }, () => { <mask> GLTFFileLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError); <mask> }); <mask> } <mask> <mask> public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { <mask> GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { <mask> return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError); <mask> }, () => { <mask> GLTFFileLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError); <mask> }); <mask> } <mask> <mask> private static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { <mask> GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { <mask> return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); <mask> }, () => { <mask> GLTFFileLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); <mask> }); <mask> } <mask> <mask> private static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { <mask> GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { <mask> return loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); <mask> }, () => { <mask> GLTFFileLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); <mask> }); <mask> } <mask> <mask> private static ApplyExtensions(func: (loaderExtension: GLTFFileLoaderExtension) => boolean, defaultFunc: () => void): void { <mask> for (var extensionName in GLTFFileLoader.Extensions) { <mask> var loaderExtension = GLTFFileLoader.Extensions[extensionName]; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove private static ApplyExtensions(func: (loaderExtension: GLTFFileLoaderExtension) => boolean, defaultFunc: () => void): void { </s> add public static LoadMaterial(runtime: IGLTFRuntime, index: number): void { </s> remove Tools.LoadFile(gltfRuntime.rootUrl + source.uri, data => onSuccess(new Uint8Array(data)), null, null, true, onError); </s> add Tools.LoadFile(runtime.rootUrl + source.uri, data => { GLTFFileLoader.CreateTextureAsync(runtime, textureInfo, new Uint8Array(data), source.mimeType, onSuccess, onError); }, null, null, true, onError); </s> remove public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): void { var shader: IGLTFShader = gltfRuntime.shaders[id]; if (GLTFUtils.IsBase64(shader.uri)) { var shaderString = atob(shader.uri.split(",")[1]); onSuccess(shaderString); } else { Tools.LoadFile(gltfRuntime.rootUrl + shader.uri, onSuccess, null, null, false, onError); } } </s> add /** * Import meshes */ public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean { scene.useRightHandedSystem = true; </s> remove public static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> add public static LoadTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index]; </s> remove /** * Load scene */ public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean { scene.useRightHandedSystem = true; GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { // Load runtime extensios GLTFFileLoaderExtension.LoadRuntimeExtensionsAsync(gltfRuntime, () => { // Create nodes this._createNodes(gltfRuntime); // Load buffers, shaders, materials, etc. this._loadBuffersAsync(gltfRuntime, () => { this._loadShadersAsync(gltfRuntime, () => { importMaterials(gltfRuntime); postLoad(gltfRuntime); if (!GLTFFileLoader.IncrementalLoading) { onSuccess(); } }); }); </s> add private _loadBuffersAsync(runtime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { if (runtime.gltf.buffers.length == 0) { onSuccess(); return; }
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderExtension.ts
public static LoadMaterial(runtime: IGLTFRuntime, index: number): void {
<mask> GLTFFileLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); <mask> }); <mask> } <mask> <mask> private static ApplyExtensions(func: (loaderExtension: GLTFFileLoaderExtension) => boolean, defaultFunc: () => void): void { <mask> for (var extensionName in GLTFFileLoader.Extensions) { <mask> var loaderExtension = GLTFFileLoader.Extensions[extensionName]; <mask> if (func(loaderExtension)) { <mask> return; <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove var loaderExtension = GLTFFileLoader.Extensions[extensionName]; if (func(loaderExtension)) { return; </s> add var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.loadMaterial) { if (extension.loadMaterial(runtime, index)) { return; } </s> remove public static LoadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(GLTFFileLoaderBase.CreateRuntime(JSON.parse(<string>data), scene, rootUrl)); }); }); } public static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(); }); }); } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.LoadTextureBufferAsync(gltfRuntime, id, buffer => GLTFFileLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError), onError); } public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError); }); } private static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }); } private static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }, () => { GLTFFileLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }); </s> add public static PostCreateRuntime(runtime: IGLTFRuntime): void { for (var extensionName in GLTFFileLoader.Extensions) { var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.postCreateRuntime) { extension.postCreateRuntime(runtime); } } </s> remove }, onError); return true; </s> add }); </s> remove if (GLTFUtils.IsBase64(source.uri)) { setTimeout(() => onSuccess(new Uint8Array(GLTFUtils.DecodeBase64(source.uri)))); </s> add if (source.uri === undefined) { var bufferView: IGLTFBufferView = runtime.gltf.bufferViews[source.bufferView]; var buffer = GLTFUtils.GetBufferFromBufferView(runtime, bufferView, 0, bufferView.byteLength, EComponentType.UNSIGNED_BYTE); GLTFFileLoader.CreateTextureAsync(runtime, textureInfo, buffer, source.mimeType, onSuccess, onError); } else if (GLTFUtils.IsBase64(source.uri)) { GLTFFileLoader.CreateTextureAsync(runtime, textureInfo, new Uint8Array(GLTFUtils.DecodeBase64(source.uri)), source.mimeType, onSuccess, onError); </s> remove /** * Load scene */ public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean { scene.useRightHandedSystem = true; GLTFFileLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => { // Load runtime extensios GLTFFileLoaderExtension.LoadRuntimeExtensionsAsync(gltfRuntime, () => { // Create nodes this._createNodes(gltfRuntime); // Load buffers, shaders, materials, etc. this._loadBuffersAsync(gltfRuntime, () => { this._loadShadersAsync(gltfRuntime, () => { importMaterials(gltfRuntime); postLoad(gltfRuntime); if (!GLTFFileLoader.IncrementalLoading) { onSuccess(); } }); }); </s> add private _loadBuffersAsync(runtime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { if (runtime.gltf.buffers.length == 0) { onSuccess(); return; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderExtension.ts
var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.loadMaterial) { if (extension.loadMaterial(runtime, index)) { return; }
<mask> } <mask> <mask> private static ApplyExtensions(func: (loaderExtension: GLTFFileLoaderExtension) => boolean, defaultFunc: () => void): void { <mask> for (var extensionName in GLTFFileLoader.Extensions) { <mask> var loaderExtension = GLTFFileLoader.Extensions[extensionName]; <mask> if (func(loaderExtension)) { <mask> return; <mask> } <mask> } <mask> <mask> defaultFunc(); <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove private static ApplyExtensions(func: (loaderExtension: GLTFFileLoaderExtension) => boolean, defaultFunc: () => void): void { </s> add public static LoadMaterial(runtime: IGLTFRuntime, index: number): void { </s> remove public static LoadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(GLTFFileLoaderBase.CreateRuntime(JSON.parse(<string>data), scene, rootUrl)); }); }); } public static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError); }, () => { setTimeout(() => { onSuccess(); }); }); } public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.LoadTextureBufferAsync(gltfRuntime, id, buffer => GLTFFileLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError), onError); } public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError); }); } public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError); }); } private static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }, () => { GLTFFileLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError); }); } private static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { GLTFFileLoaderExtension.ApplyExtensions(loaderExtension => { return loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }, () => { GLTFFileLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError); }); </s> add public static PostCreateRuntime(runtime: IGLTFRuntime): void { for (var extensionName in GLTFFileLoader.Extensions) { var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.postCreateRuntime) { extension.postCreateRuntime(runtime); } } </s> remove public static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void { var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> add public static CreateTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, buffer: ArrayBufferView, mimeType: string, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index]; if (!texture || texture.source === undefined || texture.sampler === undefined) { onError(); return; } </s> remove public static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void { var texture: IGLTFTexture = gltfRuntime.textures[id]; </s> add public static LoadTextureAsync(runtime: IGLTFRuntime, textureInfo: IGLTFTextureInfo, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void { var texture = runtime.gltf.textures[textureInfo.index]; </s> remove if (!hasShaders) { onload(); </s> add if (data instanceof ArrayBuffer) { if (!this._parseBinary(runtime, <ArrayBuffer>data)) { return null; } } else { runtime.gltf = JSON.parse(<string>data);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderExtension.ts
var material = GLTFFileLoader.LoadMaterial(runtime, index); if (material) { GLTFFileLoader.LoadMetallicRoughnessMaterialProperties(runtime, material); GLTFFileLoader.LoadCommonMaterialProperties(runtime, material); }
<mask> return; <mask> } <mask> } <mask> <mask> defaultFunc(); <mask> } <mask> } <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove var loaderExtension = GLTFFileLoader.Extensions[extensionName]; if (func(loaderExtension)) { return; </s> add var extension = GLTFFileLoader.Extensions[extensionName]; if (extension.loadMaterial) { if (extension.loadMaterial(runtime, index)) { return; } </s> remove onSuccess(null); </s> add onSuccess(texture.babylonTexture); </s> remove var source: IGLTFImage = gltfRuntime.images[texture.source]; </s> add var source = runtime.gltf.images[texture.source]; </s> remove GLTFFileLoader.Extensions[extension.name] = extension; </s> add return true; </s> remove if (parsedData.techniques) { parseObject(parsedData.techniques, "techniques", gltfRuntime); } </s> add public static LoadMetallicRoughnessMaterialProperties = (runtime: IGLTFRuntime, material: IGLTFMaterial): void => { var properties = material.pbrMetallicRoughness; if (!properties) return;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderExtension.ts
export enum EBinaryContentFormat { JSON = 0 } export enum EBufferViewTarget { ARRAY_BUFFER = 34962, ELEMENT_ARRAY_BUFFER = 34963 }
<mask> module BABYLON { <mask> /** <mask> * Enums <mask> */ <mask> export enum EComponentType { <mask> BYTE = 5120, <mask> UNSIGNED_BYTE = 5121, <mask> SHORT = 5122, </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export enum EShaderType { FRAGMENT = 35632, VERTEX = 35633 </s> add export enum EMeshPrimitiveMode { POINTS = 0, LINES = 1, LINE_LOOP = 2, LINE_STRIP = 3, TRIANGLES = 4, TRIANGLE_STRIP = 5, TRIANGLE_FAN = 6 </s> remove export enum EBlendingFunction { ZERO = 0, ONE = 1, SRC_COLOR = 768, ONE_MINUS_SRC_COLOR = 769, DST_COLOR = 774, ONE_MINUS_DST_COLOR = 775, SRC_ALPHA = 770, ONE_MINUS_SRC_ALPHA = 771, DST_ALPHA = 772, ONE_MINUS_DST_ALPHA = 773, CONSTANT_COLOR = 32769, ONE_MINUS_CONSTANT_COLOR = 32770, CONSTANT_ALPHA = 32771, ONE_MINUS_CONSTANT_ALPHA = 32772, SRC_ALPHA_SATURATE = 776 </s> add export enum ETextureType { UNSIGNED_BYTE = 5121, UNSIGNED_SHORT_5_6_5 = 33635, UNSIGNED_SHORT_4_4_4_4 = 32819, UNSIGNED_SHORT_5_5_5_1 = 32820 } export enum ETextureWrapMode { CLAMP_TO_EDGE = 33071, MIRRORED_REPEAT = 33648, REPEAT = 10497 </s> remove export enum ECullingType { FRONT = 1028, BACK = 1029, FRONT_AND_BACK = 1032 </s> add export enum ETextureTarget { TEXTURE_2D = 3553 </s> remove export enum ETextureWrapMode { CLAMP_TO_EDGE = 33071, MIRRORED_REPEAT = 33648, REPEAT = 10497 </s> add export enum ETextureMagFilter { NEAREST = 9728, LINEAR = 9728, </s> remove export enum ETextureFilterType { </s> add export enum ETextureMinFilter {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export enum EMeshPrimitiveMode { POINTS = 0, LINES = 1, LINE_LOOP = 2, LINE_STRIP = 3, TRIANGLES = 4, TRIANGLE_STRIP = 5, TRIANGLE_FAN = 6
<mask> UNSIGNED_SHORT = 5123, <mask> FLOAT = 5126 <mask> } <mask> <mask> export enum EShaderType { <mask> FRAGMENT = 35632, <mask> VERTEX = 35633 <mask> } <mask> <mask> export enum EParameterType { <mask> BYTE = 5120, <mask> UNSIGNED_BYTE = 5121, </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export enum EBlendingFunction { ZERO = 0, ONE = 1, SRC_COLOR = 768, ONE_MINUS_SRC_COLOR = 769, DST_COLOR = 774, ONE_MINUS_DST_COLOR = 775, SRC_ALPHA = 770, ONE_MINUS_SRC_ALPHA = 771, DST_ALPHA = 772, ONE_MINUS_DST_ALPHA = 773, CONSTANT_COLOR = 32769, ONE_MINUS_CONSTANT_COLOR = 32770, CONSTANT_ALPHA = 32771, ONE_MINUS_CONSTANT_ALPHA = 32772, SRC_ALPHA_SATURATE = 776 </s> add export enum ETextureType { UNSIGNED_BYTE = 5121, UNSIGNED_SHORT_5_6_5 = 33635, UNSIGNED_SHORT_4_4_4_4 = 32819, UNSIGNED_SHORT_5_5_5_1 = 32820 } export enum ETextureWrapMode { CLAMP_TO_EDGE = 33071, MIRRORED_REPEAT = 33648, REPEAT = 10497 </s> remove export enum ECullingType { FRONT = 1028, BACK = 1029, FRONT_AND_BACK = 1032 </s> add export enum ETextureTarget { TEXTURE_2D = 3553 </s> remove export enum ETextureWrapMode { CLAMP_TO_EDGE = 33071, MIRRORED_REPEAT = 33648, REPEAT = 10497 </s> add export enum ETextureMagFilter { NEAREST = 9728, LINEAR = 9728, </s> remove export enum ETextureFilterType { </s> add export enum ETextureMinFilter {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export enum ETextureMagFilter { NEAREST = 9728, LINEAR = 9728,
<mask> FLOAT_MAT4 = 35676, <mask> SAMPLER_2D = 35678 <mask> } <mask> <mask> export enum ETextureWrapMode { <mask> CLAMP_TO_EDGE = 33071, <mask> MIRRORED_REPEAT = 33648, <mask> REPEAT = 10497 <mask> } <mask> <mask> export enum ETextureFilterType { <mask> NEAREST = 9728, <mask> LINEAR = 9728, </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export enum ETextureFilterType { </s> add export enum ETextureMinFilter { </s> remove export enum EBlendingFunction { ZERO = 0, ONE = 1, SRC_COLOR = 768, ONE_MINUS_SRC_COLOR = 769, DST_COLOR = 774, ONE_MINUS_DST_COLOR = 775, SRC_ALPHA = 770, ONE_MINUS_SRC_ALPHA = 771, DST_ALPHA = 772, ONE_MINUS_DST_ALPHA = 773, CONSTANT_COLOR = 32769, ONE_MINUS_CONSTANT_COLOR = 32770, CONSTANT_ALPHA = 32771, ONE_MINUS_CONSTANT_ALPHA = 32772, SRC_ALPHA_SATURATE = 776 </s> add export enum ETextureType { UNSIGNED_BYTE = 5121, UNSIGNED_SHORT_5_6_5 = 33635, UNSIGNED_SHORT_4_4_4_4 = 32819, UNSIGNED_SHORT_5_5_5_1 = 32820 } export enum ETextureWrapMode { CLAMP_TO_EDGE = 33071, MIRRORED_REPEAT = 33648, REPEAT = 10497 </s> remove export enum ECullingType { FRONT = 1028, BACK = 1029, FRONT_AND_BACK = 1032 </s> add export enum ETextureTarget { TEXTURE_2D = 3553 </s> remove export enum EShaderType { FRAGMENT = 35632, VERTEX = 35633 </s> add export enum EMeshPrimitiveMode { POINTS = 0, LINES = 1, LINE_LOOP = 2, LINE_STRIP = 3, TRIANGLES = 4, TRIANGLE_STRIP = 5, TRIANGLE_FAN = 6
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export enum ETextureMinFilter {
<mask> MIRRORED_REPEAT = 33648, <mask> REPEAT = 10497 <mask> } <mask> <mask> export enum ETextureFilterType { <mask> NEAREST = 9728, <mask> LINEAR = 9728, <mask> NEAREST_MIPMAP_NEAREST = 9984, <mask> LINEAR_MIPMAP_NEAREST = 9985, <mask> NEAREST_MIPMAP_LINEAR = 9986, </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export enum ETextureWrapMode { CLAMP_TO_EDGE = 33071, MIRRORED_REPEAT = 33648, REPEAT = 10497 </s> add export enum ETextureMagFilter { NEAREST = 9728, LINEAR = 9728, </s> remove export enum EBlendingFunction { ZERO = 0, ONE = 1, SRC_COLOR = 768, ONE_MINUS_SRC_COLOR = 769, DST_COLOR = 774, ONE_MINUS_DST_COLOR = 775, SRC_ALPHA = 770, ONE_MINUS_SRC_ALPHA = 771, DST_ALPHA = 772, ONE_MINUS_DST_ALPHA = 773, CONSTANT_COLOR = 32769, ONE_MINUS_CONSTANT_COLOR = 32770, CONSTANT_ALPHA = 32771, ONE_MINUS_CONSTANT_ALPHA = 32772, SRC_ALPHA_SATURATE = 776 </s> add export enum ETextureType { UNSIGNED_BYTE = 5121, UNSIGNED_SHORT_5_6_5 = 33635, UNSIGNED_SHORT_4_4_4_4 = 32819, UNSIGNED_SHORT_5_5_5_1 = 32820 } export enum ETextureWrapMode { CLAMP_TO_EDGE = 33071, MIRRORED_REPEAT = 33648, REPEAT = 10497 </s> remove export enum ECullingType { FRONT = 1028, BACK = 1029, FRONT_AND_BACK = 1032 </s> add export enum ETextureTarget { TEXTURE_2D = 3553 </s> remove export enum EShaderType { FRAGMENT = 35632, VERTEX = 35633 </s> add export enum EMeshPrimitiveMode { POINTS = 0, LINES = 1, LINE_LOOP = 2, LINE_STRIP = 3, TRIANGLES = 4, TRIANGLE_STRIP = 5, TRIANGLE_FAN = 6
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export enum ETextureTarget { TEXTURE_2D = 3553
<mask> LUMINANCE = 6409, <mask> LUMINANCE_ALPHA = 6410 <mask> } <mask> <mask> export enum ECullingType { <mask> FRONT = 1028, <mask> BACK = 1029, <mask> FRONT_AND_BACK = 1032 <mask> } <mask> <mask> export enum EBlendingFunction { <mask> ZERO = 0, <mask> ONE = 1, </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export enum EBlendingFunction { ZERO = 0, ONE = 1, SRC_COLOR = 768, ONE_MINUS_SRC_COLOR = 769, DST_COLOR = 774, ONE_MINUS_DST_COLOR = 775, SRC_ALPHA = 770, ONE_MINUS_SRC_ALPHA = 771, DST_ALPHA = 772, ONE_MINUS_DST_ALPHA = 773, CONSTANT_COLOR = 32769, ONE_MINUS_CONSTANT_COLOR = 32770, CONSTANT_ALPHA = 32771, ONE_MINUS_CONSTANT_ALPHA = 32772, SRC_ALPHA_SATURATE = 776 </s> add export enum ETextureType { UNSIGNED_BYTE = 5121, UNSIGNED_SHORT_5_6_5 = 33635, UNSIGNED_SHORT_4_4_4_4 = 32819, UNSIGNED_SHORT_5_5_5_1 = 32820 } export enum ETextureWrapMode { CLAMP_TO_EDGE = 33071, MIRRORED_REPEAT = 33648, REPEAT = 10497 </s> remove export enum EShaderType { FRAGMENT = 35632, VERTEX = 35633 </s> add export enum EMeshPrimitiveMode { POINTS = 0, LINES = 1, LINE_LOOP = 2, LINE_STRIP = 3, TRIANGLES = 4, TRIANGLE_STRIP = 5, TRIANGLE_FAN = 6 </s> remove export enum ETextureWrapMode { CLAMP_TO_EDGE = 33071, MIRRORED_REPEAT = 33648, REPEAT = 10497 </s> add export enum ETextureMagFilter { NEAREST = 9728, LINEAR = 9728, </s> remove export enum ETextureFilterType { </s> add export enum ETextureMinFilter {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export enum ETextureType { UNSIGNED_BYTE = 5121, UNSIGNED_SHORT_5_6_5 = 33635, UNSIGNED_SHORT_4_4_4_4 = 32819, UNSIGNED_SHORT_5_5_5_1 = 32820 } export enum ETextureWrapMode { CLAMP_TO_EDGE = 33071, MIRRORED_REPEAT = 33648, REPEAT = 10497
<mask> BACK = 1029, <mask> FRONT_AND_BACK = 1032 <mask> } <mask> <mask> export enum EBlendingFunction { <mask> ZERO = 0, <mask> ONE = 1, <mask> SRC_COLOR = 768, <mask> ONE_MINUS_SRC_COLOR = 769, <mask> DST_COLOR = 774, <mask> ONE_MINUS_DST_COLOR = 775, <mask> SRC_ALPHA = 770, <mask> ONE_MINUS_SRC_ALPHA = 771, <mask> DST_ALPHA = 772, <mask> ONE_MINUS_DST_ALPHA = 773, <mask> CONSTANT_COLOR = 32769, <mask> ONE_MINUS_CONSTANT_COLOR = 32770, <mask> CONSTANT_ALPHA = 32771, <mask> ONE_MINUS_CONSTANT_ALPHA = 32772, <mask> SRC_ALPHA_SATURATE = 776 <mask> } <mask> <mask> /** <mask> * Interfaces <mask> */ </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export enum ECullingType { FRONT = 1028, BACK = 1029, FRONT_AND_BACK = 1032 </s> add export enum ETextureTarget { TEXTURE_2D = 3553 </s> remove export enum EShaderType { FRAGMENT = 35632, VERTEX = 35633 </s> add export enum EMeshPrimitiveMode { POINTS = 0, LINES = 1, LINE_LOOP = 2, LINE_STRIP = 3, TRIANGLES = 4, TRIANGLE_STRIP = 5, TRIANGLE_FAN = 6 </s> remove export enum ETextureWrapMode { CLAMP_TO_EDGE = 33071, MIRRORED_REPEAT = 33648, REPEAT = 10497 </s> add export enum ETextureMagFilter { NEAREST = 9728, LINEAR = 9728, </s> remove export enum ETextureFilterType { </s> add export enum ETextureMinFilter {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
extras?: any;
<mask> * Interfaces <mask> */ <mask> export interface IGLTFProperty { <mask> extensions?: Object; <mask> extras?: Object; <mask> } <mask> <mask> export interface IGLTFChildRootProperty extends IGLTFProperty { <mask> name?: string; <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove export interface IGLTFAnimation extends IGLTFChildRootProperty { channels?: IGLTFAnimationChannel[]; parameters?: Object; samplers?: Object; </s> add export interface IGLTFMaterialPbrMetallicRoughness { baseColorFactor: number[]; baseColorTexture: IGLTFTextureInfo; metallicFactor: number; roughnessFactor: number; metallicRoughnessTexture: IGLTFTextureInfo; </s> remove export interface IGLTFAnimationSampler { input: string; output: string; interpolation?: string; </s> add export interface IGLTFMaterialOcclusionTextureInfo extends IGLTFTextureInfo { strength: number; </s> remove /** * Runtime */ export interface IGLTFRuntime { extensions: Object; accessors: Object; buffers: Object; bufferViews: Object; meshes: Object; lights: Object; cameras: Object; nodes: Object; images: Object; textures: Object; shaders: Object; programs: Object; samplers: Object; techniques: Object; materials: Object; animations: Object; skins: Object; currentScene?: Object; scenes: Object; // v1.1 extensionsUsed: string[]; extensionsRequired?: string[]; // v1.1 buffersCount: number; shaderscount: number; scene: Scene; rootUrl: string; </s> add export interface IGLTFSkin extends IGLTFChildRootProperty { bindShapeMatrix?: number[]; inverseBindMatrices?: number; jointNames: number[]; </s> remove export interface IGLTFNodeInstanceSkin { skeletons: string[]; skin: string; meshes: string[]; </s> add export interface IGLTFMaterial extends IGLTFChildRootProperty { pbrMetallicRoughness?: IGLTFMaterialPbrMetallicRoughness; normalTexture?: IGLTFMaterialNormalTextureInfo; occlusionTexture?: IGLTFMaterialOcclusionTextureInfo; emissiveTexture?: IGLTFTextureInfo; emissiveFactor?: number[]; // Babylon.js values (optimize) babylonMaterial?: PBRMaterial;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
bufferView: number;
<mask> name?: string; <mask> } <mask> <mask> export interface IGLTFAccessor extends IGLTFChildRootProperty { <mask> bufferView: string; <mask> byteOffset: number; <mask> byteStride: number; <mask> count: number; <mask> type: string; <mask> componentType: EComponentType; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove byteStride: number; </s> add byteStride?: number; componentType: EComponentType; normalized?: boolean; </s> remove componentType: EComponentType; max?: number[], min?: number[], name?: string; } export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: string; byteOffset: number; byteLength: number; target?: number; } export interface IGLTFBuffer extends IGLTFChildRootProperty { uri: string; byteLength?: number; type?: string; </s> add max: number[]; min: number[]; </s> remove export interface IGLTFLight extends IGLTFChildRootProperty { type: string; </s> add export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: number; byteOffset: number; byteLength: number; target?: EBufferViewTarget; </s> remove export interface IGLTFSampler extends IGLTFChildRootProperty { magFilter?: number; minFilter?: number; wrapS?: number; wrapT?: number; </s> add export interface IGLTFAnimationSampler { input: number; interpolation?: string; output: number; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
byteStride?: number; componentType: EComponentType; normalized?: boolean;
<mask> <mask> export interface IGLTFAccessor extends IGLTFChildRootProperty { <mask> bufferView: string; <mask> byteOffset: number; <mask> byteStride: number; <mask> count: number; <mask> type: string; <mask> componentType: EComponentType; <mask> <mask> max?: number[], </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove bufferView: string; </s> add bufferView: number; </s> remove componentType: EComponentType; max?: number[], min?: number[], name?: string; } export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: string; byteOffset: number; byteLength: number; target?: number; } export interface IGLTFBuffer extends IGLTFChildRootProperty { uri: string; byteLength?: number; type?: string; </s> add max: number[]; min: number[]; </s> remove export interface IGLTFLight extends IGLTFChildRootProperty { type: string; </s> add export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: number; byteOffset: number; byteLength: number; target?: EBufferViewTarget; </s> remove export interface IGLTFSampler extends IGLTFChildRootProperty { magFilter?: number; minFilter?: number; wrapS?: number; wrapT?: number; </s> add export interface IGLTFAnimationSampler { input: number; interpolation?: string; output: number; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
max: number[]; min: number[];
<mask> byteOffset: number; <mask> byteStride: number; <mask> count: number; <mask> type: string; <mask> componentType: EComponentType; <mask> <mask> max?: number[], <mask> min?: number[], <mask> name?: string; <mask> } <mask> <mask> export interface IGLTFBufferView extends IGLTFChildRootProperty { <mask> buffer: string; <mask> byteOffset: number; <mask> byteLength: number; <mask> <mask> target?: number; <mask> } <mask> <mask> export interface IGLTFBuffer extends IGLTFChildRootProperty { <mask> uri: string; <mask> <mask> byteLength?: number; <mask> type?: string; <mask> } <mask> <mask> export interface IGLTFShader extends IGLTFChildRootProperty { <mask> uri: string; <mask> type: EShaderType; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove byteStride: number; </s> add byteStride?: number; componentType: EComponentType; normalized?: boolean; </s> remove bufferView: string; </s> add bufferView: number; </s> remove export interface IGLTFLight extends IGLTFChildRootProperty { type: string; </s> add export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: number; byteOffset: number; byteLength: number; target?: EBufferViewTarget; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove export interface IGLTFSampler extends IGLTFChildRootProperty { magFilter?: number; minFilter?: number; wrapS?: number; wrapT?: number; </s> add export interface IGLTFAnimationSampler { input: number; interpolation?: string; output: number;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep"...
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget;
<mask> byteLength?: number; <mask> type?: string; <mask> } <mask> <mask> export interface IGLTFShader extends IGLTFChildRootProperty { <mask> uri: string; <mask> type: EShaderType; <mask> } <mask> <mask> export interface IGLTFProgram extends IGLTFChildRootProperty { <mask> attributes: string[]; <mask> fragmentShader: string; <mask> vertexShader: string; <mask> } <mask> <mask> export interface IGLTFTechniqueParameter { <mask> type: number; <mask> <mask> count?: number; <mask> semantic?: string; <mask> node?: string; <mask> value?: number|boolean|string|Array<any>; <mask> source?: string; <mask> <mask> babylonValue?: any; <mask> } <mask> <mask> export interface IGLTFTechniqueCommonProfile { <mask> lightingModel: string; <mask> texcoordBindings: Object; <mask> <mask> parameters?: Array<any>; <mask> } <mask> <mask> export interface IGLTFTechniqueStatesFunctions { <mask> blendColor?: number[]; <mask> blendEquationSeparate?: number[]; <mask> blendFuncSeparate?: number[]; <mask> colorMask: boolean[]; <mask> cullFace: number[]; <mask> } <mask> <mask> export interface IGLTFTechniqueStates { <mask> enable: number[]; <mask> functions: IGLTFTechniqueStatesFunctions; <mask> } <mask> <mask> export interface IGLTFTechnique extends IGLTFChildRootProperty { <mask> parameters: Object; <mask> program: string; <mask> <mask> attributes: Object; <mask> uniforms: Object; <mask> states: IGLTFTechniqueStates; <mask> } <mask> <mask> export interface IGLTFMaterial extends IGLTFChildRootProperty { <mask> technique?: string; <mask> values: string[]; <mask> } <mask> <mask> export interface IGLTFMeshPrimitive extends IGLTFProperty { <mask> attributes: Object; <mask> indices: string; <mask> material: string; <mask> <mask> mode?: number; <mask> } <mask> <mask> export interface IGLTFMesh extends IGLTFChildRootProperty { <mask> primitives: IGLTFMeshPrimitive[]; <mask> } <mask> <mask> export interface IGLTFImage extends IGLTFChildRootProperty { <mask> uri: string; <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove componentType: EComponentType; max?: number[], min?: number[], name?: string; } export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: string; byteOffset: number; byteLength: number; target?: number; } export interface IGLTFBuffer extends IGLTFChildRootProperty { uri: string; byteLength?: number; type?: string; </s> add max: number[]; min: number[]; </s> remove export interface IGLTFSkins extends IGLTFChildRootProperty { bindShapeMatrix: number[]; inverseBindMatrices: string; jointNames: string[]; </s> add export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: { [name: string]: number }; indices?: number; material?: number; mode?: EMeshPrimitiveMode; } </s> remove export interface IGLTFImage extends IGLTFChildRootProperty { uri: string; </s> add export interface IGLTFAnimationChannelTarget { id: number; path: string; </s> remove export interface IGLTFAnimation extends IGLTFChildRootProperty { channels?: IGLTFAnimationChannel[]; parameters?: Object; samplers?: Object; </s> add export interface IGLTFMaterialPbrMetallicRoughness { baseColorFactor: number[]; baseColorTexture: IGLTFTextureInfo; metallicFactor: number; roughnessFactor: number; metallicRoughnessTexture: IGLTFTextureInfo; </s> remove export interface IGLTFNodeInstanceSkin { skeletons: string[]; skin: string; meshes: string[]; </s> add export interface IGLTFMaterial extends IGLTFChildRootProperty { pbrMetallicRoughness?: IGLTFMaterialPbrMetallicRoughness; normalTexture?: IGLTFMaterialNormalTextureInfo; occlusionTexture?: IGLTFMaterialOcclusionTextureInfo; emissiveTexture?: IGLTFTextureInfo; emissiveFactor?: number[]; // Babylon.js values (optimize) babylonMaterial?: PBRMaterial;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFAnimationChannelTarget { id: number; path: string;
<mask> export interface IGLTFMesh extends IGLTFChildRootProperty { <mask> primitives: IGLTFMeshPrimitive[]; <mask> } <mask> <mask> export interface IGLTFImage extends IGLTFChildRootProperty { <mask> uri: string; <mask> } <mask> <mask> export interface IGLTFSampler extends IGLTFChildRootProperty { <mask> magFilter?: number; <mask> minFilter?: number; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFSampler extends IGLTFChildRootProperty { magFilter?: number; minFilter?: number; wrapS?: number; wrapT?: number; </s> add export interface IGLTFAnimationSampler { input: number; interpolation?: string; output: number; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove babylonSkeleton?: Skeleton; </s> add export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> remove componentType: EComponentType; max?: number[], min?: number[], name?: string; } export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: string; byteOffset: number; byteLength: number; target?: number; } export interface IGLTFBuffer extends IGLTFChildRootProperty { uri: string; byteLength?: number; type?: string; </s> add max: number[]; min: number[];
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFAnimationSampler { input: number; interpolation?: string; output: number;
<mask> export interface IGLTFImage extends IGLTFChildRootProperty { <mask> uri: string; <mask> } <mask> <mask> export interface IGLTFSampler extends IGLTFChildRootProperty { <mask> magFilter?: number; <mask> minFilter?: number; <mask> wrapS?: number; <mask> wrapT?: number; <mask> } <mask> <mask> export interface IGLTFTexture extends IGLTFChildRootProperty { <mask> sampler: string; <mask> source: string; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFImage extends IGLTFChildRootProperty { uri: string; </s> add export interface IGLTFAnimationChannelTarget { id: number; path: string; </s> remove export interface IGLTFTexture extends IGLTFChildRootProperty { sampler: string; source: string; format?: ETextureFormat; internalFormat?: ETextureFormat; target?: number; type?: number; // Babylon.js values (optimize) babylonTexture?: Texture; </s> add export interface IGLTFAnimation extends IGLTFChildRootProperty { channels?: IGLTFAnimationChannel[]; samplers?: IGLTFAnimationSampler[]; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove componentType: EComponentType; max?: number[], min?: number[], name?: string; } export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: string; byteOffset: number; byteLength: number; target?: number; } export interface IGLTFBuffer extends IGLTFChildRootProperty { uri: string; byteLength?: number; type?: string; </s> add max: number[]; min: number[]; </s> remove export interface IGLTFAnimationChannelTarget { id: string; path: string; </s> add export interface IGLTFImage extends IGLTFChildRootProperty { uri?: string; mimeType?: string; bufferView?: number;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFAnimation extends IGLTFChildRootProperty { channels?: IGLTFAnimationChannel[]; samplers?: IGLTFAnimationSampler[];
<mask> wrapS?: number; <mask> wrapT?: number; <mask> } <mask> <mask> export interface IGLTFTexture extends IGLTFChildRootProperty { <mask> sampler: string; <mask> source: string; <mask> <mask> format?: ETextureFormat; <mask> internalFormat?: ETextureFormat; <mask> target?: number; <mask> type?: number; <mask> <mask> // Babylon.js values (optimize) <mask> babylonTexture?: Texture; <mask> } <mask> <mask> export interface IGLTFAmbienLight { <mask> color?: number[]; <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove loadedBufferCount: number; loadedBufferViews: { [name: string]: ArrayBufferView }; </s> add babylonSkeleton?: Skeleton; } export interface IGLTFTexture extends IGLTFChildRootProperty { format?: ETextureFormat; internalFormat?: ETextureFormat; sampler: number; source: number; target?: ETextureTarget; type?: ETextureType; </s> remove export interface IGLTFSampler extends IGLTFChildRootProperty { magFilter?: number; minFilter?: number; wrapS?: number; wrapT?: number; </s> add export interface IGLTFAnimationSampler { input: number; interpolation?: string; output: number; </s> remove export interface IGLTFAmbienLight { color?: number[]; </s> add export interface IGLTFAssetProfile extends IGLTFProperty { api?: string; version?: string; </s> remove componentType: EComponentType; max?: number[], min?: number[], name?: string; } export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: string; byteOffset: number; byteLength: number; target?: number; } export interface IGLTFBuffer extends IGLTFChildRootProperty { uri: string; byteLength?: number; type?: string; </s> add max: number[]; min: number[]; </s> remove export interface IGLTFDirectionalLight { color?: number[]; </s> add export interface IGLTFAsset extends IGLTFChildRootProperty { copyright?: string; generator?: string; profile?: IGLTFAssetProfile; version: string;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFAssetProfile extends IGLTFProperty { api?: string; version?: string;
<mask> // Babylon.js values (optimize) <mask> babylonTexture?: Texture; <mask> } <mask> <mask> export interface IGLTFAmbienLight { <mask> color?: number[]; <mask> } <mask> <mask> export interface IGLTFDirectionalLight { <mask> color?: number[]; <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFTexture extends IGLTFChildRootProperty { sampler: string; source: string; format?: ETextureFormat; internalFormat?: ETextureFormat; target?: number; type?: number; // Babylon.js values (optimize) babylonTexture?: Texture; </s> add export interface IGLTFAnimation extends IGLTFChildRootProperty { channels?: IGLTFAnimationChannel[]; samplers?: IGLTFAnimationSampler[]; </s> remove export interface IGLTFDirectionalLight { color?: number[]; </s> add export interface IGLTFAsset extends IGLTFChildRootProperty { copyright?: string; generator?: string; profile?: IGLTFAssetProfile; version: string; </s> remove export interface IGLTFPointLight { color?: number[]; constantAttenuation?: number; linearAttenuation?: number; quadraticAttenuation?: number; } </s> add export interface IGLTFBuffer extends IGLTFChildRootProperty { uri?: string; byteLength: number; </s> remove export interface IGLTFSpotLight { color?: number[]; constantAttenuation?: number; fallOfAngle?: number; fallOffExponent?: number; linearAttenuation?: number; quadraticAttenuation?: number; </s> add // Loaded buffer (optimize) loadedBufferView: ArrayBufferView </s> remove export interface IGLTFNodeInstanceSkin { skeletons: string[]; skin: string; meshes: string[]; </s> add export interface IGLTFMaterial extends IGLTFChildRootProperty { pbrMetallicRoughness?: IGLTFMaterialPbrMetallicRoughness; normalTexture?: IGLTFMaterialNormalTextureInfo; occlusionTexture?: IGLTFMaterialOcclusionTextureInfo; emissiveTexture?: IGLTFTextureInfo; emissiveFactor?: number[]; // Babylon.js values (optimize) babylonMaterial?: PBRMaterial;
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFAsset extends IGLTFChildRootProperty { copyright?: string; generator?: string; profile?: IGLTFAssetProfile; version: string;
<mask> export interface IGLTFAmbienLight { <mask> color?: number[]; <mask> } <mask> <mask> export interface IGLTFDirectionalLight { <mask> color?: number[]; <mask> } <mask> <mask> export interface IGLTFPointLight { <mask> color?: number[]; <mask> constantAttenuation?: number; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFPointLight { color?: number[]; constantAttenuation?: number; linearAttenuation?: number; quadraticAttenuation?: number; } </s> add export interface IGLTFBuffer extends IGLTFChildRootProperty { uri?: string; byteLength: number; </s> remove export interface IGLTFAmbienLight { color?: number[]; </s> add export interface IGLTFAssetProfile extends IGLTFProperty { api?: string; version?: string; </s> remove export interface IGLTFSpotLight { color?: number[]; constantAttenuation?: number; fallOfAngle?: number; fallOffExponent?: number; linearAttenuation?: number; quadraticAttenuation?: number; </s> add // Loaded buffer (optimize) loadedBufferView: ArrayBufferView </s> remove export interface IGLTFTexture extends IGLTFChildRootProperty { sampler: string; source: string; format?: ETextureFormat; internalFormat?: ETextureFormat; target?: number; type?: number; // Babylon.js values (optimize) babylonTexture?: Texture; </s> add export interface IGLTFAnimation extends IGLTFChildRootProperty { channels?: IGLTFAnimationChannel[]; samplers?: IGLTFAnimationSampler[]; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget;
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFBuffer extends IGLTFChildRootProperty { uri?: string; byteLength: number;
<mask> export interface IGLTFDirectionalLight { <mask> color?: number[]; <mask> } <mask> <mask> export interface IGLTFPointLight { <mask> color?: number[]; <mask> constantAttenuation?: number; <mask> linearAttenuation?: number; <mask> quadraticAttenuation?: number; <mask> } <mask> <mask> export interface IGLTFSpotLight { <mask> color?: number[]; <mask> constantAttenuation?: number; <mask> fallOfAngle?: number; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFSpotLight { color?: number[]; constantAttenuation?: number; fallOfAngle?: number; fallOffExponent?: number; linearAttenuation?: number; quadraticAttenuation?: number; </s> add // Loaded buffer (optimize) loadedBufferView: ArrayBufferView </s> remove export interface IGLTFDirectionalLight { color?: number[]; </s> add export interface IGLTFAsset extends IGLTFChildRootProperty { copyright?: string; generator?: string; profile?: IGLTFAssetProfile; version: string; </s> remove export interface IGLTFTexture extends IGLTFChildRootProperty { sampler: string; source: string; format?: ETextureFormat; internalFormat?: ETextureFormat; target?: number; type?: number; // Babylon.js values (optimize) babylonTexture?: Texture; </s> add export interface IGLTFAnimation extends IGLTFChildRootProperty { channels?: IGLTFAnimationChannel[]; samplers?: IGLTFAnimationSampler[]; </s> remove export interface IGLTFAmbienLight { color?: number[]; </s> add export interface IGLTFAssetProfile extends IGLTFProperty { api?: string; version?: string; </s> remove export interface IGLTFLight extends IGLTFChildRootProperty { type: string; </s> add export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: number; byteOffset: number; byteLength: number; target?: EBufferViewTarget;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
// Loaded buffer (optimize) loadedBufferView: ArrayBufferView
<mask> linearAttenuation?: number; <mask> quadraticAttenuation?: number; <mask> } <mask> <mask> export interface IGLTFSpotLight { <mask> color?: number[]; <mask> constantAttenuation?: number; <mask> fallOfAngle?: number; <mask> fallOffExponent?: number; <mask> linearAttenuation?: number; <mask> quadraticAttenuation?: number; <mask> } <mask> <mask> export interface IGLTFLight extends IGLTFChildRootProperty { <mask> type: string; <mask> } </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFPointLight { color?: number[]; constantAttenuation?: number; linearAttenuation?: number; quadraticAttenuation?: number; } </s> add export interface IGLTFBuffer extends IGLTFChildRootProperty { uri?: string; byteLength: number; </s> remove export interface IGLTFLight extends IGLTFChildRootProperty { type: string; </s> add export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: number; byteOffset: number; byteLength: number; target?: EBufferViewTarget; </s> remove componentType: EComponentType; max?: number[], min?: number[], name?: string; } export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: string; byteOffset: number; byteLength: number; target?: number; } export interface IGLTFBuffer extends IGLTFChildRootProperty { uri: string; byteLength?: number; type?: string; </s> add max: number[]; min: number[]; </s> remove export interface IGLTFDirectionalLight { color?: number[]; </s> add export interface IGLTFAsset extends IGLTFChildRootProperty { copyright?: string; generator?: string; profile?: IGLTFAssetProfile; version: string; </s> remove export interface IGLTFTexture extends IGLTFChildRootProperty { sampler: string; source: string; format?: ETextureFormat; internalFormat?: ETextureFormat; target?: number; type?: number; // Babylon.js values (optimize) babylonTexture?: Texture; </s> add export interface IGLTFAnimation extends IGLTFChildRootProperty { channels?: IGLTFAnimationChannel[]; samplers?: IGLTFAnimationSampler[];
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: number; byteOffset: number; byteLength: number; target?: EBufferViewTarget;
<mask> linearAttenuation?: number; <mask> quadraticAttenuation?: number; <mask> } <mask> <mask> export interface IGLTFLight extends IGLTFChildRootProperty { <mask> type: string; <mask> } <mask> <mask> export interface IGLTFCameraOrthographic { <mask> xmag: number; <mask> ymag: number; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFSpotLight { color?: number[]; constantAttenuation?: number; fallOfAngle?: number; fallOffExponent?: number; linearAttenuation?: number; quadraticAttenuation?: number; </s> add // Loaded buffer (optimize) loadedBufferView: ArrayBufferView </s> remove export interface IGLTFPointLight { color?: number[]; constantAttenuation?: number; linearAttenuation?: number; quadraticAttenuation?: number; } </s> add export interface IGLTFBuffer extends IGLTFChildRootProperty { uri?: string; byteLength: number; </s> remove componentType: EComponentType; max?: number[], min?: number[], name?: string; } export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: string; byteOffset: number; byteLength: number; target?: number; } export interface IGLTFBuffer extends IGLTFChildRootProperty { uri: string; byteLength?: number; type?: string; </s> add max: number[]; min: number[]; </s> remove export interface IGLTFSampler extends IGLTFChildRootProperty { magFilter?: number; minFilter?: number; wrapS?: number; wrapT?: number; </s> add export interface IGLTFAnimationSampler { input: number; interpolation?: string; output: number; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget;
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
orthographic?: IGLTFCameraOrthographic; perspective?: IGLTFCameraPerspective;
<mask> znear: number; <mask> } <mask> <mask> export interface IGLTFCamera extends IGLTFChildRootProperty { <mask> type: string; <mask> } <mask> <mask> export interface IGLTFImage extends IGLTFChildRootProperty { <mask> uri?: string; <mask> mimeType?: string; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFAnimationChannelTarget { id: string; path: string; </s> add export interface IGLTFImage extends IGLTFChildRootProperty { uri?: string; mimeType?: string; bufferView?: number; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove export interface IGLTFSampler extends IGLTFChildRootProperty { magFilter?: number; minFilter?: number; wrapS?: number; wrapT?: number; </s> add export interface IGLTFAnimationSampler { input: number; interpolation?: string; output: number; </s> remove export interface IGLTFImage extends IGLTFChildRootProperty { uri: string; </s> add export interface IGLTFAnimationChannelTarget { id: number; path: string; </s> remove componentType: EComponentType; max?: number[], min?: number[], name?: string; } export interface IGLTFBufferView extends IGLTFChildRootProperty { buffer: string; byteOffset: number; byteLength: number; target?: number; } export interface IGLTFBuffer extends IGLTFChildRootProperty { uri: string; byteLength?: number; type?: string; </s> add max: number[]; min: number[];
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFImage extends IGLTFChildRootProperty { uri?: string; mimeType?: string; bufferView?: number;
<mask> export interface IGLTFCamera extends IGLTFChildRootProperty { <mask> type: string; <mask> } <mask> <mask> export interface IGLTFAnimationChannelTarget { <mask> id: string; <mask> path: string; <mask> } <mask> <mask> export interface IGLTFAnimationChannel { <mask> sampler: string; <mask> target: IGLTFAnimationChannelTarget; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFAnimationChannel { sampler: string; target: IGLTFAnimationChannelTarget; </s> add export interface IGLTFMaterialNormalTextureInfo extends IGLTFTextureInfo { scale: number; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove export interface IGLTFImage extends IGLTFChildRootProperty { uri: string; </s> add export interface IGLTFAnimationChannelTarget { id: number; path: string; </s> remove export interface IGLTFAnimationSampler { input: string; output: string; interpolation?: string; </s> add export interface IGLTFMaterialOcclusionTextureInfo extends IGLTFTextureInfo { strength: number;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFMaterialNormalTextureInfo extends IGLTFTextureInfo { scale: number;
<mask> id: string; <mask> path: string; <mask> } <mask> <mask> export interface IGLTFAnimationChannel { <mask> sampler: string; <mask> target: IGLTFAnimationChannelTarget; <mask> } <mask> <mask> export interface IGLTFAnimationSampler { <mask> input: string; <mask> output: string; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFAnimationSampler { input: string; output: string; interpolation?: string; </s> add export interface IGLTFMaterialOcclusionTextureInfo extends IGLTFTextureInfo { strength: number; </s> remove export interface IGLTFAnimationChannelTarget { id: string; path: string; </s> add export interface IGLTFImage extends IGLTFChildRootProperty { uri?: string; mimeType?: string; bufferView?: number; </s> remove export interface IGLTFSampler extends IGLTFChildRootProperty { magFilter?: number; minFilter?: number; wrapS?: number; wrapT?: number; </s> add export interface IGLTFAnimationSampler { input: number; interpolation?: string; output: number; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove export interface IGLTFImage extends IGLTFChildRootProperty { uri: string; </s> add export interface IGLTFAnimationChannelTarget { id: number; path: string;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFMaterialOcclusionTextureInfo extends IGLTFTextureInfo { strength: number;
<mask> sampler: string; <mask> target: IGLTFAnimationChannelTarget; <mask> } <mask> <mask> export interface IGLTFAnimationSampler { <mask> input: string; <mask> output: string; <mask> <mask> interpolation?: string; <mask> } <mask> <mask> export interface IGLTFAnimation extends IGLTFChildRootProperty { <mask> channels?: IGLTFAnimationChannel[]; <mask> parameters?: Object; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFAnimationChannel { sampler: string; target: IGLTFAnimationChannelTarget; </s> add export interface IGLTFMaterialNormalTextureInfo extends IGLTFTextureInfo { scale: number; </s> remove export interface IGLTFAnimation extends IGLTFChildRootProperty { channels?: IGLTFAnimationChannel[]; parameters?: Object; samplers?: Object; </s> add export interface IGLTFMaterialPbrMetallicRoughness { baseColorFactor: number[]; baseColorTexture: IGLTFTextureInfo; metallicFactor: number; roughnessFactor: number; metallicRoughnessTexture: IGLTFTextureInfo; </s> remove export interface IGLTFSampler extends IGLTFChildRootProperty { magFilter?: number; minFilter?: number; wrapS?: number; wrapT?: number; </s> add export interface IGLTFAnimationSampler { input: number; interpolation?: string; output: number; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove export interface IGLTFAnimationChannelTarget { id: string; path: string; </s> add export interface IGLTFImage extends IGLTFChildRootProperty { uri?: string; mimeType?: string; bufferView?: number;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFMaterialPbrMetallicRoughness { baseColorFactor: number[]; baseColorTexture: IGLTFTextureInfo; metallicFactor: number; roughnessFactor: number; metallicRoughnessTexture: IGLTFTextureInfo;
<mask> <mask> interpolation?: string; <mask> } <mask> <mask> export interface IGLTFAnimation extends IGLTFChildRootProperty { <mask> channels?: IGLTFAnimationChannel[]; <mask> parameters?: Object; <mask> samplers?: Object; <mask> } <mask> <mask> export interface IGLTFNodeInstanceSkin { <mask> skeletons: string[]; <mask> skin: string; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFAnimationSampler { input: string; output: string; interpolation?: string; </s> add export interface IGLTFMaterialOcclusionTextureInfo extends IGLTFTextureInfo { strength: number; </s> remove export interface IGLTFNodeInstanceSkin { skeletons: string[]; skin: string; meshes: string[]; </s> add export interface IGLTFMaterial extends IGLTFChildRootProperty { pbrMetallicRoughness?: IGLTFMaterialPbrMetallicRoughness; normalTexture?: IGLTFMaterialNormalTextureInfo; occlusionTexture?: IGLTFMaterialOcclusionTextureInfo; emissiveTexture?: IGLTFTextureInfo; emissiveFactor?: number[]; // Babylon.js values (optimize) babylonMaterial?: PBRMaterial; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove export interface IGLTFTexture extends IGLTFChildRootProperty { sampler: string; source: string; format?: ETextureFormat; internalFormat?: ETextureFormat; target?: number; type?: number; // Babylon.js values (optimize) babylonTexture?: Texture; </s> add export interface IGLTFAnimation extends IGLTFChildRootProperty { channels?: IGLTFAnimationChannel[]; samplers?: IGLTFAnimationSampler[]; </s> remove extras?: Object; </s> add extras?: any;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFMaterial extends IGLTFChildRootProperty { pbrMetallicRoughness?: IGLTFMaterialPbrMetallicRoughness; normalTexture?: IGLTFMaterialNormalTextureInfo; occlusionTexture?: IGLTFMaterialOcclusionTextureInfo; emissiveTexture?: IGLTFTextureInfo; emissiveFactor?: number[]; // Babylon.js values (optimize) babylonMaterial?: PBRMaterial;
<mask> parameters?: Object; <mask> samplers?: Object; <mask> } <mask> <mask> export interface IGLTFNodeInstanceSkin { <mask> skeletons: string[]; <mask> skin: string; <mask> meshes: string[]; <mask> } <mask> <mask> export interface IGLTFSkins extends IGLTFChildRootProperty { <mask> bindShapeMatrix: number[]; <mask> inverseBindMatrices: string; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFAnimation extends IGLTFChildRootProperty { channels?: IGLTFAnimationChannel[]; parameters?: Object; samplers?: Object; </s> add export interface IGLTFMaterialPbrMetallicRoughness { baseColorFactor: number[]; baseColorTexture: IGLTFTextureInfo; metallicFactor: number; roughnessFactor: number; metallicRoughnessTexture: IGLTFTextureInfo; </s> remove export interface IGLTFSkins extends IGLTFChildRootProperty { bindShapeMatrix: number[]; inverseBindMatrices: string; jointNames: string[]; </s> add export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: { [name: string]: number }; indices?: number; material?: number; mode?: EMeshPrimitiveMode; } </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove babylonSkeleton?: Skeleton; </s> add export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> remove /** * Runtime */ export interface IGLTFRuntime { extensions: Object; accessors: Object; buffers: Object; bufferViews: Object; meshes: Object; lights: Object; cameras: Object; nodes: Object; images: Object; textures: Object; shaders: Object; programs: Object; samplers: Object; techniques: Object; materials: Object; animations: Object; skins: Object; currentScene?: Object; scenes: Object; // v1.1 extensionsUsed: string[]; extensionsRequired?: string[]; // v1.1 buffersCount: number; shaderscount: number; scene: Scene; rootUrl: string; </s> add export interface IGLTFSkin extends IGLTFChildRootProperty { bindShapeMatrix?: number[]; inverseBindMatrices?: number; jointNames: number[];
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: { [name: string]: number }; indices?: number; material?: number; mode?: EMeshPrimitiveMode; }
<mask> skin: string; <mask> meshes: string[]; <mask> } <mask> <mask> export interface IGLTFSkins extends IGLTFChildRootProperty { <mask> bindShapeMatrix: number[]; <mask> inverseBindMatrices: string; <mask> jointNames: string[]; <mask> <mask> babylonSkeleton?: Skeleton; <mask> } <mask> <mask> export interface IGLTFNode extends IGLTFChildRootProperty { </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove babylonSkeleton?: Skeleton; </s> add export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> remove export interface IGLTFNodeInstanceSkin { skeletons: string[]; skin: string; meshes: string[]; </s> add export interface IGLTFMaterial extends IGLTFChildRootProperty { pbrMetallicRoughness?: IGLTFMaterialPbrMetallicRoughness; normalTexture?: IGLTFMaterialNormalTextureInfo; occlusionTexture?: IGLTFMaterialOcclusionTextureInfo; emissiveTexture?: IGLTFTextureInfo; emissiveFactor?: number[]; // Babylon.js values (optimize) babylonMaterial?: PBRMaterial; </s> remove camera?: string; children: string[]; skin?: string; jointName?: string; light?: string; </s> add camera?: number; children?: number[]; skeletons?: number[]; skin?: number; jointName?: number; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove export interface IGLTFAnimation extends IGLTFChildRootProperty { channels?: IGLTFAnimationChannel[]; parameters?: Object; samplers?: Object; </s> add export interface IGLTFMaterialPbrMetallicRoughness { baseColorFactor: number[]; baseColorTexture: IGLTFTextureInfo; metallicFactor: number; roughnessFactor: number; metallicRoughnessTexture: IGLTFTextureInfo;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[];
<mask> bindShapeMatrix: number[]; <mask> inverseBindMatrices: string; <mask> jointNames: string[]; <mask> <mask> babylonSkeleton?: Skeleton; <mask> } <mask> <mask> export interface IGLTFNode extends IGLTFChildRootProperty { <mask> camera?: string; <mask> children: string[]; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFSkins extends IGLTFChildRootProperty { bindShapeMatrix: number[]; inverseBindMatrices: string; jointNames: string[]; </s> add export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: { [name: string]: number }; indices?: number; material?: number; mode?: EMeshPrimitiveMode; } </s> remove camera?: string; children: string[]; skin?: string; jointName?: string; light?: string; </s> add camera?: number; children?: number[]; skeletons?: number[]; skin?: number; jointName?: number; </s> remove export interface IGLTFNodeInstanceSkin { skeletons: string[]; skin: string; meshes: string[]; </s> add export interface IGLTFMaterial extends IGLTFChildRootProperty { pbrMetallicRoughness?: IGLTFMaterialPbrMetallicRoughness; normalTexture?: IGLTFMaterialNormalTextureInfo; occlusionTexture?: IGLTFMaterialOcclusionTextureInfo; emissiveTexture?: IGLTFTextureInfo; emissiveFactor?: number[]; // Babylon.js values (optimize) babylonMaterial?: PBRMaterial; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove loadedBufferCount: number; loadedBufferViews: { [name: string]: ArrayBufferView }; </s> add babylonSkeleton?: Skeleton; } export interface IGLTFTexture extends IGLTFChildRootProperty { format?: ETextureFormat; internalFormat?: ETextureFormat; sampler: number; source: number; target?: ETextureTarget; type?: ETextureType;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
camera?: number; children?: number[]; skeletons?: number[]; skin?: number; jointName?: number;
<mask> babylonSkeleton?: Skeleton; <mask> } <mask> <mask> export interface IGLTFNode extends IGLTFChildRootProperty { <mask> camera?: string; <mask> children: string[]; <mask> skin?: string; <mask> jointName?: string; <mask> light?: string; <mask> matrix: number[]; <mask> mesh?: string; <mask> meshes?: string[]; <mask> rotation?: number[]; <mask> scale?: number[]; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove mesh?: string; meshes?: string[]; </s> add mesh?: number; </s> remove babylonSkeleton?: Skeleton; </s> add export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> remove export interface IGLTFSkins extends IGLTFChildRootProperty { bindShapeMatrix: number[]; inverseBindMatrices: string; jointNames: string[]; </s> add export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: { [name: string]: number }; indices?: number; material?: number; mode?: EMeshPrimitiveMode; } </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove export interface IGLTFNodeInstanceSkin { skeletons: string[]; skin: string; meshes: string[]; </s> add export interface IGLTFMaterial extends IGLTFChildRootProperty { pbrMetallicRoughness?: IGLTFMaterialPbrMetallicRoughness; normalTexture?: IGLTFMaterialNormalTextureInfo; occlusionTexture?: IGLTFMaterialOcclusionTextureInfo; emissiveTexture?: IGLTFTextureInfo; emissiveFactor?: number[]; // Babylon.js values (optimize) babylonMaterial?: PBRMaterial;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
mesh?: number;
<mask> skin?: string; <mask> jointName?: string; <mask> light?: string; <mask> matrix: number[]; <mask> mesh?: string; <mask> meshes?: string[]; <mask> rotation?: number[]; <mask> scale?: number[]; <mask> translation?: number[]; <mask> <mask> // Babylon.js values (optimize) </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove camera?: string; children: string[]; skin?: string; jointName?: string; light?: string; </s> add camera?: number; children?: number[]; skeletons?: number[]; skin?: number; jointName?: number; </s> remove export interface IGLTFAmbienLight { color?: number[]; </s> add export interface IGLTFAssetProfile extends IGLTFProperty { api?: string; version?: string; </s> remove export interface IGLTFNodeInstanceSkin { skeletons: string[]; skin: string; meshes: string[]; </s> add export interface IGLTFMaterial extends IGLTFChildRootProperty { pbrMetallicRoughness?: IGLTFMaterialPbrMetallicRoughness; normalTexture?: IGLTFMaterialNormalTextureInfo; occlusionTexture?: IGLTFMaterialOcclusionTextureInfo; emissiveTexture?: IGLTFTextureInfo; emissiveFactor?: number[]; // Babylon.js values (optimize) babylonMaterial?: PBRMaterial; </s> remove export interface IGLTFTexture extends IGLTFChildRootProperty { sampler: string; source: string; format?: ETextureFormat; internalFormat?: ETextureFormat; target?: number; type?: number; // Babylon.js values (optimize) babylonTexture?: Texture; </s> add export interface IGLTFAnimation extends IGLTFChildRootProperty { channels?: IGLTFAnimationChannel[]; samplers?: IGLTFAnimationSampler[]; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget;
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFSampler extends IGLTFChildRootProperty { magFilter?: ETextureMagFilter; minFilter?: ETextureMinFilter; wrapS?: ETextureWrapMode; wrapT?: ETextureWrapMode; }
<mask> babylonNode?: Node; <mask> } <mask> <mask> export interface IGLTFScene extends IGLTFChildRootProperty { <mask> nodes: number[]; <mask> } <mask> </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove nodes: string[]; </s> add nodes: number[]; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove /** * Runtime */ export interface IGLTFRuntime { extensions: Object; accessors: Object; buffers: Object; bufferViews: Object; meshes: Object; lights: Object; cameras: Object; nodes: Object; images: Object; textures: Object; shaders: Object; programs: Object; samplers: Object; techniques: Object; materials: Object; animations: Object; skins: Object; currentScene?: Object; scenes: Object; // v1.1 extensionsUsed: string[]; extensionsRequired?: string[]; // v1.1 buffersCount: number; shaderscount: number; scene: Scene; rootUrl: string; </s> add export interface IGLTFSkin extends IGLTFChildRootProperty { bindShapeMatrix?: number[]; inverseBindMatrices?: number; jointNames: number[]; </s> remove export interface IGLTFDirectionalLight { color?: number[]; </s> add export interface IGLTFAsset extends IGLTFChildRootProperty { copyright?: string; generator?: string; profile?: IGLTFAssetProfile; version: string; </s> remove export interface IGLTFPointLight { color?: number[]; constantAttenuation?: number; linearAttenuation?: number; quadraticAttenuation?: number; } </s> add export interface IGLTFBuffer extends IGLTFChildRootProperty { uri?: string; byteLength: number;
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
nodes: number[];
<mask> babylonNode?: Node; <mask> } <mask> <mask> export interface IGLTFScene extends IGLTFChildRootProperty { <mask> nodes: string[]; <mask> } <mask> <mask> /** <mask> * Runtime <mask> */ </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove /** * Runtime */ export interface IGLTFRuntime { extensions: Object; accessors: Object; buffers: Object; bufferViews: Object; meshes: Object; lights: Object; cameras: Object; nodes: Object; images: Object; textures: Object; shaders: Object; programs: Object; samplers: Object; techniques: Object; materials: Object; animations: Object; skins: Object; currentScene?: Object; scenes: Object; // v1.1 extensionsUsed: string[]; extensionsRequired?: string[]; // v1.1 buffersCount: number; shaderscount: number; scene: Scene; rootUrl: string; </s> add export interface IGLTFSkin extends IGLTFChildRootProperty { bindShapeMatrix?: number[]; inverseBindMatrices?: number; jointNames: number[]; </s> remove export interface IGLTFSkins extends IGLTFChildRootProperty { bindShapeMatrix: number[]; inverseBindMatrices: string; jointNames: string[]; </s> add export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: { [name: string]: number }; indices?: number; material?: number; mode?: EMeshPrimitiveMode; } </s> remove babylonSkeleton?: Skeleton; </s> add export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
export interface IGLTFSkin extends IGLTFChildRootProperty { bindShapeMatrix?: number[]; inverseBindMatrices?: number; jointNames: number[];
<mask> export interface IGLTFScene extends IGLTFChildRootProperty { <mask> nodes: string[]; <mask> } <mask> <mask> /** <mask> * Runtime <mask> */ <mask> export interface IGLTFRuntime { <mask> extensions: Object; <mask> accessors: Object; <mask> buffers: Object; <mask> bufferViews: Object; <mask> meshes: Object; <mask> lights: Object; <mask> cameras: Object; <mask> nodes: Object; <mask> images: Object; <mask> textures: Object; <mask> shaders: Object; <mask> programs: Object; <mask> samplers: Object; <mask> techniques: Object; <mask> materials: Object; <mask> animations: Object; <mask> skins: Object; <mask> <mask> currentScene?: Object; <mask> scenes: Object; // v1.1 <mask> <mask> extensionsUsed: string[]; <mask> extensionsRequired?: string[]; // v1.1 <mask> <mask> buffersCount: number; <mask> shaderscount: number; <mask> <mask> scene: Scene; <mask> rootUrl: string; <mask> <mask> loadedBufferCount: number; <mask> loadedBufferViews: { [name: string]: ArrayBufferView }; <mask> <mask> loadedShaderCount: number; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove export interface IGLTFAnimation extends IGLTFChildRootProperty { channels?: IGLTFAnimationChannel[]; parameters?: Object; samplers?: Object; </s> add export interface IGLTFMaterialPbrMetallicRoughness { baseColorFactor: number[]; baseColorTexture: IGLTFTextureInfo; metallicFactor: number; roughnessFactor: number; metallicRoughnessTexture: IGLTFTextureInfo; </s> remove export interface IGLTFShader extends IGLTFChildRootProperty { uri: string; type: EShaderType; } export interface IGLTFProgram extends IGLTFChildRootProperty { attributes: string[]; fragmentShader: string; vertexShader: string; } export interface IGLTFTechniqueParameter { type: number; count?: number; semantic?: string; node?: string; value?: number|boolean|string|Array<any>; source?: string; babylonValue?: any; } export interface IGLTFTechniqueCommonProfile { lightingModel: string; texcoordBindings: Object; parameters?: Array<any>; } export interface IGLTFTechniqueStatesFunctions { blendColor?: number[]; blendEquationSeparate?: number[]; blendFuncSeparate?: number[]; colorMask: boolean[]; cullFace: number[]; } export interface IGLTFTechniqueStates { enable: number[]; functions: IGLTFTechniqueStatesFunctions; } export interface IGLTFTechnique extends IGLTFChildRootProperty { parameters: Object; program: string; attributes: Object; uniforms: Object; states: IGLTFTechniqueStates; } export interface IGLTFMaterial extends IGLTFChildRootProperty { technique?: string; values: string[]; } export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: Object; indices: string; material: string; mode?: number; } export interface IGLTFMesh extends IGLTFChildRootProperty { primitives: IGLTFMeshPrimitive[]; </s> add export interface IGLTFAnimationChannel { sampler: number; target: IGLTFAnimationChannelTarget; </s> remove extras?: Object; </s> add extras?: any; </s> remove export interface IGLTFNodeInstanceSkin { skeletons: string[]; skin: string; meshes: string[]; </s> add export interface IGLTFMaterial extends IGLTFChildRootProperty { pbrMetallicRoughness?: IGLTFMaterialPbrMetallicRoughness; normalTexture?: IGLTFMaterialNormalTextureInfo; occlusionTexture?: IGLTFMaterialOcclusionTextureInfo; emissiveTexture?: IGLTFTextureInfo; emissiveFactor?: number[]; // Babylon.js values (optimize) babylonMaterial?: PBRMaterial; </s> remove export interface IGLTFAnimationSampler { input: string; output: string; interpolation?: string; </s> add export interface IGLTFMaterialOcclusionTextureInfo extends IGLTFTextureInfo { strength: number;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
babylonSkeleton?: Skeleton; } export interface IGLTFTexture extends IGLTFChildRootProperty { format?: ETextureFormat; internalFormat?: ETextureFormat; sampler: number; source: number; target?: ETextureTarget; type?: ETextureType;
<mask> <mask> scene: Scene; <mask> rootUrl: string; <mask> <mask> loadedBufferCount: number; <mask> loadedBufferViews: { [name: string]: ArrayBufferView }; <mask> <mask> loadedShaderCount: number; <mask> <mask> importOnlyMeshes: boolean; <mask> importMeshesNames?: string[]; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove loadedShaderCount: number; </s> add // Babylon.js values (optimize) babylonTexture?: Texture; } export interface IGLTFTextureInfo { index: number; texCoord?: number; } export interface IGLTF extends IGLTFProperty { accessors?: IGLTFAccessor[]; animations?: IGLTFAnimation[]; asset: IGLTFAsset; buffers?: IGLTFBuffer[]; bufferViews?: IGLTFBufferView[]; cameras?: IGLTFCamera[]; extensionsUsed?: string[]; extensionsRequired?: string[]; glExtensionsUsed?: string[]; images?: IGLTFImage[]; materials?: IGLTFMaterial[]; meshes?: IGLTFMesh[]; nodes?: IGLTFNode[]; samplers?: IGLTFSampler[]; scene?: number; scenes?: IGLTFScene[]; skins?: IGLTFSkin[]; textures?: IGLTFTexture[]; } export interface IGLTFRuntime { gltf: IGLTF; babylonScene: Scene; rootUrl: string; </s> remove /** * Runtime */ export interface IGLTFRuntime { extensions: Object; accessors: Object; buffers: Object; bufferViews: Object; meshes: Object; lights: Object; cameras: Object; nodes: Object; images: Object; textures: Object; shaders: Object; programs: Object; samplers: Object; techniques: Object; materials: Object; animations: Object; skins: Object; currentScene?: Object; scenes: Object; // v1.1 extensionsUsed: string[]; extensionsRequired?: string[]; // v1.1 buffersCount: number; shaderscount: number; scene: Scene; rootUrl: string; </s> add export interface IGLTFSkin extends IGLTFChildRootProperty { bindShapeMatrix?: number[]; inverseBindMatrices?: number; jointNames: number[]; </s> remove export interface IGLTFSkins extends IGLTFChildRootProperty { bindShapeMatrix: number[]; inverseBindMatrices: string; jointNames: string[]; </s> add export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: { [name: string]: number }; indices?: number; material?: number; mode?: EMeshPrimitiveMode; } </s> remove byteStride: number; </s> add byteStride?: number; componentType: EComponentType; normalized?: boolean; </s> remove camera?: string; children: string[]; skin?: string; jointName?: string; light?: string; </s> add camera?: number; children?: number[]; skeletons?: number[]; skin?: number; jointName?: number;
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
// Babylon.js values (optimize) babylonTexture?: Texture; } export interface IGLTFTextureInfo { index: number; texCoord?: number; } export interface IGLTF extends IGLTFProperty { accessors?: IGLTFAccessor[]; animations?: IGLTFAnimation[]; asset: IGLTFAsset; buffers?: IGLTFBuffer[]; bufferViews?: IGLTFBufferView[]; cameras?: IGLTFCamera[]; extensionsUsed?: string[]; extensionsRequired?: string[]; glExtensionsUsed?: string[]; images?: IGLTFImage[]; materials?: IGLTFMaterial[]; meshes?: IGLTFMesh[]; nodes?: IGLTFNode[]; samplers?: IGLTFSampler[]; scene?: number; scenes?: IGLTFScene[]; skins?: IGLTFSkin[]; textures?: IGLTFTexture[]; } export interface IGLTFRuntime { gltf: IGLTF; babylonScene: Scene; rootUrl: string;
<mask> <mask> loadedBufferCount: number; <mask> loadedBufferViews: { [name: string]: ArrayBufferView }; <mask> <mask> loadedShaderCount: number; <mask> <mask> importOnlyMeshes: boolean; <mask> importMeshesNames?: string[]; <mask> <mask> dummyNodes: Node[]; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove loadedBufferCount: number; loadedBufferViews: { [name: string]: ArrayBufferView }; </s> add babylonSkeleton?: Skeleton; } export interface IGLTFTexture extends IGLTFChildRootProperty { format?: ETextureFormat; internalFormat?: ETextureFormat; sampler: number; source: number; target?: ETextureTarget; type?: ETextureType; </s> remove /** * Runtime */ export interface IGLTFRuntime { extensions: Object; accessors: Object; buffers: Object; bufferViews: Object; meshes: Object; lights: Object; cameras: Object; nodes: Object; images: Object; textures: Object; shaders: Object; programs: Object; samplers: Object; techniques: Object; materials: Object; animations: Object; skins: Object; currentScene?: Object; scenes: Object; // v1.1 extensionsUsed: string[]; extensionsRequired?: string[]; // v1.1 buffersCount: number; shaderscount: number; scene: Scene; rootUrl: string; </s> add export interface IGLTFSkin extends IGLTFChildRootProperty { bindShapeMatrix?: number[]; inverseBindMatrices?: number; jointNames: number[]; </s> remove export interface IGLTFSkins extends IGLTFChildRootProperty { bindShapeMatrix: number[]; inverseBindMatrices: string; jointNames: string[]; </s> add export interface IGLTFMeshPrimitive extends IGLTFProperty { attributes: { [name: string]: number }; indices?: number; material?: number; mode?: EMeshPrimitiveMode; } </s> remove byteStride: number; </s> add byteStride?: number; componentType: EComponentType; normalized?: boolean; </s> remove export interface IGLTFSpotLight { color?: number[]; constantAttenuation?: number; fallOfAngle?: number; fallOffExponent?: number; linearAttenuation?: number; quadraticAttenuation?: number; </s> add // Loaded buffer (optimize) loadedBufferView: ArrayBufferView
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderInterfaces.ts
<mask> /** <mask> * Utils functions for GLTF <mask> */ <mask> export class GLTFUtils { <mask> /** <mask> * Sets the given "parameter" matrix <mask> * @param scene: the {BABYLON.Scene} object <mask> * @param source: the source node where to pick the matrix <mask> * @param parameter: the GLTF technique parameter <mask> * @param uniformName: the name of the shader's uniform <mask> * @param shaderMaterial: the shader material <mask> */ <mask> public static SetMatrix(scene: Scene, source: Node, parameter: IGLTFTechniqueParameter, uniformName: string, shaderMaterial: ShaderMaterial | Effect): void { <mask> var mat: Matrix = null; <mask> <mask> if (parameter.semantic === "MODEL") { <mask> mat = source.getWorldMatrix(); <mask> } <mask> else if (parameter.semantic === "PROJECTION") { <mask> mat = scene.getProjectionMatrix(); <mask> } <mask> else if (parameter.semantic === "VIEW") { <mask> mat = scene.getViewMatrix(); <mask> } <mask> else if (parameter.semantic === "MODELVIEWINVERSETRANSPOSE") { <mask> mat = Matrix.Transpose(source.getWorldMatrix().multiply(scene.getViewMatrix()).invert()); <mask> } <mask> else if (parameter.semantic === "MODELVIEW") { <mask> mat = source.getWorldMatrix().multiply(scene.getViewMatrix()); <mask> } <mask> else if (parameter.semantic === "MODELVIEWPROJECTION") { <mask> mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()); <mask> } <mask> else if (parameter.semantic === "MODELINVERSE") { <mask> mat = source.getWorldMatrix().invert(); <mask> } <mask> else if (parameter.semantic === "VIEWINVERSE") { <mask> mat = scene.getViewMatrix().invert(); <mask> } <mask> else if (parameter.semantic === "PROJECTIONINVERSE") { <mask> mat = scene.getProjectionMatrix().invert(); <mask> } <mask> else if (parameter.semantic === "MODELVIEWINVERSE") { <mask> mat = source.getWorldMatrix().multiply(scene.getViewMatrix()).invert(); <mask> } <mask> else if (parameter.semantic === "MODELVIEWPROJECTIONINVERSE") { <mask> mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()).invert(); <mask> } <mask> else if (parameter.semantic === "MODELINVERSETRANSPOSE") { <mask> mat = Matrix.Transpose(source.getWorldMatrix().invert()); <mask> } <mask> else { <mask> debugger; <mask> } <mask> <mask> switch (parameter.type) { <mask> case EParameterType.FLOAT_MAT2: shaderMaterial.setMatrix2x2(uniformName, Matrix.GetAsMatrix2x2(mat)); break; <mask> case EParameterType.FLOAT_MAT3: shaderMaterial.setMatrix3x3(uniformName, Matrix.GetAsMatrix3x3(mat)); break; <mask> case EParameterType.FLOAT_MAT4: shaderMaterial.setMatrix(uniformName, mat); break; <mask> default: break; <mask> } <mask> } <mask> <mask> /** <mask> * Sets the given "parameter" matrix <mask> * @param shaderMaterial: the shader material <mask> * @param uniform: the name of the shader's uniform <mask> * @param value: the value of the uniform <mask> * @param type: the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4) <mask> */ <mask> public static SetUniform(shaderMaterial: ShaderMaterial | Effect, uniform: string, value: any, type: number): boolean { <mask> switch (type) { <mask> case EParameterType.FLOAT: shaderMaterial.setFloat(uniform, value); return true; <mask> case EParameterType.FLOAT_VEC2: shaderMaterial.setVector2(uniform, Vector2.FromArray(value)); return true; <mask> case EParameterType.FLOAT_VEC3: shaderMaterial.setVector3(uniform, Vector3.FromArray(value)); return true; <mask> case EParameterType.FLOAT_VEC4: shaderMaterial.setVector4(uniform, Vector4.FromArray(value)); return true; <mask> default: return false; <mask> } <mask> } <mask> <mask> /** <mask> * If the uri is a base64 string <mask> * @param uri: the uri to test <mask> */ <mask> public static IsBase64(uri: string): boolean { </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove * Returns the default material of gltf. Related to * https://github.com/KhronosGroup/glTF/tree/master/specification/1.0#appendix-a-default-material </s> add * Returns the default material of gltf. </s> remove public static GetTextureFilterMode(mode: number): ETextureFilterType { </s> add public static GetTextureFilterMode(mode: number): ETextureMinFilter { </s> remove * @param gltfRuntime: the GLTF runtime </s> add * @param runtime: the GLTF runtime </s> remove case ETextureFilterType.LINEAR: case ETextureFilterType.LINEAR_MIPMAP_NEAREST: case ETextureFilterType.LINEAR_MIPMAP_LINEAR: return Texture.TRILINEAR_SAMPLINGMODE; case ETextureFilterType.NEAREST: case ETextureFilterType.NEAREST_MIPMAP_NEAREST: return Texture.NEAREST_SAMPLINGMODE; </s> add case ETextureMinFilter.LINEAR: case ETextureMinFilter.LINEAR_MIPMAP_NEAREST: case ETextureMinFilter.LINEAR_MIPMAP_LINEAR: return Texture.TRILINEAR_SAMPLINGMODE; case ETextureMinFilter.NEAREST: case ETextureMinFilter.NEAREST_MIPMAP_NEAREST: return Texture.NEAREST_SAMPLINGMODE; </s> remove } } } /** * glTF File Loader Plugin */ export class GLTFFileLoader implements ISceneLoaderPluginAsync { /** * Public members */ public extensions: ISceneLoaderPluginExtensions = { ".gltf": { isBinary: false }, ".glb": { isBinary: true } }; /** * Private members */ // None /** * Static members */ public static HomogeneousCoordinates: boolean = false; public static IncrementalLoading: boolean = true; public static Extensions: { [name: string]: GLTFFileLoaderExtension } = {}; </s> add }, onError);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderUtils.ts
public static GetTextureFilterMode(mode: number): ETextureMinFilter {
<mask> /** <mask> * Returns the texture filter mode giving a mode value <mask> * @param mode: the filter mode value <mask> */ <mask> public static GetTextureFilterMode(mode: number): ETextureFilterType { <mask> switch (mode) { <mask> case ETextureFilterType.LINEAR: <mask> case ETextureFilterType.LINEAR_MIPMAP_NEAREST: <mask> case ETextureFilterType.LINEAR_MIPMAP_LINEAR: return Texture.TRILINEAR_SAMPLINGMODE; <mask> case ETextureFilterType.NEAREST: </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove case ETextureFilterType.LINEAR: case ETextureFilterType.LINEAR_MIPMAP_NEAREST: case ETextureFilterType.LINEAR_MIPMAP_LINEAR: return Texture.TRILINEAR_SAMPLINGMODE; case ETextureFilterType.NEAREST: case ETextureFilterType.NEAREST_MIPMAP_NEAREST: return Texture.NEAREST_SAMPLINGMODE; </s> add case ETextureMinFilter.LINEAR: case ETextureMinFilter.LINEAR_MIPMAP_NEAREST: case ETextureMinFilter.LINEAR_MIPMAP_LINEAR: return Texture.TRILINEAR_SAMPLINGMODE; case ETextureMinFilter.NEAREST: case ETextureMinFilter.NEAREST_MIPMAP_NEAREST: return Texture.NEAREST_SAMPLINGMODE; </s> remove /** * Sets the given "parameter" matrix * @param scene: the {BABYLON.Scene} object * @param source: the source node where to pick the matrix * @param parameter: the GLTF technique parameter * @param uniformName: the name of the shader's uniform * @param shaderMaterial: the shader material */ public static SetMatrix(scene: Scene, source: Node, parameter: IGLTFTechniqueParameter, uniformName: string, shaderMaterial: ShaderMaterial | Effect): void { var mat: Matrix = null; if (parameter.semantic === "MODEL") { mat = source.getWorldMatrix(); } else if (parameter.semantic === "PROJECTION") { mat = scene.getProjectionMatrix(); } else if (parameter.semantic === "VIEW") { mat = scene.getViewMatrix(); } else if (parameter.semantic === "MODELVIEWINVERSETRANSPOSE") { mat = Matrix.Transpose(source.getWorldMatrix().multiply(scene.getViewMatrix()).invert()); } else if (parameter.semantic === "MODELVIEW") { mat = source.getWorldMatrix().multiply(scene.getViewMatrix()); } else if (parameter.semantic === "MODELVIEWPROJECTION") { mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()); } else if (parameter.semantic === "MODELINVERSE") { mat = source.getWorldMatrix().invert(); } else if (parameter.semantic === "VIEWINVERSE") { mat = scene.getViewMatrix().invert(); } else if (parameter.semantic === "PROJECTIONINVERSE") { mat = scene.getProjectionMatrix().invert(); } else if (parameter.semantic === "MODELVIEWINVERSE") { mat = source.getWorldMatrix().multiply(scene.getViewMatrix()).invert(); } else if (parameter.semantic === "MODELVIEWPROJECTIONINVERSE") { mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()).invert(); } else if (parameter.semantic === "MODELINVERSETRANSPOSE") { mat = Matrix.Transpose(source.getWorldMatrix().invert()); } else { debugger; } switch (parameter.type) { case EParameterType.FLOAT_MAT2: shaderMaterial.setMatrix2x2(uniformName, Matrix.GetAsMatrix2x2(mat)); break; case EParameterType.FLOAT_MAT3: shaderMaterial.setMatrix3x3(uniformName, Matrix.GetAsMatrix3x3(mat)); break; case EParameterType.FLOAT_MAT4: shaderMaterial.setMatrix(uniformName, mat); break; default: break; } } /** * Sets the given "parameter" matrix * @param shaderMaterial: the shader material * @param uniform: the name of the shader's uniform * @param value: the value of the uniform * @param type: the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4) */ public static SetUniform(shaderMaterial: ShaderMaterial | Effect, uniform: string, value: any, type: number): boolean { switch (type) { case EParameterType.FLOAT: shaderMaterial.setFloat(uniform, value); return true; case EParameterType.FLOAT_VEC2: shaderMaterial.setVector2(uniform, Vector2.FromArray(value)); return true; case EParameterType.FLOAT_VEC3: shaderMaterial.setVector3(uniform, Vector3.FromArray(value)); return true; case EParameterType.FLOAT_VEC4: shaderMaterial.setVector4(uniform, Vector4.FromArray(value)); return true; default: return false; } } </s> add </s> remove * @param gltfRuntime: the GLTF runtime </s> add * @param runtime: the GLTF runtime </s> remove public static GetBufferFromAccessor(gltfRuntime: IGLTFRuntime, accessor: IGLTFAccessor): any { var bufferView: IGLTFBufferView = gltfRuntime.bufferViews[accessor.bufferView]; </s> add public static GetBufferFromAccessor(runtime: IGLTFRuntime, accessor: IGLTFAccessor): any { var bufferView = runtime.gltf.bufferViews[accessor.bufferView]; </s> remove * Returns the default material of gltf. Related to * https://github.com/KhronosGroup/glTF/tree/master/specification/1.0#appendix-a-default-material </s> add * Returns the default material of gltf.
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderUtils.ts
case ETextureMinFilter.LINEAR: case ETextureMinFilter.LINEAR_MIPMAP_NEAREST: case ETextureMinFilter.LINEAR_MIPMAP_LINEAR: return Texture.TRILINEAR_SAMPLINGMODE; case ETextureMinFilter.NEAREST: case ETextureMinFilter.NEAREST_MIPMAP_NEAREST: return Texture.NEAREST_SAMPLINGMODE;
<mask> * @param mode: the filter mode value <mask> */ <mask> public static GetTextureFilterMode(mode: number): ETextureFilterType { <mask> switch (mode) { <mask> case ETextureFilterType.LINEAR: <mask> case ETextureFilterType.LINEAR_MIPMAP_NEAREST: <mask> case ETextureFilterType.LINEAR_MIPMAP_LINEAR: return Texture.TRILINEAR_SAMPLINGMODE; <mask> case ETextureFilterType.NEAREST: <mask> case ETextureFilterType.NEAREST_MIPMAP_NEAREST: return Texture.NEAREST_SAMPLINGMODE; <mask> default: return Texture.BILINEAR_SAMPLINGMODE; <mask> } <mask> } <mask> <mask> public static GetBufferFromBufferView(gltfRuntime: IGLTFRuntime, bufferView: IGLTFBufferView, byteOffset: number, byteLength: number, componentType: EComponentType): ArrayBufferView { </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove public static GetTextureFilterMode(mode: number): ETextureFilterType { </s> add public static GetTextureFilterMode(mode: number): ETextureMinFilter { </s> remove public static GetBufferFromBufferView(gltfRuntime: IGLTFRuntime, bufferView: IGLTFBufferView, byteOffset: number, byteLength: number, componentType: EComponentType): ArrayBufferView { </s> add public static GetBufferFromBufferView(runtime: IGLTFRuntime, bufferView: IGLTFBufferView, byteOffset: number, byteLength: number, componentType: EComponentType): ArrayBufferView { </s> remove /** * Sets the given "parameter" matrix * @param scene: the {BABYLON.Scene} object * @param source: the source node where to pick the matrix * @param parameter: the GLTF technique parameter * @param uniformName: the name of the shader's uniform * @param shaderMaterial: the shader material */ public static SetMatrix(scene: Scene, source: Node, parameter: IGLTFTechniqueParameter, uniformName: string, shaderMaterial: ShaderMaterial | Effect): void { var mat: Matrix = null; if (parameter.semantic === "MODEL") { mat = source.getWorldMatrix(); } else if (parameter.semantic === "PROJECTION") { mat = scene.getProjectionMatrix(); } else if (parameter.semantic === "VIEW") { mat = scene.getViewMatrix(); } else if (parameter.semantic === "MODELVIEWINVERSETRANSPOSE") { mat = Matrix.Transpose(source.getWorldMatrix().multiply(scene.getViewMatrix()).invert()); } else if (parameter.semantic === "MODELVIEW") { mat = source.getWorldMatrix().multiply(scene.getViewMatrix()); } else if (parameter.semantic === "MODELVIEWPROJECTION") { mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()); } else if (parameter.semantic === "MODELINVERSE") { mat = source.getWorldMatrix().invert(); } else if (parameter.semantic === "VIEWINVERSE") { mat = scene.getViewMatrix().invert(); } else if (parameter.semantic === "PROJECTIONINVERSE") { mat = scene.getProjectionMatrix().invert(); } else if (parameter.semantic === "MODELVIEWINVERSE") { mat = source.getWorldMatrix().multiply(scene.getViewMatrix()).invert(); } else if (parameter.semantic === "MODELVIEWPROJECTIONINVERSE") { mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()).invert(); } else if (parameter.semantic === "MODELINVERSETRANSPOSE") { mat = Matrix.Transpose(source.getWorldMatrix().invert()); } else { debugger; } switch (parameter.type) { case EParameterType.FLOAT_MAT2: shaderMaterial.setMatrix2x2(uniformName, Matrix.GetAsMatrix2x2(mat)); break; case EParameterType.FLOAT_MAT3: shaderMaterial.setMatrix3x3(uniformName, Matrix.GetAsMatrix3x3(mat)); break; case EParameterType.FLOAT_MAT4: shaderMaterial.setMatrix(uniformName, mat); break; default: break; } } /** * Sets the given "parameter" matrix * @param shaderMaterial: the shader material * @param uniform: the name of the shader's uniform * @param value: the value of the uniform * @param type: the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4) */ public static SetUniform(shaderMaterial: ShaderMaterial | Effect, uniform: string, value: any, type: number): boolean { switch (type) { case EParameterType.FLOAT: shaderMaterial.setFloat(uniform, value); return true; case EParameterType.FLOAT_VEC2: shaderMaterial.setVector2(uniform, Vector2.FromArray(value)); return true; case EParameterType.FLOAT_VEC3: shaderMaterial.setVector3(uniform, Vector3.FromArray(value)); return true; case EParameterType.FLOAT_VEC4: shaderMaterial.setVector4(uniform, Vector4.FromArray(value)); return true; default: return false; } } </s> add </s> remove var loadedBufferView = gltfRuntime.loadedBufferViews[bufferView.buffer]; </s> add var loadedBufferView = runtime.gltf.buffers[bufferView.buffer].loadedBufferView; </s> remove var buffer: IGLTFBuffer = gltfRuntime.buffers[buf]; if (buffer) { processBuffer.bind(this, buf, buffer)(); } else { Tools.Error("No buffer named: " + buf); } </s> add switch (contentFormat) { case EBinaryContentFormat.JSON: var jsonText = GLTFUtils.DecodeBufferToText(binaryReader.readUint8Array(contentLength)); runtime.gltf = JSON.parse(jsonText); break; default: Tools.Error("Unexpected content format: " + contentFormat); return false;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderUtils.ts
public static GetBufferFromBufferView(runtime: IGLTFRuntime, bufferView: IGLTFBufferView, byteOffset: number, byteLength: number, componentType: EComponentType): ArrayBufferView {
<mask> default: return Texture.BILINEAR_SAMPLINGMODE; <mask> } <mask> } <mask> <mask> public static GetBufferFromBufferView(gltfRuntime: IGLTFRuntime, bufferView: IGLTFBufferView, byteOffset: number, byteLength: number, componentType: EComponentType): ArrayBufferView { <mask> var byteOffset = bufferView.byteOffset + byteOffset; <mask> <mask> var loadedBufferView = gltfRuntime.loadedBufferViews[bufferView.buffer]; <mask> if (byteOffset + byteLength > loadedBufferView.byteLength) { <mask> throw new Error("Buffer access is out of range"); </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove var loadedBufferView = gltfRuntime.loadedBufferViews[bufferView.buffer]; </s> add var loadedBufferView = runtime.gltf.buffers[bufferView.buffer].loadedBufferView; </s> remove case ETextureFilterType.LINEAR: case ETextureFilterType.LINEAR_MIPMAP_NEAREST: case ETextureFilterType.LINEAR_MIPMAP_LINEAR: return Texture.TRILINEAR_SAMPLINGMODE; case ETextureFilterType.NEAREST: case ETextureFilterType.NEAREST_MIPMAP_NEAREST: return Texture.NEAREST_SAMPLINGMODE; </s> add case ETextureMinFilter.LINEAR: case ETextureMinFilter.LINEAR_MIPMAP_NEAREST: case ETextureMinFilter.LINEAR_MIPMAP_LINEAR: return Texture.TRILINEAR_SAMPLINGMODE; case ETextureMinFilter.NEAREST: case ETextureMinFilter.NEAREST_MIPMAP_NEAREST: return Texture.NEAREST_SAMPLINGMODE; </s> remove public static GetBufferFromAccessor(gltfRuntime: IGLTFRuntime, accessor: IGLTFAccessor): any { var bufferView: IGLTFBufferView = gltfRuntime.bufferViews[accessor.bufferView]; </s> add public static GetBufferFromAccessor(runtime: IGLTFRuntime, accessor: IGLTFAccessor): any { var bufferView = runtime.gltf.bufferViews[accessor.bufferView]; </s> remove var buffer: IGLTFBuffer = gltfRuntime.buffers[buf]; if (buffer) { processBuffer.bind(this, buf, buffer)(); } else { Tools.Error("No buffer named: " + buf); } </s> add switch (contentFormat) { case EBinaryContentFormat.JSON: var jsonText = GLTFUtils.DecodeBufferToText(binaryReader.readUint8Array(contentLength)); runtime.gltf = JSON.parse(jsonText); break; default: Tools.Error("Unexpected content format: " + contentFormat); return false; </s> remove var processBuffer = (buf: string, buffer: IGLTFBuffer) => { GLTFFileLoaderExtension.LoadBufferAsync(gltfRuntime, buf, bufferView => { gltfRuntime.loadedBufferCount++; </s> add private _parseBinary(runtime: IGLTFRuntime, data: ArrayBuffer): boolean { var binaryReader = new BinaryReader(data);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderUtils.ts
var loadedBufferView = runtime.gltf.buffers[bufferView.buffer].loadedBufferView;
<mask> <mask> public static GetBufferFromBufferView(gltfRuntime: IGLTFRuntime, bufferView: IGLTFBufferView, byteOffset: number, byteLength: number, componentType: EComponentType): ArrayBufferView { <mask> var byteOffset = bufferView.byteOffset + byteOffset; <mask> <mask> var loadedBufferView = gltfRuntime.loadedBufferViews[bufferView.buffer]; <mask> if (byteOffset + byteLength > loadedBufferView.byteLength) { <mask> throw new Error("Buffer access is out of range"); <mask> } <mask> <mask> var buffer = loadedBufferView.buffer; </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove public static GetBufferFromBufferView(gltfRuntime: IGLTFRuntime, bufferView: IGLTFBufferView, byteOffset: number, byteLength: number, componentType: EComponentType): ArrayBufferView { </s> add public static GetBufferFromBufferView(runtime: IGLTFRuntime, bufferView: IGLTFBufferView, byteOffset: number, byteLength: number, componentType: EComponentType): ArrayBufferView { </s> remove case ETextureFilterType.LINEAR: case ETextureFilterType.LINEAR_MIPMAP_NEAREST: case ETextureFilterType.LINEAR_MIPMAP_LINEAR: return Texture.TRILINEAR_SAMPLINGMODE; case ETextureFilterType.NEAREST: case ETextureFilterType.NEAREST_MIPMAP_NEAREST: return Texture.NEAREST_SAMPLINGMODE; </s> add case ETextureMinFilter.LINEAR: case ETextureMinFilter.LINEAR_MIPMAP_NEAREST: case ETextureMinFilter.LINEAR_MIPMAP_LINEAR: return Texture.TRILINEAR_SAMPLINGMODE; case ETextureMinFilter.NEAREST: case ETextureMinFilter.NEAREST_MIPMAP_NEAREST: return Texture.NEAREST_SAMPLINGMODE; </s> remove public static GetBufferFromAccessor(gltfRuntime: IGLTFRuntime, accessor: IGLTFAccessor): any { var bufferView: IGLTFBufferView = gltfRuntime.bufferViews[accessor.bufferView]; </s> add public static GetBufferFromAccessor(runtime: IGLTFRuntime, accessor: IGLTFAccessor): any { var bufferView = runtime.gltf.bufferViews[accessor.bufferView]; </s> remove return GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, accessor.byteOffset, byteLength, accessor.componentType); </s> add return GLTFUtils.GetBufferFromBufferView(runtime, bufferView, accessor.byteOffset, byteLength, accessor.componentType); </s> remove private _loadShadersAsync(gltfRuntime: IGLTFRuntime, onload: () => void): void { var hasShaders = false; </s> add private _loadBufferAsync(runtime: IGLTFRuntime, index: number, onSuccess: () => void, onError: () => void): void { var buffer = runtime.gltf.buffers[index];
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderUtils.ts
* @param runtime: the GLTF runtime
<mask> } <mask> <mask> /** <mask> * Returns a buffer from its accessor <mask> * @param gltfRuntime: the GLTF runtime <mask> * @param accessor: the GLTF accessor <mask> */ <mask> public static GetBufferFromAccessor(gltfRuntime: IGLTFRuntime, accessor: IGLTFAccessor): any { <mask> var bufferView: IGLTFBufferView = gltfRuntime.bufferViews[accessor.bufferView]; <mask> var byteLength = accessor.count * GLTFUtils.GetByteStrideFromType(accessor); </s> Add glTF 2.0 support - Breaks animation and materials common extension - KHR_technique_webgl still to be added Former-commit-id: fc9089705662f0711b7ee0eb5deb9d58bbd3e12f </s> remove public static GetBufferFromAccessor(gltfRuntime: IGLTFRuntime, accessor: IGLTFAccessor): any { var bufferView: IGLTFBufferView = gltfRuntime.bufferViews[accessor.bufferView]; </s> add public static GetBufferFromAccessor(runtime: IGLTFRuntime, accessor: IGLTFAccessor): any { var bufferView = runtime.gltf.bufferViews[accessor.bufferView]; </s> remove return GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, accessor.byteOffset, byteLength, accessor.componentType); </s> add return GLTFUtils.GetBufferFromBufferView(runtime, bufferView, accessor.byteOffset, byteLength, accessor.componentType); </s> remove /** * Sets the given "parameter" matrix * @param scene: the {BABYLON.Scene} object * @param source: the source node where to pick the matrix * @param parameter: the GLTF technique parameter * @param uniformName: the name of the shader's uniform * @param shaderMaterial: the shader material */ public static SetMatrix(scene: Scene, source: Node, parameter: IGLTFTechniqueParameter, uniformName: string, shaderMaterial: ShaderMaterial | Effect): void { var mat: Matrix = null; if (parameter.semantic === "MODEL") { mat = source.getWorldMatrix(); } else if (parameter.semantic === "PROJECTION") { mat = scene.getProjectionMatrix(); } else if (parameter.semantic === "VIEW") { mat = scene.getViewMatrix(); } else if (parameter.semantic === "MODELVIEWINVERSETRANSPOSE") { mat = Matrix.Transpose(source.getWorldMatrix().multiply(scene.getViewMatrix()).invert()); } else if (parameter.semantic === "MODELVIEW") { mat = source.getWorldMatrix().multiply(scene.getViewMatrix()); } else if (parameter.semantic === "MODELVIEWPROJECTION") { mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()); } else if (parameter.semantic === "MODELINVERSE") { mat = source.getWorldMatrix().invert(); } else if (parameter.semantic === "VIEWINVERSE") { mat = scene.getViewMatrix().invert(); } else if (parameter.semantic === "PROJECTIONINVERSE") { mat = scene.getProjectionMatrix().invert(); } else if (parameter.semantic === "MODELVIEWINVERSE") { mat = source.getWorldMatrix().multiply(scene.getViewMatrix()).invert(); } else if (parameter.semantic === "MODELVIEWPROJECTIONINVERSE") { mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()).invert(); } else if (parameter.semantic === "MODELINVERSETRANSPOSE") { mat = Matrix.Transpose(source.getWorldMatrix().invert()); } else { debugger; } switch (parameter.type) { case EParameterType.FLOAT_MAT2: shaderMaterial.setMatrix2x2(uniformName, Matrix.GetAsMatrix2x2(mat)); break; case EParameterType.FLOAT_MAT3: shaderMaterial.setMatrix3x3(uniformName, Matrix.GetAsMatrix3x3(mat)); break; case EParameterType.FLOAT_MAT4: shaderMaterial.setMatrix(uniformName, mat); break; default: break; } } /** * Sets the given "parameter" matrix * @param shaderMaterial: the shader material * @param uniform: the name of the shader's uniform * @param value: the value of the uniform * @param type: the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4) */ public static SetUniform(shaderMaterial: ShaderMaterial | Effect, uniform: string, value: any, type: number): boolean { switch (type) { case EParameterType.FLOAT: shaderMaterial.setFloat(uniform, value); return true; case EParameterType.FLOAT_VEC2: shaderMaterial.setVector2(uniform, Vector2.FromArray(value)); return true; case EParameterType.FLOAT_VEC3: shaderMaterial.setVector3(uniform, Vector3.FromArray(value)); return true; case EParameterType.FLOAT_VEC4: shaderMaterial.setVector4(uniform, Vector4.FromArray(value)); return true; default: return false; } } </s> add </s> remove * Returns the default material of gltf. Related to * https://github.com/KhronosGroup/glTF/tree/master/specification/1.0#appendix-a-default-material </s> add * Returns the default material of gltf. </s> remove public static GetTextureFilterMode(mode: number): ETextureFilterType { </s> add public static GetTextureFilterMode(mode: number): ETextureMinFilter {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/d4afc541ab07073f0c204f7424af3de593f95be0
loaders/src/glTF/babylon.glTFFileLoaderUtils.ts