This feature in Lens Studio can be found under the
Inspector panel while a mesh is selected under the
If you ever find yourself making a Lens with a heavy mesh which results in a Lens size that is too large, or poorly performing on device, adjusting a mesh vertex attributes help optimize your lens.
Vertex attributes can be packed into fewer or even just in one position attribute in a 3rd party software, later unpack and utilized in Lens Studio. In this case all other attributes can be disabled.
To do this, click on
Change Vertex Attribute Format in the
Inspector panel, an
Attribute Format Convert window will pop up. Attributes available are related to how the mesh was saved in the software used to create the mesh.
Byte: 8 bits.
Unsigned: unsigned integer [0, MAX].
Signed: signed integer [-MAX, MAX].
Integer normalization: remaps integer byte or short attributes to fixed point values in the range [0.0, 1.0](unsigned) or [-1.0, 1.0](signed) using the rough math “normalizedValue = unnormalizedValue / MAX”. Values outside this range are clamped to the min/max.
- Byte - Signed: Signed 8-bit, two's complement integer with a range of -128 to 127.
- Byte - Unsigned: Unsigned 8-bit integer with a range of 0 to 255.
- Byte - SNorm: Signed 8-bit normalized fixed point value with a range of -1.0 to 1.0.
- Byte - UNorm: Unsigned 8-bit normalized fixed point value with a range of 0.0 to 1.0.
- Short - Signed: Signed 16-bit, two's complement integer with a range of -32,768 to 32,767.
- Short - Unsigned: Unsigned 16-bit integer with a range of 0 to 65,535.
- Short - SNorm: Signed 16-bit normalized fixed point value with a range of -1.0 to 1.0.
- Short - UNorm: Unsigned 16-bit normalized fixed point value with a range of 0.0 to 1.0.
- Half Float: 16-bit half precision floating point value, often called “half” or “float16”.
- Float: 32-bit single precision floating point value.
- Disable: Disable vertex attribute. This option is not provided for vertex position.
Attribute Setting Recommendations
In most cases, the smaller the attribute data is the better. Below are some examples for different format users can try:
- Position: Float, Half Float, or try to rearrange your model data so that all positions are within a [-1, 1] range, in that case SNorm can be introduced.
- Normal: Normalized vectors are on the range [-1, 1], SNorm is recommended.
- Tangent: If a normal map is not used, tangent can be disabled.
- Bitangent: If a normal map is not used, bitangent can be disabled.
- Color: In most cases negative colors are not frequently used, 8-bits Byte - UNorm is recommended, if HDR colors are needed, try Half Float.
- Texture0: In most cases, texture coordinates can be stored as SNorm or UNorm, however when using Repeated wrap mode with UV, the texture coordinates are out of range [-1, 1], we recommend using Half Float with cases like that.
Still Looking for help?Visit Support