Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 06 Mar 2010
Offline Last Active Sep 12 2014 02:49 AM

#5179810 Sorting/structuring renderables and cache locality

Posted by on 12 September 2014 - 02:51 AM

For distance you'll want the second version, however instead of working out the distance stick with the squared distance as it is cheaper to calculate as it doesn't need the square root operation, and does the same job.

You're right and I agree! I'll also go ahead and assume that my thoughts surrounding the sorting approach are at least somewhat on the right track. I'll carefully re-read all the posts before acting.

#5178557 Sorting/structuring renderables and cache locality

Posted by on 06 September 2014 - 11:47 AM

smacks of premature optimization.

Yes! Okay. Thank you for this advice. I'm fully aware that premature optimization is wrong, but last time I wrote a "graphics engine", I spent 1½ years of regretting that I had made a bunch of stupid design mistakes that would be really hard to fix, so this time around I rather overthink than underthink! :)

Also, I'm a dummy. By data redundancy, do you mean that you actually have several instances of the same object in different places for better data locality?