Jump to content
Posted 18 December 2012 - 08:37 AM
Posted 18 December 2012 - 01:42 PM
Posted 18 December 2012 - 04:45 PM
Posted 18 December 2012 - 10:38 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.