Horde3D

Next-Generation Graphics Engine
It is currently 22.11.2024, 12:33

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 20.03.2012, 20:29 
Offline

Joined: 20.03.2012, 20:22
Posts: 1
The name "Horde" implies that this engine was made for scenes with a lot of characters on screen. That is exactly what I need for my project. Let's say I want to render this (the game is called Hitman Bloodmoney from 2006):
Image

There are about 10 distinctive models, repeated randomly to create that crowd. Notice how some models are recycled - for example that guy with the yellow birdhat also walks around without the hat or has a slightly differently colored skin in another case.
Let's say they average to about 5000 low poly characters on screen at a time with about 50 unique model combinations (different skins, different hats) in total. If I create a similar scene in Horde3D (based on the chicago demo), I get really horrible performance since no batching takes place. What can I do to speed things up and render a huge crowd in realtime, just like that 2006 game does without breaking a sweat?

- How do I batch all models into 1 rendercall?
- How do I efficiently batch differently textured models (or ones with a hat) into that same rendercall?
- What are realistic figures that you would expect Horde3D to render this way? Are 5000 objects simply too much for this engine?

PS: I notice there is batching going on in the particle engine - maybe that can be used for this? My models need individual shadows etc. though.


Top
 Profile  
Reply with quote  
PostPosted: 21.03.2012, 10:16 
Offline

Joined: 15.02.2009, 02:13
Posts: 161
Location: Sydney Australia
Hi Pete,

To batch like this you will need to make one mesh all merged and do skining on CPU as theres a limit on shader uniforms for bone matrices (75 for shader model 2).

Alternatively you can encode bone matrices into textures to read out animations in a vertex shader via a sampler lookup but you would need to make a draw instanced call and you cant cull them as easily... Horde doesn't support this out of the box unfortunately.

_________________
-Alex
Website


Top
 Profile  
Reply with quote  
PostPosted: 07.04.2012, 09:45 
Offline

Joined: 22.06.2010, 19:21
Posts: 26
I have a similar question on this. How would you render a lot of dynamic particles? Let's say I want to render this (2048 particles for a swarm visualization):
Image

Each dot in the swarm is a particle, but they move around individually to create other shapes besides spheres and react to user input. Currently, I use a single particle model with a billboard shader as a base and create 2048 instances via h3dAddMeshNode(). This way, every dot is a node that I can manipulate the way I want. However, this is pretty slow to render since no batching occurs. If I used the built in H3DEmitter, I have no problem rendering 2048 dots, but sadly the individual dots can not be moved independently. How can I batch this?


Top
 Profile  
Reply with quote  
PostPosted: 08.04.2012, 03:19 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
One option is to store the positions of each particle in a texture. Each vertex in the mesh would have a unique UV coordinate in this texture.
You can render the mesh in one go, and to move a particular particle, you just have to write a new position into the right texel.


Top
 Profile  
Reply with quote  
PostPosted: 08.04.2012, 11:13 
Offline

Joined: 22.06.2010, 19:21
Posts: 26
DarkAngel wrote:
One option is to store the positions of each particle in a texture. Each vertex in the mesh would have a unique UV coordinate in this texture.
You can render the mesh in one go, and to move a particular particle, you just have to write a new position into the right texel.


Brilliant idea! Thanks! I will try this.


Top
 Profile  
Reply with quote  
PostPosted: 11.04.2012, 16:36 
Offline

Joined: 22.06.2010, 19:21
Posts: 26
I tried this. It's pretty slow though. Here is what I did, maybe I am missing something:

The batch-model itself consists of 2048 quads (=2 polygons) and each vertex is given the following information:
TextureUV (xy)
VertPosition (not actually used for rendering) (xyz)
LookupID [0-2047] (x)

The LookupID is used to look up dynamic data from a texture that I can edit every frame. I use a RGBA32F texture with a size of 2048x2 pixel where all that data fits in nicely. The texture represents:
- Particle position (xyz) & Size (a)
- Colors, FX etc. (xyza)

Is this what you thought of too, DarkAngel? How can I find out what's so hard to render about this?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group