ConstData.hx 750 B

123456789101112131415161718192021222324
  1. package arm.data;
  2. import kha.graphics4.TextureFormat;
  3. import kha.Blob;
  4. import kha.Image;
  5. import iron.data.Data;
  6. import iron.system.ArmPack;
  7. class ConstData {
  8. #if arm_ltc
  9. public static var ltcMatTex: Image = null;
  10. public static var ltcMagTex: Image = null;
  11. public static function initLTC() {
  12. // Real-Time Polygonal-Light Shading with Linearly Transformed Cosines
  13. // https://eheitzresearch.wordpress.com/415-2/
  14. Data.getBlob("ltc_mat.arm", function(ltc_mat: Blob) {
  15. Data.getBlob("ltc_mag.arm", function(ltc_mag: Blob) {
  16. ltcMatTex = Image.fromBytes(ArmPack.decode(ltc_mat.toBytes()), 64, 64, TextureFormat.RGBA128);
  17. ltcMagTex = Image.fromBytes(ArmPack.decode(ltc_mag.toBytes()), 64, 64, TextureFormat.A32);
  18. });
  19. });
  20. }
  21. #end
  22. }