Utility static class providing functionality to pack float values to various storage
representations.
float2Half converts a JavaScript number to the 16-bit half-float encoding used by
half-precision textures and vertex formats, so float data can be uploaded to the GPU at half the
size.
Example
// Fill a half-float buffer from an array of numbers consthalves = newUint16Array(values.length); for (leti = 0; i < values.length; i++) { halves[i] = FloatPacking.float2Half(values[i]); }
Utility static class providing functionality to pack float values to various storage representations.
float2Half converts a JavaScript number to the 16-bit half-float encoding used by half-precision textures and vertex formats, so float data can be uploaded to the GPU at half the size.
Example