Skip to main content
Version: 5.x

Nodes > Main > UnPack

UnPack

Unpacks one or more floating point values from a single vector of 8 bit values. This is meant to be used alongside a Pack node with matching settings, which can prepare these packed vectors.

This node is useful for passing high precision values from one material to another through a render target. For example, one material could calculate precise height values every frame, and use a Pack node to pack each height as a 32 bit value that gets rendered out as an RGBA pixel. A second material could read this output in through a Render Target texture, and use the Unpack node to convert from RGBA back to floating point.

Note that packing values can cause a slight loss in precision, depending on the input value and Mode being used.

Inputs

NameTypeDescription
Value ( Packed )floatValue to unpack
MinfloatLower bound for first output value
MaxfloatUpper bound for first output value
Min 2floatLower bound for second output value
Max 2floatUpper bound for second output value

Outputs

NameTypeDescription
ValuefloatUnpacked value
Value 2floatSecond unpacked value

Properties

NameTypeDescription
ModedropdownControls how many values will be unpacked, and how many bits will be used for each value. This should match up with the Mode setting on the Pack node that packed the data.
QuantizeboolForces 8 bit quantization on incoming packed values, necessary for maintaining high accuracy on some mobile GPU's. Leave this on in most cases, especially when precision is critical and texture filtering is set to Nearest. Turn off if artifacts appear when using Bilinear filtering.
Remap RangestringThis uneditable field shows the decimal precision of the packing algorithm, useful to know for special cases such as integrating packed values with script.
Was this page helpful?
Yes
No