How to optimize performance using instancing in a scene full of skinned-mesh?












3














I’m working on a web tower defense game based on three.js. Now I’m stuck at optimizing the performance.



My game loads two GLTF models as enemy and tower, both have skinned-mesh. When the player creates a tower or the game spawns an enemy, I use THREE.AnimationUtils.clone to clone the loaded model. Then I add this cloned model to the scene. For animation, I use THREE.AnimationObjectGroup to animate all the enemies.



This results in an average of 370 draw-calls per frame in the performance test with the scene loaded with 45 towers and 70 enemies, which is a nightmare for the game.



I think maybe using instancing can optimize the performance because every tower and enemy share the same model and state in each frame, but only rotation and position are different. But after I studied some examples using instancing, there is no example using instancing with skinned-mesh. (There is a discussion here, but the result here doesn't mention any method with instancing.)



Is there any chance that this can be done with three.js, or some other solution for this situation?



Update



After researched more I found some concepts maybe can help me to implement instancing with skinned-mesh.



Concept



The original post here implement skinned-mesh with instancing in Unity. (It's written in Chinese, I translated the main concept in the following.)



After loaded a skinned-mesh, it has an initial state with all vertices (for clarity, each initial vertex denote as PLT in the following). In any frame of the animation, the final position of PLT (denote as PI) equals to a series of matrix multiplication PI = (M_rootlocal * ... * M_2_3 * M_1_2 * M_bind_1 * PLT) + (M_rootlocal * ... * M_2_3 * M_1_2 * M_bind_2 * PLT) + (...)





  • M_bind_1 is the bone-binding matrix of bone 1.


  • M_m_n means the transformation of bone m relative to it's initial state under the coordinate system of bone n.


For simplify, use M_f_i = M_rootlocal * ... * M_2_3 * M_1_2 * M_bind_i to represent the transformation. M_f_i means bone-binding matrix of bone i after multiplication at frame f, so PI = (M_f_1 * PLT) + (M_f_2 * PLT) + (...) Once we know M_f_i, we can calculate the position of every vertex in frame f.



The process above can be done inside GPU by passing M_f_i which wrap as a texture. (Under the premise that the skinned-mesh needs to animate around 10 animations and less amount of bones, the require memory is about 0.75Mb.). Finally, we can pass different frame number f to each instance to render skinned-mesh with animation in one draw-call.



Implement with three.js



I haven't build an example code yet because I don't know the concept can work on WebGL or not (also I'm not familiar with GLSL), but I think the way to implement it with three.js can done as the following.




  1. Follow here to get M_f_i.

  2. Use THREE.InstancedBufferGeometry and THREE.RawShaderMaterial.


    • In uniforms pass initial geometry, M_f_i and texture.

    • In vertexShader process PI = (M_f_1 * PLT) + (M_f_2 * PLT) + (...).

    • In fragmentShader process texture (I have no idea how to do it).



  3. Pass f and other instance attribute using THREE.InstancedBufferAttribute.


Problem




  • Where is M_f and how to get it by THREE.AnimationClip in step 1?

  • How to index each PLT (vertex in geometry)?

  • How to deal with texture?

  • How to deal with hierarchy Object3D (Object3D.children have THREE.Mesh and THREE.SkinnedMesh at the same time)?


I need someone to tell me this idea works in three.js or not, and how to solve the problem above.



Screenshot of the performance test



Analysis using Chrome dev tool










share|improve this question









New contributor




YanJen Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    3














    I’m working on a web tower defense game based on three.js. Now I’m stuck at optimizing the performance.



    My game loads two GLTF models as enemy and tower, both have skinned-mesh. When the player creates a tower or the game spawns an enemy, I use THREE.AnimationUtils.clone to clone the loaded model. Then I add this cloned model to the scene. For animation, I use THREE.AnimationObjectGroup to animate all the enemies.



    This results in an average of 370 draw-calls per frame in the performance test with the scene loaded with 45 towers and 70 enemies, which is a nightmare for the game.



    I think maybe using instancing can optimize the performance because every tower and enemy share the same model and state in each frame, but only rotation and position are different. But after I studied some examples using instancing, there is no example using instancing with skinned-mesh. (There is a discussion here, but the result here doesn't mention any method with instancing.)



    Is there any chance that this can be done with three.js, or some other solution for this situation?



    Update



    After researched more I found some concepts maybe can help me to implement instancing with skinned-mesh.



    Concept



    The original post here implement skinned-mesh with instancing in Unity. (It's written in Chinese, I translated the main concept in the following.)



    After loaded a skinned-mesh, it has an initial state with all vertices (for clarity, each initial vertex denote as PLT in the following). In any frame of the animation, the final position of PLT (denote as PI) equals to a series of matrix multiplication PI = (M_rootlocal * ... * M_2_3 * M_1_2 * M_bind_1 * PLT) + (M_rootlocal * ... * M_2_3 * M_1_2 * M_bind_2 * PLT) + (...)





    • M_bind_1 is the bone-binding matrix of bone 1.


    • M_m_n means the transformation of bone m relative to it's initial state under the coordinate system of bone n.


    For simplify, use M_f_i = M_rootlocal * ... * M_2_3 * M_1_2 * M_bind_i to represent the transformation. M_f_i means bone-binding matrix of bone i after multiplication at frame f, so PI = (M_f_1 * PLT) + (M_f_2 * PLT) + (...) Once we know M_f_i, we can calculate the position of every vertex in frame f.



    The process above can be done inside GPU by passing M_f_i which wrap as a texture. (Under the premise that the skinned-mesh needs to animate around 10 animations and less amount of bones, the require memory is about 0.75Mb.). Finally, we can pass different frame number f to each instance to render skinned-mesh with animation in one draw-call.



    Implement with three.js



    I haven't build an example code yet because I don't know the concept can work on WebGL or not (also I'm not familiar with GLSL), but I think the way to implement it with three.js can done as the following.




    1. Follow here to get M_f_i.

    2. Use THREE.InstancedBufferGeometry and THREE.RawShaderMaterial.


      • In uniforms pass initial geometry, M_f_i and texture.

      • In vertexShader process PI = (M_f_1 * PLT) + (M_f_2 * PLT) + (...).

      • In fragmentShader process texture (I have no idea how to do it).



    3. Pass f and other instance attribute using THREE.InstancedBufferAttribute.


    Problem




    • Where is M_f and how to get it by THREE.AnimationClip in step 1?

    • How to index each PLT (vertex in geometry)?

    • How to deal with texture?

    • How to deal with hierarchy Object3D (Object3D.children have THREE.Mesh and THREE.SkinnedMesh at the same time)?


    I need someone to tell me this idea works in three.js or not, and how to solve the problem above.



    Screenshot of the performance test



    Analysis using Chrome dev tool










    share|improve this question









    New contributor




    YanJen Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      3












      3








      3







      I’m working on a web tower defense game based on three.js. Now I’m stuck at optimizing the performance.



      My game loads two GLTF models as enemy and tower, both have skinned-mesh. When the player creates a tower or the game spawns an enemy, I use THREE.AnimationUtils.clone to clone the loaded model. Then I add this cloned model to the scene. For animation, I use THREE.AnimationObjectGroup to animate all the enemies.



      This results in an average of 370 draw-calls per frame in the performance test with the scene loaded with 45 towers and 70 enemies, which is a nightmare for the game.



      I think maybe using instancing can optimize the performance because every tower and enemy share the same model and state in each frame, but only rotation and position are different. But after I studied some examples using instancing, there is no example using instancing with skinned-mesh. (There is a discussion here, but the result here doesn't mention any method with instancing.)



      Is there any chance that this can be done with three.js, or some other solution for this situation?



      Update



      After researched more I found some concepts maybe can help me to implement instancing with skinned-mesh.



      Concept



      The original post here implement skinned-mesh with instancing in Unity. (It's written in Chinese, I translated the main concept in the following.)



      After loaded a skinned-mesh, it has an initial state with all vertices (for clarity, each initial vertex denote as PLT in the following). In any frame of the animation, the final position of PLT (denote as PI) equals to a series of matrix multiplication PI = (M_rootlocal * ... * M_2_3 * M_1_2 * M_bind_1 * PLT) + (M_rootlocal * ... * M_2_3 * M_1_2 * M_bind_2 * PLT) + (...)





      • M_bind_1 is the bone-binding matrix of bone 1.


      • M_m_n means the transformation of bone m relative to it's initial state under the coordinate system of bone n.


      For simplify, use M_f_i = M_rootlocal * ... * M_2_3 * M_1_2 * M_bind_i to represent the transformation. M_f_i means bone-binding matrix of bone i after multiplication at frame f, so PI = (M_f_1 * PLT) + (M_f_2 * PLT) + (...) Once we know M_f_i, we can calculate the position of every vertex in frame f.



      The process above can be done inside GPU by passing M_f_i which wrap as a texture. (Under the premise that the skinned-mesh needs to animate around 10 animations and less amount of bones, the require memory is about 0.75Mb.). Finally, we can pass different frame number f to each instance to render skinned-mesh with animation in one draw-call.



      Implement with three.js



      I haven't build an example code yet because I don't know the concept can work on WebGL or not (also I'm not familiar with GLSL), but I think the way to implement it with three.js can done as the following.




      1. Follow here to get M_f_i.

      2. Use THREE.InstancedBufferGeometry and THREE.RawShaderMaterial.


        • In uniforms pass initial geometry, M_f_i and texture.

        • In vertexShader process PI = (M_f_1 * PLT) + (M_f_2 * PLT) + (...).

        • In fragmentShader process texture (I have no idea how to do it).



      3. Pass f and other instance attribute using THREE.InstancedBufferAttribute.


      Problem




      • Where is M_f and how to get it by THREE.AnimationClip in step 1?

      • How to index each PLT (vertex in geometry)?

      • How to deal with texture?

      • How to deal with hierarchy Object3D (Object3D.children have THREE.Mesh and THREE.SkinnedMesh at the same time)?


      I need someone to tell me this idea works in three.js or not, and how to solve the problem above.



      Screenshot of the performance test



      Analysis using Chrome dev tool










      share|improve this question









      New contributor




      YanJen Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I’m working on a web tower defense game based on three.js. Now I’m stuck at optimizing the performance.



      My game loads two GLTF models as enemy and tower, both have skinned-mesh. When the player creates a tower or the game spawns an enemy, I use THREE.AnimationUtils.clone to clone the loaded model. Then I add this cloned model to the scene. For animation, I use THREE.AnimationObjectGroup to animate all the enemies.



      This results in an average of 370 draw-calls per frame in the performance test with the scene loaded with 45 towers and 70 enemies, which is a nightmare for the game.



      I think maybe using instancing can optimize the performance because every tower and enemy share the same model and state in each frame, but only rotation and position are different. But after I studied some examples using instancing, there is no example using instancing with skinned-mesh. (There is a discussion here, but the result here doesn't mention any method with instancing.)



      Is there any chance that this can be done with three.js, or some other solution for this situation?



      Update



      After researched more I found some concepts maybe can help me to implement instancing with skinned-mesh.



      Concept



      The original post here implement skinned-mesh with instancing in Unity. (It's written in Chinese, I translated the main concept in the following.)



      After loaded a skinned-mesh, it has an initial state with all vertices (for clarity, each initial vertex denote as PLT in the following). In any frame of the animation, the final position of PLT (denote as PI) equals to a series of matrix multiplication PI = (M_rootlocal * ... * M_2_3 * M_1_2 * M_bind_1 * PLT) + (M_rootlocal * ... * M_2_3 * M_1_2 * M_bind_2 * PLT) + (...)





      • M_bind_1 is the bone-binding matrix of bone 1.


      • M_m_n means the transformation of bone m relative to it's initial state under the coordinate system of bone n.


      For simplify, use M_f_i = M_rootlocal * ... * M_2_3 * M_1_2 * M_bind_i to represent the transformation. M_f_i means bone-binding matrix of bone i after multiplication at frame f, so PI = (M_f_1 * PLT) + (M_f_2 * PLT) + (...) Once we know M_f_i, we can calculate the position of every vertex in frame f.



      The process above can be done inside GPU by passing M_f_i which wrap as a texture. (Under the premise that the skinned-mesh needs to animate around 10 animations and less amount of bones, the require memory is about 0.75Mb.). Finally, we can pass different frame number f to each instance to render skinned-mesh with animation in one draw-call.



      Implement with three.js



      I haven't build an example code yet because I don't know the concept can work on WebGL or not (also I'm not familiar with GLSL), but I think the way to implement it with three.js can done as the following.




      1. Follow here to get M_f_i.

      2. Use THREE.InstancedBufferGeometry and THREE.RawShaderMaterial.


        • In uniforms pass initial geometry, M_f_i and texture.

        • In vertexShader process PI = (M_f_1 * PLT) + (M_f_2 * PLT) + (...).

        • In fragmentShader process texture (I have no idea how to do it).



      3. Pass f and other instance attribute using THREE.InstancedBufferAttribute.


      Problem




      • Where is M_f and how to get it by THREE.AnimationClip in step 1?

      • How to index each PLT (vertex in geometry)?

      • How to deal with texture?

      • How to deal with hierarchy Object3D (Object3D.children have THREE.Mesh and THREE.SkinnedMesh at the same time)?


      I need someone to tell me this idea works in three.js or not, and how to solve the problem above.



      Screenshot of the performance test



      Analysis using Chrome dev tool







      javascript three.js






      share|improve this question









      New contributor




      YanJen Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      YanJen Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited Dec 28 '18 at 8:38





















      New contributor




      YanJen Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Dec 27 '18 at 15:48









      YanJen Chen

      163




      163




      New contributor




      YanJen Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      YanJen Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      YanJen Chen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I remember there was a Geometry or Mesh Merge function that was really helping me in the past with such a cases. I recommend you search in that direction.



          There are many counterparts to its usage such as loosing the individuality of each 3d object you use but when possible you should use it for static elements like environment objects, in other cases it may be also useful if your individual objects/towers are based on many single 3d objects in the way that they become just one...



          From my experience (could vary a lot depending on each computer and size of 3d viewport) at the end you should never have more than 50 (simple) 3d objects in front of your visible camera area and reuse all materials, geometries, mesh... otherwise you'll end up having a very poor performance as soon as something fun is happening in your game.



          Hope it helps!






          share|improve this answer





















          • Appreciate your reply! I think merge is a good way for environment objects, but it will hard to implement to the dynamic objects such as enemy and tower because their behavior is depends on the user. I have simply the model before using it. The enemy model contains 3 THREE.Bone and 1 THREE.SkinnedMesh. The tower model contains 2 THREE.Mesh, 1 THREE.Bone and 1 THREE.SkinnedMesh. All models have simplified its geometry.
            – YanJen Chen
            Dec 27 '18 at 16:49












          • Why do you need a Bone and a SkinnedMesh in your tower? Shouldn't it simply need 2 Meshes for the base and rotating turret?
            – Marquizzo
            Dec 27 '18 at 22:00










          • There are some animations for the barrel part, which use Bone to control the behaviors. @Marquizzo
            – YanJen Chen
            Dec 27 '18 at 23:08













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          YanJen Chen is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53947554%2fhow-to-optimize-performance-using-instancing-in-a-scene-full-of-skinned-mesh%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          I remember there was a Geometry or Mesh Merge function that was really helping me in the past with such a cases. I recommend you search in that direction.



          There are many counterparts to its usage such as loosing the individuality of each 3d object you use but when possible you should use it for static elements like environment objects, in other cases it may be also useful if your individual objects/towers are based on many single 3d objects in the way that they become just one...



          From my experience (could vary a lot depending on each computer and size of 3d viewport) at the end you should never have more than 50 (simple) 3d objects in front of your visible camera area and reuse all materials, geometries, mesh... otherwise you'll end up having a very poor performance as soon as something fun is happening in your game.



          Hope it helps!






          share|improve this answer





















          • Appreciate your reply! I think merge is a good way for environment objects, but it will hard to implement to the dynamic objects such as enemy and tower because their behavior is depends on the user. I have simply the model before using it. The enemy model contains 3 THREE.Bone and 1 THREE.SkinnedMesh. The tower model contains 2 THREE.Mesh, 1 THREE.Bone and 1 THREE.SkinnedMesh. All models have simplified its geometry.
            – YanJen Chen
            Dec 27 '18 at 16:49












          • Why do you need a Bone and a SkinnedMesh in your tower? Shouldn't it simply need 2 Meshes for the base and rotating turret?
            – Marquizzo
            Dec 27 '18 at 22:00










          • There are some animations for the barrel part, which use Bone to control the behaviors. @Marquizzo
            – YanJen Chen
            Dec 27 '18 at 23:08


















          0














          I remember there was a Geometry or Mesh Merge function that was really helping me in the past with such a cases. I recommend you search in that direction.



          There are many counterparts to its usage such as loosing the individuality of each 3d object you use but when possible you should use it for static elements like environment objects, in other cases it may be also useful if your individual objects/towers are based on many single 3d objects in the way that they become just one...



          From my experience (could vary a lot depending on each computer and size of 3d viewport) at the end you should never have more than 50 (simple) 3d objects in front of your visible camera area and reuse all materials, geometries, mesh... otherwise you'll end up having a very poor performance as soon as something fun is happening in your game.



          Hope it helps!






          share|improve this answer





















          • Appreciate your reply! I think merge is a good way for environment objects, but it will hard to implement to the dynamic objects such as enemy and tower because their behavior is depends on the user. I have simply the model before using it. The enemy model contains 3 THREE.Bone and 1 THREE.SkinnedMesh. The tower model contains 2 THREE.Mesh, 1 THREE.Bone and 1 THREE.SkinnedMesh. All models have simplified its geometry.
            – YanJen Chen
            Dec 27 '18 at 16:49












          • Why do you need a Bone and a SkinnedMesh in your tower? Shouldn't it simply need 2 Meshes for the base and rotating turret?
            – Marquizzo
            Dec 27 '18 at 22:00










          • There are some animations for the barrel part, which use Bone to control the behaviors. @Marquizzo
            – YanJen Chen
            Dec 27 '18 at 23:08
















          0












          0








          0






          I remember there was a Geometry or Mesh Merge function that was really helping me in the past with such a cases. I recommend you search in that direction.



          There are many counterparts to its usage such as loosing the individuality of each 3d object you use but when possible you should use it for static elements like environment objects, in other cases it may be also useful if your individual objects/towers are based on many single 3d objects in the way that they become just one...



          From my experience (could vary a lot depending on each computer and size of 3d viewport) at the end you should never have more than 50 (simple) 3d objects in front of your visible camera area and reuse all materials, geometries, mesh... otherwise you'll end up having a very poor performance as soon as something fun is happening in your game.



          Hope it helps!






          share|improve this answer












          I remember there was a Geometry or Mesh Merge function that was really helping me in the past with such a cases. I recommend you search in that direction.



          There are many counterparts to its usage such as loosing the individuality of each 3d object you use but when possible you should use it for static elements like environment objects, in other cases it may be also useful if your individual objects/towers are based on many single 3d objects in the way that they become just one...



          From my experience (could vary a lot depending on each computer and size of 3d viewport) at the end you should never have more than 50 (simple) 3d objects in front of your visible camera area and reuse all materials, geometries, mesh... otherwise you'll end up having a very poor performance as soon as something fun is happening in your game.



          Hope it helps!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 27 '18 at 16:28









          juagicre

          4391023




          4391023












          • Appreciate your reply! I think merge is a good way for environment objects, but it will hard to implement to the dynamic objects such as enemy and tower because their behavior is depends on the user. I have simply the model before using it. The enemy model contains 3 THREE.Bone and 1 THREE.SkinnedMesh. The tower model contains 2 THREE.Mesh, 1 THREE.Bone and 1 THREE.SkinnedMesh. All models have simplified its geometry.
            – YanJen Chen
            Dec 27 '18 at 16:49












          • Why do you need a Bone and a SkinnedMesh in your tower? Shouldn't it simply need 2 Meshes for the base and rotating turret?
            – Marquizzo
            Dec 27 '18 at 22:00










          • There are some animations for the barrel part, which use Bone to control the behaviors. @Marquizzo
            – YanJen Chen
            Dec 27 '18 at 23:08




















          • Appreciate your reply! I think merge is a good way for environment objects, but it will hard to implement to the dynamic objects such as enemy and tower because their behavior is depends on the user. I have simply the model before using it. The enemy model contains 3 THREE.Bone and 1 THREE.SkinnedMesh. The tower model contains 2 THREE.Mesh, 1 THREE.Bone and 1 THREE.SkinnedMesh. All models have simplified its geometry.
            – YanJen Chen
            Dec 27 '18 at 16:49












          • Why do you need a Bone and a SkinnedMesh in your tower? Shouldn't it simply need 2 Meshes for the base and rotating turret?
            – Marquizzo
            Dec 27 '18 at 22:00










          • There are some animations for the barrel part, which use Bone to control the behaviors. @Marquizzo
            – YanJen Chen
            Dec 27 '18 at 23:08


















          Appreciate your reply! I think merge is a good way for environment objects, but it will hard to implement to the dynamic objects such as enemy and tower because their behavior is depends on the user. I have simply the model before using it. The enemy model contains 3 THREE.Bone and 1 THREE.SkinnedMesh. The tower model contains 2 THREE.Mesh, 1 THREE.Bone and 1 THREE.SkinnedMesh. All models have simplified its geometry.
          – YanJen Chen
          Dec 27 '18 at 16:49






          Appreciate your reply! I think merge is a good way for environment objects, but it will hard to implement to the dynamic objects such as enemy and tower because their behavior is depends on the user. I have simply the model before using it. The enemy model contains 3 THREE.Bone and 1 THREE.SkinnedMesh. The tower model contains 2 THREE.Mesh, 1 THREE.Bone and 1 THREE.SkinnedMesh. All models have simplified its geometry.
          – YanJen Chen
          Dec 27 '18 at 16:49














          Why do you need a Bone and a SkinnedMesh in your tower? Shouldn't it simply need 2 Meshes for the base and rotating turret?
          – Marquizzo
          Dec 27 '18 at 22:00




          Why do you need a Bone and a SkinnedMesh in your tower? Shouldn't it simply need 2 Meshes for the base and rotating turret?
          – Marquizzo
          Dec 27 '18 at 22:00












          There are some animations for the barrel part, which use Bone to control the behaviors. @Marquizzo
          – YanJen Chen
          Dec 27 '18 at 23:08






          There are some animations for the barrel part, which use Bone to control the behaviors. @Marquizzo
          – YanJen Chen
          Dec 27 '18 at 23:08












          YanJen Chen is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          YanJen Chen is a new contributor. Be nice, and check out our Code of Conduct.













          YanJen Chen is a new contributor. Be nice, and check out our Code of Conduct.












          YanJen Chen is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53947554%2fhow-to-optimize-performance-using-instancing-in-a-scene-full-of-skinned-mesh%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          generate and download xml file after input submit (php and mysql) - JPK

          Angular Downloading a file using contenturl with Basic Authentication

          Can't read property showImagePicker of undefined in react native iOS