assign-size.glsl.ts 719 B

12345678910111213141516171819
  1. export const assign_size = `
  2. #if defined(dSizeType_uniform)
  3. float size = uSize;
  4. #elif defined(dSizeType_attribute)
  5. float size = aSize;
  6. #elif defined(dSizeType_instance)
  7. float size = decodeFloatRGB(readFromTexture(tSize, aInstance, uSizeTexDim).rgb);
  8. #elif defined(dSizeType_group)
  9. float size = decodeFloatRGB(readFromTexture(tSize, group, uSizeTexDim).rgb);
  10. #elif defined(dSizeType_groupInstance)
  11. float size = decodeFloatRGB(readFromTexture(tSize, aInstance * float(uGroupCount) + group, uSizeTexDim).rgb);
  12. #endif
  13. #if defined(dSizeType_instance) || defined(dSizeType_group) || defined(dSizeType_groupInstance)
  14. size /= 100.0; // NOTE factor also set in TypeScript
  15. #endif
  16. size *= uSizeFactor;
  17. `;