Skip to content

Half-float attribute support #15480

@simon-paris

Description

@simon-paris
Description of the problem

It's currently impossible to make a half float attributes work, since the GL buffer type is derived from the JS buffer type, and JS doesn't have a half float buffer type.

I'd like to add a special case to Uint16 and Int16 attributes that causes them to be interpreted as half floats.

var myAttr = new THREE.BufferAttribute(new Uint16Array(whatever), 3);
myAttr.useHalfFloat = true;

Would this be acceptable?

Three.js version
  • All
Browser
  • All of them
OS
  • All of them

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions