Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualThe King2

Posted 27 March 2013 - 12:59 PM

I really have no idea, but as you i would like to here some opinions on this matter as well.

For now i just have bunch of different vectors for each individual type of "entity".

 

This was one of my first thoughts too. But since my entities are composed of a whole lot of components (right now I have 12 implemented), those can theoretically be mixed up entirely, which means that, if I had different vectors for each "type" of entity, I'd have 2^12 of them right now, so this is out of the question. Unless I'd make some presumtions about what components can actually be put together, but this would kill the purpose and make it less modular, right?

 

If i think correctly this will call SetVertex/Pixel shader for every entity? This might have big impact on performance.

 

Well, it really depends on how the D3DXEffect framework handle things internally, but based on what I know, this might be the case. I noticed a significant rise in FPS (bad method to measure, I know) when moving the begin and end-calls out of the loop and having an "ApplyChanges" call before every model render call. This is out of the question based on the fact that every model can have a different effect, but that will be solved once I implement my render queue. This will also solve unnecessary vertex and index buffer changes as well as shader constant changes etc... . But I'll tackle that one another time.


#1The King2

Posted 27 March 2013 - 12:48 PM

I really have no idea, but as you i would like to here some opinions on this matter as well.

For now i just have bunch of different vectors for each individual type of "entity".

 

Since my entities are composed of a whole lot of components (right now I have 12 implemented), those can theoretically be mixed up entirely, which means that, if I had different vectors for each "type" of entity, I'd have 2^12 of them right now, so this is out of the question. Unless I'd make some presumtions about what components can actually be put together, but this would kill the purpose and make it less modular, right?

If i think correctly this will call SetVertex/Pixel shader for every entity? This might have big impact on performance.

 

Well, it really depends on how the D3DXEffect framework handle things internally, but based on what I know, this might be the case. I noticed a significant rise in FPS (bad method to measure, I know) when moving the begin and end-calls out of the loop and having an "ApplyChanges" call before every model render call. This is out of the question based on the fact that every model can have a different effect, but that will be solved once I implement my render queue. This will also solve unnecessary vertex and index buffer changes as well as shader constant changes etc... . But I'll tackle that one another time.


PARTNERS