Showing the changes to libraries/render-utils/src/Model.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1691,10 +1691,7 @@ public: · 1690 unmodified lines | |||
| 1691 | } | 1691 | } |
| 1692 | }; | 1692 | }; |
| 1693 | 1693 | ||
| 1694 | 1694 | static void packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10(glm::uvec4& packed, const BlendshapeOffsetUnpacked& unpacked) { | |
| 1695 | using packBlendshapeOffsetTo = void(glm::uvec4& packed, const BlendshapeOffsetUnpacked& unpacked); | ||
| 1696 | |||
| 1697 | void packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10(glm::uvec4& packed, const BlendshapeOffsetUnpacked& unpacked) { | ||
| 1698 | float len = glm::compMax(glm::abs(unpacked.positionOffset)); | 1695 | float len = glm::compMax(glm::abs(unpacked.positionOffset)); |
| 1699 | glm::vec3 normalizedPos(unpacked.positionOffset); | 1696 | glm::vec3 normalizedPos(unpacked.positionOffset); |
| 1700 | if (len > 0.0f) { | 1697 | if (len > 0.0f) { |
| @@ -1711,6 +1708,14 @@ void packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10(glm::uvec4& pac · 10 unmodified lines | |||
| 1711 | ); | 1708 | ); |
| 1712 | } | 1709 | } |
| 1713 | 1710 | ||
| 1711 | static void packBlendshapeOffsets(BlendshapeOffsetUnpacked* unpacked, BlendshapeOffsetPacked* packed, int size) { | ||
| 1712 | for (int i = 0; i < size; ++i) { | ||
| 1713 | packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10((*packed).packedPosNorTan, (*unpacked)); | ||
| 1714 | ++unpacked; | ||
| 1715 | ++packed; | ||
| 1716 | } | ||
| 1717 | } | ||
| 1718 | |||
| 1714 | class Blender : public QRunnable { | 1719 | class Blender : public QRunnable { |
| 1715 | public: | 1720 | public: |
| 1716 | 1721 | ||
| @@ -1795,11 +1800,7 @@ void Blender::run() { · 78 unmodified lines | |||
| 1795 | // convert unpackedBlendshapeOffsets into packedBlendshapeOffsets for the gpu. | 1800 | // convert unpackedBlendshapeOffsets into packedBlendshapeOffsets for the gpu. |
| 1796 | auto unpacked = unpackedBlendshapeOffsets.data(); | 1801 | auto unpacked = unpackedBlendshapeOffsets.data(); |
| 1797 | auto packed = packedBlendshapeOffsets.data() + offset; | 1802 | auto packed = packedBlendshapeOffsets.data() + offset; |
| 1798 | for (int i = 0; i < numVertsInMesh; ++i) { | 1803 | packBlendshapeOffsets(unpacked, packed, numVertsInMesh); |
| 1799 | packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10((*packed).packedPosNorTan, (*unpacked)); | ||
| 1800 | ++unpacked; | ||
| 1801 | ++packed; | ||
| 1802 | } | ||
| 1803 | 1804 | ||
| 1804 | offset += numVertsInMesh; | 1805 | offset += numVertsInMesh; |
| 1805 | } | 1806 | } |