Browse Source

Merge pull request #7971 from Drigax/update-EXT_mesh_gpu_instancing-name

Rename KHR_mesh_instancing to EXT_mesh_gpu_instancing.
David Catuhe 5 years ago
parent
commit
2ff999ece8

+ 1 - 0
dist/preview release/what's new.md

@@ -54,6 +54,7 @@
 - Added support for glTF mesh instancing extension ([#7521](https://github.com/BabylonJS/Babylon.js/issues/7521)) ([drigax](https://github.com/Drigax))
 - Added support for glTF mesh instancing extension ([#7521](https://github.com/BabylonJS/Babylon.js/issues/7521)) ([drigax](https://github.com/Drigax))
 - Get the list of cameras retrieved from a gLTF file when loaded through the asset container ([Popov72](https://github.com/Popov72))
 - Get the list of cameras retrieved from a gLTF file when loaded through the asset container ([Popov72](https://github.com/Popov72))
 - Fixed SceneLoader.ImportAnimations. Now targets nodes based on "targetProperty" ([#7931](https://github.com/BabylonJS/Babylon.js/issues/7931)) ([phenry20](https://github.com/phenry20))
 - Fixed SceneLoader.ImportAnimations. Now targets nodes based on "targetProperty" ([#7931](https://github.com/BabylonJS/Babylon.js/issues/7931)) ([phenry20](https://github.com/phenry20))
+- Renamed KHR_mesh_instancing extension to EXT_mesh_gpu_instancing ([#7945](https://github.com/BabylonJS/Babylon.js/issues/7945)) ([drigax](https://github.com/Drigax))
 
 
 ### Navigation
 ### Navigation
 
 

+ 6 - 6
loaders/src/glTF/2.0/Extensions/KHR_mesh_instancing.ts

@@ -8,19 +8,19 @@ import { GLTFLoader, ArrayItem } from "../glTFLoader";
 import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
 import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
 import { INode } from "../glTFLoaderInterfaces";
 import { INode } from "../glTFLoaderInterfaces";
 
 
-const NAME = "KHR_mesh_instancing";
+const NAME = "EXT_mesh_gpu_instancing";
 
 
-interface IKHRMeshInstancing {
+interface IEXTMeshGpuInstancing {
     mesh?: number;
     mesh?: number;
     attributes: { [name: string]: number };
     attributes: { [name: string]: number };
 }
 }
 
 
 /**
 /**
  * [Proposed Specification](https://github.com/KhronosGroup/glTF/pull/1691)
  * [Proposed Specification](https://github.com/KhronosGroup/glTF/pull/1691)
- * [Playground Sample](//TODO)
+ * [Playground Sample](https://playground.babylonjs.com/#QFIGLW#9)
  * !!! Experimental Extension Subject to Changes !!!
  * !!! Experimental Extension Subject to Changes !!!
  */
  */
-export class KHR_mesh_instancing implements IGLTFLoaderExtension {
+export class EXT_mesh_gpu_instancing implements IGLTFLoaderExtension {
     /**
     /**
      * The name of this extension.
      * The name of this extension.
      */
      */
@@ -46,7 +46,7 @@ export class KHR_mesh_instancing implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public loadNodeAsync(context: string, node: INode, assign: (babylonTransformNode: TransformNode) => void): Nullable<Promise<TransformNode>> {
     public loadNodeAsync(context: string, node: INode, assign: (babylonTransformNode: TransformNode) => void): Nullable<Promise<TransformNode>> {
-        return GLTFLoader.LoadExtensionAsync<IKHRMeshInstancing, TransformNode>(context, node, this.name, (extensionContext, extension) => {
+        return GLTFLoader.LoadExtensionAsync<IEXTMeshGpuInstancing, TransformNode>(context, node, this.name, (extensionContext, extension) => {
             return this._loader.loadNodeAsync(`#/nodes/${node.index}`, node, (babylonTransformNode) => {
             return this._loader.loadNodeAsync(`#/nodes/${node.index}`, node, (babylonTransformNode) => {
                 const promises = new Array<Promise<any>>();
                 const promises = new Array<Promise<any>>();
                 let instanceCount: Nullable<number> = null;
                 let instanceCount: Nullable<number> = null;
@@ -109,4 +109,4 @@ export class KHR_mesh_instancing implements IGLTFLoaderExtension {
     }
     }
 }
 }
 
 
-GLTFLoader.RegisterExtension(NAME, (loader) => new KHR_mesh_instancing(loader));
+GLTFLoader.RegisterExtension(NAME, (loader) => new EXT_mesh_gpu_instancing(loader));

+ 1 - 1
loaders/src/glTF/2.0/Extensions/index.ts

@@ -1,4 +1,5 @@
 export * from "./EXT_lights_image_based";
 export * from "./EXT_lights_image_based";
+export * from "./EXT_mesh_gpu_instancing";
 export * from "./KHR_draco_mesh_compression";
 export * from "./KHR_draco_mesh_compression";
 export * from "./KHR_lights_punctual";
 export * from "./KHR_lights_punctual";
 export * from "./KHR_materials_pbrSpecularGlossiness";
 export * from "./KHR_materials_pbrSpecularGlossiness";
@@ -6,7 +7,6 @@ export * from "./KHR_materials_unlit";
 export * from "./KHR_materials_clearcoat";
 export * from "./KHR_materials_clearcoat";
 export * from "./KHR_materials_sheen";
 export * from "./KHR_materials_sheen";
 export * from "./KHR_materials_specular";
 export * from "./KHR_materials_specular";
-export * from "./KHR_mesh_instancing";
 export * from "./KHR_mesh_quantization";
 export * from "./KHR_mesh_quantization";
 export * from "./KHR_texture_basisu";
 export * from "./KHR_texture_basisu";
 export * from "./KHR_texture_transform";
 export * from "./KHR_texture_transform";

BIN
tests/validation/ReferenceImages/gltfExtensionExtMeshGpuInstancingTest.png


+ 5 - 0
tests/validation/config.json

@@ -822,6 +822,11 @@
             "title": "Visibility",
             "title": "Visibility",
             "playgroundId": "#PXC9CF#2",
             "playgroundId": "#PXC9CF#2",
             "referenceImage": "visibility.png"
             "referenceImage": "visibility.png"
+        },
+        {
+            "title": "GLTF Extension EXT_mesh_gpu_instancing",
+            "playgroundId": "#QFIGLW#9",
+            "referenceImage": "gltfExtensionExtMeshGpuInstancingTest.png"
         }
         }
     ]
     ]
 }
 }