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!
javascript object three.js rendering scene
add a comment |
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!
javascript object three.js rendering scene
add a comment |
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!
javascript object three.js rendering scene
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
javascript object three.js rendering scene
asked Nov 19 at 2:52
J P
177
177
add a comment |
add a comment |
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.
Thanks! I'll use that approach.
– J P
Nov 21 at 14:51
One thing i'd add here is to consider the letterGeometry
as your shared asset not theMesh
, since for each paragraph you'd have a differentMesh
at a differentposition
referencing the same letter (Geometry
).
– pailhead
Nov 21 at 20:41
The notion that adding aMesh
two two different scenes is A Bad Idea™ would become apparent pretty quickly (it's last add wins).
– TheJim01
Nov 21 at 21:05
add a comment |
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.
Thanks! I'll use that approach.
– J P
Nov 21 at 14:51
One thing i'd add here is to consider the letterGeometry
as your shared asset not theMesh
, since for each paragraph you'd have a differentMesh
at a differentposition
referencing the same letter (Geometry
).
– pailhead
Nov 21 at 20:41
The notion that adding aMesh
two two different scenes is A Bad Idea™ would become apparent pretty quickly (it's last add wins).
– TheJim01
Nov 21 at 21:05
add a comment |
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.
Thanks! I'll use that approach.
– J P
Nov 21 at 14:51
One thing i'd add here is to consider the letterGeometry
as your shared asset not theMesh
, since for each paragraph you'd have a differentMesh
at a differentposition
referencing the same letter (Geometry
).
– pailhead
Nov 21 at 20:41
The notion that adding aMesh
two two different scenes is A Bad Idea™ would become apparent pretty quickly (it's last add wins).
– TheJim01
Nov 21 at 21:05
add a comment |
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.
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.
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 letterGeometry
as your shared asset not theMesh
, since for each paragraph you'd have a differentMesh
at a differentposition
referencing the same letter (Geometry
).
– pailhead
Nov 21 at 20:41
The notion that adding aMesh
two two different scenes is A Bad Idea™ would become apparent pretty quickly (it's last add wins).
– TheJim01
Nov 21 at 21:05
add a comment |
Thanks! I'll use that approach.
– J P
Nov 21 at 14:51
One thing i'd add here is to consider the letterGeometry
as your shared asset not theMesh
, since for each paragraph you'd have a differentMesh
at a differentposition
referencing the same letter (Geometry
).
– pailhead
Nov 21 at 20:41
The notion that adding aMesh
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
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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