Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualRastaRunna

Posted 23 August 2013 - 08:59 AM

Clarifying my question a little further. The root of the question really is, what is the best way (with respect to performance and/or best practice) to manage shape vertices in my physics engine. Store them all in local coordinate space (relative to the attached shape body) and then transform to global (or other coordinate spaces) as needed. --OR-- Store them all in global coordinate space and update *each* once, maybe twice(since they'll need to be updated anyways at render, why not do it all up front).

 

The first is definitely a lazy approach, taking advantage of the notion that perhaps some vertices don't even need to be updated per frame, and seems scalable in that not ALL vertices on a given shape are even used (with exception to rendering).

 

The second, while eager, allows parallelization by throwing all vertices and their respective transformations at the GPU which would be really quick, though somewhat wasteful (since some vertices aren't needed in given algorithms). Possibly quicker than sparse computations on the CPU? Additionally, this would clean up my internal code (such as GJK) without messy transformations everywhere.

 

I realize this is probably best determined with some benchmarking / tests and depends on what I'm using it for. Though I'm highly skeptical that no one has run into this question before.


#1RastaRunna

Posted 23 August 2013 - 08:58 AM

Clarifying my question a little further. The root of the question really is, what is the best way (with respect to performance and/or best practice) to manage shape vertices in my physics engine. Store them all in local coordinate space (relative to the attached shape body) and then transform to global (or other coordinate spaces) as needed. --OR-- Store them all in global coordinate space and update once, maybe twice(since they'll need to be updated anyways at render, why not do it all up front).

 

The first is definitely a lazy approach, taking advantage of the notion that perhaps some vertices don't even need to be updated per frame, and seems scalable in that not ALL vertices on a given shape are even used (with exception to rendering).

 

The second, while eager, allows parallelization by throwing all vertices and their respective transformations at the GPU which would be really quick, though somewhat wasteful (since some vertices aren't needed in given algorithms). Possibly quicker than sparse computations on the CPU? Additionally, this would clean up my internal code (such as GJK) without messy transformations everywhere.

 

I realize this is probably best determined with some benchmarking / tests and depends on what I'm using it for. Though I'm highly skeptical that no one has run into this question before.


PARTNERS