Rendering Speed: more objects or more scenes?











up vote
0
down vote

favorite












I'm trying to make a game that has three scenes, each with different functions, but they all need the same three.js objects in them.



My question is: in terms of rendering speed, is it better to use three cameras, and just reposition the blocks when I change from one scene to another, or use three scenes which all hold the same types of objects but they are actually different objects and they don't have to be moved?



If you don't understand that, imagine this: I have a scene full of three.js objects shaped like letters, and they spell a paragraph. I want a new paragraph with the same letters, but is it better for the rendering speed to move all the letters around, or flip to a scene that has already been loaded with the same letters, but in the shape of the new paragraph?



I am totally open to alternative ways of accomplishing this task, as long as they are only with JavaScript.



Thank you very much!










share|improve this question


























    up vote
    0
    down vote

    favorite












    I'm trying to make a game that has three scenes, each with different functions, but they all need the same three.js objects in them.



    My question is: in terms of rendering speed, is it better to use three cameras, and just reposition the blocks when I change from one scene to another, or use three scenes which all hold the same types of objects but they are actually different objects and they don't have to be moved?



    If you don't understand that, imagine this: I have a scene full of three.js objects shaped like letters, and they spell a paragraph. I want a new paragraph with the same letters, but is it better for the rendering speed to move all the letters around, or flip to a scene that has already been loaded with the same letters, but in the shape of the new paragraph?



    I am totally open to alternative ways of accomplishing this task, as long as they are only with JavaScript.



    Thank you very much!










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm trying to make a game that has three scenes, each with different functions, but they all need the same three.js objects in them.



      My question is: in terms of rendering speed, is it better to use three cameras, and just reposition the blocks when I change from one scene to another, or use three scenes which all hold the same types of objects but they are actually different objects and they don't have to be moved?



      If you don't understand that, imagine this: I have a scene full of three.js objects shaped like letters, and they spell a paragraph. I want a new paragraph with the same letters, but is it better for the rendering speed to move all the letters around, or flip to a scene that has already been loaded with the same letters, but in the shape of the new paragraph?



      I am totally open to alternative ways of accomplishing this task, as long as they are only with JavaScript.



      Thank you very much!










      share|improve this question













      I'm trying to make a game that has three scenes, each with different functions, but they all need the same three.js objects in them.



      My question is: in terms of rendering speed, is it better to use three cameras, and just reposition the blocks when I change from one scene to another, or use three scenes which all hold the same types of objects but they are actually different objects and they don't have to be moved?



      If you don't understand that, imagine this: I have a scene full of three.js objects shaped like letters, and they spell a paragraph. I want a new paragraph with the same letters, but is it better for the rendering speed to move all the letters around, or flip to a scene that has already been loaded with the same letters, but in the shape of the new paragraph?



      I am totally open to alternative ways of accomplishing this task, as long as they are only with JavaScript.



      Thank you very much!







      javascript object three.js rendering scene






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 19 at 2:52









      J P

      177




      177
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          I believe you're referencing the wrong problem. Two scenes with 50 objects each will render in (relatively) the same amount of time on the GPU. The "rendering speed" you're considering includes scene processing to reposition your letters. So the real problem you're facing is finding a minimal number of operations in order to position your letters from one scene to the next.



          If we make a few assumptions:




          • You don't care about memory

          • You don't care about the time it takes to initially set up the scenes

          • You don't plan on rearranging the letters further than the given scenes


          Then the fastest you can go is to have separate copies of all the objects. You wouldn't need to perform any repositioning, so you would jump directly to the render step.






          share|improve this answer





















          • Thanks! I'll use that approach.
            – J P
            Nov 21 at 14:51










          • One thing i'd add here is to consider the letter Geometry as your shared asset not the Mesh, since for each paragraph you'd have a different Mesh at a different position referencing the same letter (Geometry).
            – pailhead
            Nov 21 at 20:41










          • The notion that adding a Mesh two two different scenes is A Bad Idea™ would become apparent pretty quickly (it's last add wins).
            – TheJim01
            Nov 21 at 21:05











          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',
          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
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53367686%2frendering-speed-more-objects-or-more-scenes%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








          up vote
          2
          down vote



          accepted










          I believe you're referencing the wrong problem. Two scenes with 50 objects each will render in (relatively) the same amount of time on the GPU. The "rendering speed" you're considering includes scene processing to reposition your letters. So the real problem you're facing is finding a minimal number of operations in order to position your letters from one scene to the next.



          If we make a few assumptions:




          • You don't care about memory

          • You don't care about the time it takes to initially set up the scenes

          • You don't plan on rearranging the letters further than the given scenes


          Then the fastest you can go is to have separate copies of all the objects. You wouldn't need to perform any repositioning, so you would jump directly to the render step.






          share|improve this answer





















          • Thanks! I'll use that approach.
            – J P
            Nov 21 at 14:51










          • One thing i'd add here is to consider the letter Geometry as your shared asset not the Mesh, since for each paragraph you'd have a different Mesh at a different position referencing the same letter (Geometry).
            – pailhead
            Nov 21 at 20:41










          • The notion that adding a Mesh two two different scenes is A Bad Idea™ would become apparent pretty quickly (it's last add wins).
            – TheJim01
            Nov 21 at 21:05















          up vote
          2
          down vote



          accepted










          I believe you're referencing the wrong problem. Two scenes with 50 objects each will render in (relatively) the same amount of time on the GPU. The "rendering speed" you're considering includes scene processing to reposition your letters. So the real problem you're facing is finding a minimal number of operations in order to position your letters from one scene to the next.



          If we make a few assumptions:




          • You don't care about memory

          • You don't care about the time it takes to initially set up the scenes

          • You don't plan on rearranging the letters further than the given scenes


          Then the fastest you can go is to have separate copies of all the objects. You wouldn't need to perform any repositioning, so you would jump directly to the render step.






          share|improve this answer





















          • Thanks! I'll use that approach.
            – J P
            Nov 21 at 14:51










          • One thing i'd add here is to consider the letter Geometry as your shared asset not the Mesh, since for each paragraph you'd have a different Mesh at a different position referencing the same letter (Geometry).
            – pailhead
            Nov 21 at 20:41










          • The notion that adding a Mesh two two different scenes is A Bad Idea™ would become apparent pretty quickly (it's last add wins).
            – TheJim01
            Nov 21 at 21:05













          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          I believe you're referencing the wrong problem. Two scenes with 50 objects each will render in (relatively) the same amount of time on the GPU. The "rendering speed" you're considering includes scene processing to reposition your letters. So the real problem you're facing is finding a minimal number of operations in order to position your letters from one scene to the next.



          If we make a few assumptions:




          • You don't care about memory

          • You don't care about the time it takes to initially set up the scenes

          • You don't plan on rearranging the letters further than the given scenes


          Then the fastest you can go is to have separate copies of all the objects. You wouldn't need to perform any repositioning, so you would jump directly to the render step.






          share|improve this answer












          I believe you're referencing the wrong problem. Two scenes with 50 objects each will render in (relatively) the same amount of time on the GPU. The "rendering speed" you're considering includes scene processing to reposition your letters. So the real problem you're facing is finding a minimal number of operations in order to position your letters from one scene to the next.



          If we make a few assumptions:




          • You don't care about memory

          • You don't care about the time it takes to initially set up the scenes

          • You don't plan on rearranging the letters further than the given scenes


          Then the fastest you can go is to have separate copies of all the objects. You wouldn't need to perform any repositioning, so you would jump directly to the render step.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 19 at 15:08









          TheJim01

          2,9791829




          2,9791829












          • Thanks! I'll use that approach.
            – J P
            Nov 21 at 14:51










          • One thing i'd add here is to consider the letter Geometry as your shared asset not the Mesh, since for each paragraph you'd have a different Mesh at a different position referencing the same letter (Geometry).
            – pailhead
            Nov 21 at 20:41










          • The notion that adding a Mesh two two different scenes is A Bad Idea™ would become apparent pretty quickly (it's last add wins).
            – TheJim01
            Nov 21 at 21:05


















          • Thanks! I'll use that approach.
            – J P
            Nov 21 at 14:51










          • One thing i'd add here is to consider the letter Geometry as your shared asset not the Mesh, since for each paragraph you'd have a different Mesh at a different position referencing the same letter (Geometry).
            – pailhead
            Nov 21 at 20:41










          • The notion that adding a Mesh two two different scenes is A Bad Idea™ would become apparent pretty quickly (it's last add wins).
            – TheJim01
            Nov 21 at 21:05
















          Thanks! I'll use that approach.
          – J P
          Nov 21 at 14:51




          Thanks! I'll use that approach.
          – J P
          Nov 21 at 14:51












          One thing i'd add here is to consider the letter Geometry as your shared asset not the Mesh, since for each paragraph you'd have a different Mesh at a different position referencing the same letter (Geometry).
          – pailhead
          Nov 21 at 20:41




          One thing i'd add here is to consider the letter Geometry as your shared asset not the Mesh, since for each paragraph you'd have a different Mesh at a different position referencing the same letter (Geometry).
          – pailhead
          Nov 21 at 20:41












          The notion that adding a Mesh two two different scenes is A Bad Idea™ would become apparent pretty quickly (it's last add wins).
          – TheJim01
          Nov 21 at 21:05




          The notion that adding a Mesh two two different scenes is A Bad Idea™ would become apparent pretty quickly (it's last add wins).
          – TheJim01
          Nov 21 at 21:05


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53367686%2frendering-speed-more-objects-or-more-scenes%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

          Wiesbaden

          Marschland

          Dieringhausen