A call for Garbage
Moderator: pyramid
-
- Elite
- Posts: 7243
- Joined: Mon Apr 18, 2005 2:40 pm
- Location: LS87, Buenos Aires, República Argentina
-
- Elite
- Posts: 8014
- Joined: Fri Sep 05, 2003 4:03 am
- Location: Montreal
- Contact:
Ah, sorry; what do you mean by 'batches'?
At each rendering frame there could be one or more objects instanced, but not too many, probably. If by batching you mean sending all the vertexes for all the objects as a single array, though, I don't think it should be that much of a deal maker or breaker. We're not talking hundreds of thousands of vertexes here. The abundance I'm thinking of is perhaps a bit more than the craps floating in Privateer; not a piece of crap per cubic meter. Maybe as you arrive to your destination and are flying slow, therefore, there might be as much as one crap object in every 10x10x10 meter cube, average.
At each rendering frame there could be one or more objects instanced, but not too many, probably. If by batching you mean sending all the vertexes for all the objects as a single array, though, I don't think it should be that much of a deal maker or breaker. We're not talking hundreds of thousands of vertexes here. The abundance I'm thinking of is perhaps a bit more than the craps floating in Privateer; not a piece of crap per cubic meter. Maybe as you arrive to your destination and are flying slow, therefore, there might be as much as one crap object in every 10x10x10 meter cube, average.
Latest version of Cinemut Opaque
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
-
- Elite
- Posts: 7243
- Joined: Mon Apr 18, 2005 2:40 pm
- Location: LS87, Buenos Aires, República Argentina
Batches are basic rendering operations.
is a batch.
They imply a dialogue between CPU and GPU that has the potential to overload the CPU, while leaving the GPU idle, if there are too many of them implying to little work for the gPU. That's the case when a batch draws a single garbage item.
And try to estimate the number of garbage items on screen, rather than per volume... that's a much more meaningful number.
Code: Select all
glDrawElements(...);
They imply a dialogue between CPU and GPU that has the potential to overload the CPU, while leaving the GPU idle, if there are too many of them implying to little work for the gPU. That's the case when a batch draws a single garbage item.
And try to estimate the number of garbage items on screen, rather than per volume... that's a much more meaningful number.
-
- Elite
- Posts: 8014
- Joined: Fri Sep 05, 2003 4:03 am
- Location: Montreal
- Contact:
Actually, how many objects per frame are being added to (and deleted from) the screen, would be most meaningful, right? As the CPU only needs to send the object to the GPU at creation time?
Assuming the above is right:
Max distance is when object is 1 pixel in size. These objects are about a foot and a half in size, 50 cm, so, assuming vertical frustrum is, say, 30 degrees, divided by 1024, that's 0.03 degrees per pixel.
tan(.03 deg) =~ 0.0005
50 cm / 0,0005 = 500,000 cm = 5km.
Okay, just to simplify, let's consider a rectangular spawning plane 5 km ahead, about 5 x 3 km. At station arrival speed (speed of sound, say) and with typical in-station density of garbage (1 piece per 1000 m^3), we get:
Speed of sound = 333 m/s
Assuming 66 Hz refresh,
333/666 = 30/6 = 5
The answer is 5
No, just kidding
5 meters x 5000 meters x 3000 meters / 1000 m^3 = ....
= 5 x 5 x 3000 = 25 x 3 x 1000 = 75,000 ... ahem....
I'm starting to see the point of particle systems...
Why didn't I do the math before? I usually do.
Assuming the above is right:
Max distance is when object is 1 pixel in size. These objects are about a foot and a half in size, 50 cm, so, assuming vertical frustrum is, say, 30 degrees, divided by 1024, that's 0.03 degrees per pixel.
tan(.03 deg) =~ 0.0005
50 cm / 0,0005 = 500,000 cm = 5km.
Okay, just to simplify, let's consider a rectangular spawning plane 5 km ahead, about 5 x 3 km. At station arrival speed (speed of sound, say) and with typical in-station density of garbage (1 piece per 1000 m^3), we get:
Speed of sound = 333 m/s
Assuming 66 Hz refresh,
333/666 = 30/6 = 5
The answer is 5
No, just kidding
5 meters x 5000 meters x 3000 meters / 1000 m^3 = ....
= 5 x 5 x 3000 = 25 x 3 x 1000 = 75,000 ... ahem....
I'm starting to see the point of particle systems...
Why didn't I do the math before? I usually do.
Latest version of Cinemut Opaque
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
-
- Elite
- Posts: 7243
- Joined: Mon Apr 18, 2005 2:40 pm
- Location: LS87, Buenos Aires, República Argentina
Actually, it isn't. On-screen, that's the one. That's the minimum amount of particles you must update CPU-side, and the amount of objects to tell the GPU to draw.chuck_starchaser wrote:Actually, how many objects per frame are being added to (and deleted from) the screen, would be most meaningful, right? As the CPU only needs to send the object to the GPU at creation time?
I'm begninning to embrace one of my ideas - one that would preclude true physics behavior, though: implicit coordinates.chuck_starchaser wrote:Why didn't I do the math before? I usually do.
Say... I just give the vertex shader the parameters, and it takes care of placing the objects in space... all 75000 of them... by using a pseudorandom function with some parameters to be able to control animation (like rotation, translation - if any - etc...)
-
- Elite
- Posts: 8014
- Joined: Fri Sep 05, 2003 4:03 am
- Location: Montreal
- Contact:
I didn't know a shader could create vertexes; I thought they could only move them around.
Hmm... or are you talking about having the geometry there already and the shader instancing it with various placements and rotations? That was what I was thinking about originally.
Anyhow, the numbers could be reduced by using a particle system as LOD. Soon as a particle is getting too close it transmutes into a piece of crap. And only the ones near your line of view. If you turn your head, never mind. Hell with it.
Hmm... or are you talking about having the geometry there already and the shader instancing it with various placements and rotations? That was what I was thinking about originally.
Anyhow, the numbers could be reduced by using a particle system as LOD. Soon as a particle is getting too close it transmutes into a piece of crap. And only the ones near your line of view. If you turn your head, never mind. Hell with it.
Last edited by chuck_starchaser on Wed Jan 18, 2006 7:53 pm, edited 1 time in total.
Latest version of Cinemut Opaque
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
-
- Elite
- Posts: 7243
- Joined: Mon Apr 18, 2005 2:40 pm
- Location: LS87, Buenos Aires, República Argentina
That's true, but the CPU needs do nothing.
So... it would create (only once) a vertex buffer with, say, 1000 objects, and call it to create them in batches of a thousand. The GPU does the rest - positioning and everything.
That's called shader instancing. A feature I'm going to try to use for asteroid fields.
So... it would create (only once) a vertex buffer with, say, 1000 objects, and call it to create them in batches of a thousand. The GPU does the rest - positioning and everything.
That's called shader instancing. A feature I'm going to try to use for asteroid fields.
-
- Elite
- Posts: 8014
- Joined: Fri Sep 05, 2003 4:03 am
- Location: Montreal
- Contact:
Now he tells me...klauss wrote: That's called shader instancing. A feature I'm going to try to use for asteroid fields.
Latest version of Cinemut Opaque
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.