typed-array-buffer-schema icon indicating copy to clipboard operation
typed-array-buffer-schema copied to clipboard

Feature: Add 16-bit float support?

Open reececomo opened this issue 6 months ago • 0 comments

Hey, thought you/typed-array-buffer-schema may want to eventually add serializing/deserializing half-precision float16s.

We have a float-heavy networked game, and lossy conversion to half floats is mostly negligible, especially on mostly visual quantities. Haven't (yet) noticed any visual pops or extrapolation issues. Did cut our bandwidth down by almost 4x though!

Example buffer conversion logic is here: HalfFloat.ts, where you read/write the value to a buffer as a uint16 - feel free to use/adapt into typed-array-buffer-schema if that's something useful to you!

reececomo avatar Feb 24 '24 15:02 reececomo