Browse Source

add BC4 images

nb: the bc4/ati1 dds files are actually slightly wrong, seems like nvtt has a bug and endpoints are off by 1 sometimes
main
Andrew Cassidy 7 months ago
parent
commit
dd5ebb7941
  1. 16
      __init__.py
  2. 0
      bc1/3color.dds
  3. 0
      bc1/3color.png
  4. 0
      bc1/3color_black.dds
  5. 0
      bc1/3color_black.png
  6. 0
      bc1/3color_black_unpacked.png
  7. 0
      bc1/3color_unpacked.png
  8. 0
      bc1/greyscale.dds
  9. 0
      bc1/greyscale.png
  10. 0
      bc1/greyscale_unpacked.png
  11. BIN
      bc4/6value.dds
  12. BIN
      bc4/6value.png
  13. BIN
      bc4/8value.dds
  14. BIN
      bc4/8value.png
  15. 0
      blocks.afdesign

16
__init__.py

@ -1,5 +1,6 @@
from PIL import Image
from quicktex.s3tc.bc1 import BC1Block
from quicktex.s3tc.bc4 import BC4Block
from quicktex import RawTexture
import os.path
@ -9,7 +10,7 @@ image_path = os.path.dirname(os.path.realpath(__file__))
class BC1Blocks:
class Entry:
def __init__(self, filename, block):
path = os.path.join(image_path, 'blocks', filename)
path = os.path.join(image_path, 'bc1', filename)
self.image = Image.open(path).convert('RGBA')
self.texture = RawTexture.frombytes(self.image.tobytes('raw', 'RGBA'), *self.image.size)
self.block = block
@ -17,3 +18,16 @@ class BC1Blocks:
greyscale = Entry('greyscale_unpacked.png', BC1Block.frombytes(b'\xFF\xFF\x49\x4A\x78\x78\x78\x78'))
three_color = Entry('3color_unpacked.png', BC1Block.frombytes(b'\xE0\x07\x00\xF8\x29\x29\x29\x29'))
three_color_black = Entry('3color_black_unpacked.png', BC1Block.frombytes(b'\xE0\x07\x00\xF8\x27\x27\x27\x27'))
class BC4Blocks:
class Entry:
def __init__(self, filename, block):
path = os.path.join(image_path, 'bc4', filename)
self.image = Image.open(path).convert('RGBA')
self.texture = RawTexture.frombytes(self.image.tobytes('raw', 'RGBA'), *self.image.size)
self.block = block
six_value = Entry('6value.png', BC4Block(8, 248, [[0, 1, 2, 3]] * 2 + [[4, 5, 6, 7]] * 2))
eight_value = Entry('8value.png', BC4Block(240, 16, [[0, 1, 2, 3]] * 2 + [[4, 5, 6, 7]] * 2))

0
blocks/3color.dds → bc1/3color.dds

0
blocks/3color.png → bc1/3color.png

0
blocks/3color_black.dds → bc1/3color_black.dds

0
blocks/3color_black.png → bc1/3color_black.png

0
blocks/3color_black_unpacked.png → bc1/3color_black_unpacked.png

0
blocks/3color_unpacked.png → bc1/3color_unpacked.png

0
blocks/greyscale.dds → bc1/greyscale.dds

0
blocks/greyscale.png → bc1/greyscale.png

0
blocks/greyscale_unpacked.png → bc1/greyscale_unpacked.png

BIN
bc4/6value.dds (Stored with Git LFS)

size 136

BIN
bc4/6value.png (Stored with Git LFS)

size 513

BIN
bc4/8value.dds (Stored with Git LFS)

size 136

BIN
bc4/8value.png (Stored with Git LFS)

size 509

0
blocks/blocks.afdesign → blocks.afdesign

Loading…
Cancel
Save