Jump to content
Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 18 December 2012 - 08:37 AM
Posted 18 December 2012 - 01:42 PM
Posted 19 December 2012 - 03:52 AM
Posted 21 December 2012 - 04:04 AM
My project is very performance-sensitive, so Gavin's version is difficult to apply.
As you said, one proper way is making one of x/y/z value of a vertex of a triangle NaN value.
In my code, NaN value is specified with std::numeric_limits<float>::signaling_NaN() func.
This is cheap and easy.
Another way is making indices of a triangle (0,0,0) or something non-triangle vertex indices.
Both method are suit to me.
Posted 22 December 2012 - 06:20 AM
I agree with unbird, I wouldn't trust using NaN values. Gavin's approach would be the way to go. It shouldn't be too performance heavy. Just create the index buffer as a dynamic buffer so the API optimizes it for frequent CPU access. And create the vertex buffer as a static buffer if that data is not going to change.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.