Skip to content

Function: encodePickId() ​

Call Signature ​

ts
function encodePickId(id): Float32Array;

Experimental

Encode a pick id as normalized RGBA floats (0–1), e.g. for a custom pick material's color uniform. Output order is R, G, B, A with R the most significant byte of id + 1.

Parameters ​

ParameterType
idnumber

Returns ​

Float32Array

Throws ​

RangeError if id is not an integer in [0, MAX_PICK_ID].

Call Signature ​

ts
function encodePickId<T>(id, out, offset?): T;

Experimental

Encode a pick id as normalized RGBA floats (0–1), e.g. for a custom pick material's color uniform. Output order is R, G, B, A with R the most significant byte of id + 1.

Type Parameters ​

Type Parameter
T extends number[] | Float32Array<ArrayBufferLike>

Parameters ​

ParameterType
idnumber
outT
offset?number

Returns ​

T

Throws ​

RangeError if id is not an integer in [0, MAX_PICK_ID].

Released under the MIT License.