Using NaN in attributes

No, you should avoid NaN values. The problem is that typed arrays handled NaN values differently. If you pass a NaN value to a Uint8Array(), it is interpreted as 0. If you do the same test with Float32Array, the NaN value is preserved and passed to the shader.

see Edit fiddle - JSFiddle - Code Playground

Besides, NaN values in attributes like position will break certain three.js features like view frustum culling since the engine expects valid numerical data.

1 Like