mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-02-12 05:05:03 +01:00
The sad truth, baited
- Fix packed uvs from being saturated
This commit is contained in:
parent
3dac11899e
commit
39b2508d02
1 changed files with 4 additions and 2 deletions
|
@ -60,7 +60,9 @@ public class GlyphInstance extends ColoredLitInstance {
|
||||||
float v0 = glyphExtension.flywheel$v0();
|
float v0 = glyphExtension.flywheel$v0();
|
||||||
float v1 = glyphExtension.flywheel$v1();
|
float v1 = glyphExtension.flywheel$v1();
|
||||||
|
|
||||||
packedUs = ((int) DataPacker.packNormU16(u1) << 16) | (int) DataPacker.packNormU16(u0);
|
// Need to make sure at least u0/v0 don't get their sign bit extended in the cast.
|
||||||
packedVs = ((int) DataPacker.packNormU16(v1) << 16) | (int) DataPacker.packNormU16(v0);
|
// It causes u1/v1 to be completely saturated.
|
||||||
|
packedUs = (Short.toUnsignedInt(DataPacker.packNormU16(u1)) << 16) | Short.toUnsignedInt(DataPacker.packNormU16(u0));
|
||||||
|
packedVs = (Short.toUnsignedInt(DataPacker.packNormU16(v1)) << 16) | Short.toUnsignedInt(DataPacker.packNormU16(v0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue