Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 Mar 2007
Offline Last Active Jan 13 2015 11:23 AM

Posts I've Made

In Topic: Easy way to test whether you are loading normals correctly?

17 October 2014 - 06:11 AM

Color works well as Ashaman states. Alternatively you could draw a small line segment for each of normal on a mesh.

In Topic: Cache coherence and containers

21 September 2014 - 12:14 PM

We still need more information about how you are using the map to give you a helpful answer.


Do you really need to put the pointers to the vector elements in the map? You are trying to setup the map so that you can iterate over to give the same sequence as the vector. In doing this, you propose to store a pointer to each element, this means that you need to do a pointer dereference for every element in the vector. Can you not simply iterate over the vector and then the map or vice versa? Can the elements in the map not be added to the vector?


You mention cache coherence so I'm assuming this is for performance purposes? Have you got a performance problem that needs resolving? Have you used a profiler to ensure you are 'optimising' the correct part of your program?

In Topic: c++ Performance boost needed

17 September 2014 - 03:03 PM


  1. Yes, operator[] is a little slower, especially if you have exceptions/etc turned on; it checks whether range is valid, etc. However your loop isn't big enough to make a any noticeable difference



operator[] does not does not do bounds checking on a std::vector, the at(size_t) member function does do bounds checking and will throw an out_of_range exception. As for it not being inlined. As for inlining as asked by OP, this would vary from compiler to compiler. operator[] is a trivial function and I doubt the fact it is in a loop would prevent it being inlined. You would have to check the assembly code.


Also it's worth repeating what has already been said, when you are really aiming for performance gains a good profiling tool is an absolute must!

In Topic: Hybrid ortho/perspective view frustum

23 December 2012 - 09:02 AM

Thanks Brother Bob, you're right. I was initially thinking that this would be possible to construct just by modifying the projection matrix. Doing the perspective divide in the vertex shader only on the x, z and w components did the trick! smile.png

In Topic: captcha bypass

06 September 2011 - 04:46 PM

Just some thoughts.
Edit: color blind co-worker says color based chaptcha replacements annoy him, just throwing that out there.

Yes, the last thing you need is a bot beating a human :P