normalize
When true
and componentDatatype
is an integer format, indicate that the components should be mapped to the range 0, 1 (unsigned) or -1, 1 (signed) when they are accessed as floating-point for rendering.
This is commonly used when storing colors using ComponentDatatype.UNSIGNED_BYTE.
attribute.componentDatatype = ComponentDatatype.UNSIGNED_BYTE;
attribute.componentsPerAttribute = 4;
attribute.normalize = true;
attribute.values = new Uint8Array([
Color.floatToByte(color.red),
Color.floatToByte(color.green),
Color.floatToByte(color.blue),
Color.floatToByte(color.alpha)
]);
Content copied to clipboard