84
TEXTURE COMPRESSION SHADER STUDY × IN SEONG MIN

H/W accelerated texture compression formats

Embed Size (px)

Citation preview

Page 1: H/W accelerated texture compression formats

TEXTURECOMPRESSION

SHADER STUDY × IN SEONG MIN

Page 2: H/W accelerated texture compression formats

Why?WE SHOULD USE H/W TC

Page 3: H/W accelerated texture compression formats

1SPEED

Page 4: H/W accelerated texture compression formats

2MEMORY

Page 5: H/W accelerated texture compression formats

WHAT?SHOULD BE CONSIDERED WHEN EVALUATING A TC

Page 6: H/W accelerated texture compression formats

1RANDOM ACCESS

Page 7: H/W accelerated texture compression formats

2HIGH DECOMPRESSION SPEED

Page 8: H/W accelerated texture compression formats

3HIGH COMPRESSION RATIO

Page 9: H/W accelerated texture compression formats

4ACCEPTABLE VISUAL QUALITY

Page 10: H/W accelerated texture compression formats

s3tcS3 TEXTURE COMPRESSION

Page 11: H/W accelerated texture compression formats

S3사에서 만들어 1999년 공개한 포맷

Page 12: H/W accelerated texture compression formats

MS가 DX6에서 DXT1이란 이름으로 채용이후 알파채널을 지원하는 DXT2~DXT5가 등장

Page 13: H/W accelerated texture compression formats

DX10에선 BC1~BC3로 이름이 변경됨DXT1 = BC1, DXT2&3 = BC2, DXT4&5 = BC3

Page 14: H/W accelerated texture compression formats

BC1DXT1

Page 15: H/W accelerated texture compression formats

알파 채널 지원 안 함punchthrough 알파는 가능

Page 16: H/W accelerated texture compression formats

512bit

64bit

result

Endpoints

16+16bit

Indices

Table

4x4x2bit

Page 17: H/W accelerated texture compression formats

4bpp = 1/616 x 2 + 2 x 16 = 64bit

Page 18: H/W accelerated texture compression formats

BC2DXT2 & DXT3

Page 19: H/W accelerated texture compression formats

BC1 + 알파값을 픽셀별 4bit로 저장

Page 20: H/W accelerated texture compression formats

8bpp = 1/464 + 16 x 4 = 128bit

Page 21: H/W accelerated texture compression formats

BC3DXT4 & DXT5

Page 22: H/W accelerated texture compression formats

BC1 + 알파값도 BC1 같이 저장알파값 2개를 8bit로 저장하고 8개로 보간, 각 픽셀별 3bit는 인덱스로 사용

Page 23: H/W accelerated texture compression formats

4bit 정밀도로는 부족할 경우 사용

Page 24: H/W accelerated texture compression formats

8bpp = 1/464 + 8 x 2 + 3 x 16 = 128bit

Page 25: H/W accelerated texture compression formats

BC4ATI1/3Dc+

Page 26: H/W accelerated texture compression formats

BC3에서 추가된 부분만 따로

Page 27: H/W accelerated texture compression formats

4bpp = 1/28 x 2 + 3 x 16 = 64bit

Page 28: H/W accelerated texture compression formats

BC5ATI2/3Dc

Page 29: H/W accelerated texture compression formats

ATI에서 개발한 노말맵용 포맷RGB565로는 노말을 표현하기에는 너무 부족함

Page 30: H/W accelerated texture compression formats

BC4를 두 채널로 저장그러므로 크기는 그냥 BC4의 2배

Page 31: H/W accelerated texture compression formats

8bpp = 1/264 x 2 = 128bit

Page 32: H/W accelerated texture compression formats

BC6H

Page 33: H/W accelerated texture compression formats

HDR을 위한 포맷이름의 끝에 H가 붙은 이유이기도 함

Page 34: H/W accelerated texture compression formats

8bpp = 1/6

Page 35: H/W accelerated texture compression formats

BC7

Page 36: H/W accelerated texture compression formats

RGB8 & RGBA8을 지원다시 말하지만 BC1~3는 RGB565이고 BC4~5는 3채널이 아님

Page 37: H/W accelerated texture compression formats

8bpp = 1/3 or 1/4

Page 38: H/W accelerated texture compression formats

etcERICSSION TEXTURE COMPRESSION

Page 39: H/W accelerated texture compression formats

에릭슨사가 만든 모바일용 포맷이후 안드로이드 기기의 표준 포맷이 됨

Page 40: H/W accelerated texture compression formats

모태는 2004년에 발표된 PACKMAN이란 논문이후 개선된 버전인 iPACKMAN이 ETC1이 됨

Page 41: H/W accelerated texture compression formats

PACKMAN

Page 42: H/W accelerated texture compression formats

Base color Per-pixel

Luminance

Final image

+ =

Page 43: H/W accelerated texture compression formats

Base color (12bit)

+

Luminance index (4bit)

Indices Table (16bit)

--

Page 44: H/W accelerated texture compression formats

ETC1iPACKMAN

Page 45: H/W accelerated texture compression formats

PACKMAN x 2PACKMAN의 블록을 서브블록으로 하여 2개를 붙임

Page 46: H/W accelerated texture compression formats

Luminance index를 4bit에서 3bit로 줄임대신에 2비트 여유가 생김!

Page 47: H/W accelerated texture compression formats

색상값을 5+3으로도 저장할 수 있음diff 플래그 설정에 따라 Individual/Differential 모드

Page 48: H/W accelerated texture compression formats

서브블록을 가로로 길게 할 수도 있음flip 플래그 설정에 따라 달라짐

Page 49: H/W accelerated texture compression formats

4bpp = 1/6(12 + 3 + 1 + 2 x 8) x 2 = 64bit

Page 50: H/W accelerated texture compression formats

ETC2

Page 51: H/W accelerated texture compression formats

ETC1은 서브블록당 색을 하나만 사용색차가 심한 블록의 경우 에러율이 급증

Page 52: H/W accelerated texture compression formats

ETC2는 서브블록당 색을 최대 2개까지 사용고로 블록당 최대 4개의 색을 사용할 수 있음

Page 53: H/W accelerated texture compression formats

ETC1은 그라데이션이 이쁘지 않음Luminance table의 pre-define된 데이터 탓

Page 54: H/W accelerated texture compression formats

ETC2는 알파 채널을 지원punchthrough / full alpha 2가지 모드를 지원

Page 55: H/W accelerated texture compression formats

모드가 기존의 2개에 새롭게 3개가 추가됨D모드 & I모드 + T모드 & H모드 & Planar모드

Page 56: H/W accelerated texture compression formats

RAW ETC1ETC2

T MODE

Page 57: H/W accelerated texture compression formats

4bpp = 1/6알파 없이

Page 58: H/W accelerated texture compression formats

EAC

Page 59: H/W accelerated texture compression formats

단일 채널용 포맷정밀도는 8bit

Page 60: H/W accelerated texture compression formats

Base Mul N Indices

8 4 4 48

Page 61: H/W accelerated texture compression formats

Base + (Mul x Luminance)N(4bit)은 luminance table(총 16개)의 인덱스로 사용됨

Page 62: H/W accelerated texture compression formats

4bpp = 1/2EAC 단독일 경우

Page 63: H/W accelerated texture compression formats

8bpp = 1/4ETC2 + EAC로 RGBA를 구성하는 경우

Page 64: H/W accelerated texture compression formats

pvrtcPOWERVR TEXTURE COMPRESSION

Page 65: H/W accelerated texture compression formats

이미지네이션 테크놀리지사가 개발한 포맷비공개인 관계로 정확한 테크 스펙을 알 수 없음

Page 66: H/W accelerated texture compression formats

엄밀히 말하면 블록 단위가 아님근데 얼핏 보면 그냥 블록 단위로 보임

Page 67: H/W accelerated texture compression formats

블록 단위 포맷보다 그라데이션이 부드러움이유는 뒤에서 설명

Page 68: H/W accelerated texture compression formats

Image A

Modulation M

Final imageUpscale 4x4

Upscale 4x4

Image BLinear Blend

Page 69: H/W accelerated texture compression formats

PVRTC4bpp

Page 70: H/W accelerated texture compression formats

POT 텍스처만 지원심지어는 가로/세로 크기가 같아야 함

Page 71: H/W accelerated texture compression formats

R

RGB color

Color A Modulation data (indices)Color B

Mode

ARGB color

G B

R R G B

Page 72: H/W accelerated texture compression formats
Page 73: H/W accelerated texture compression formats

PVRTC2bpp

Page 74: H/W accelerated texture compression formats

R

RGB color

Color A Modulation data (indices)Color B

Mode

ARGB color

G B

R R G B

Mode 0

Mode 1

Page 75: H/W accelerated texture compression formats

PVRTC24bpp

Page 76: H/W accelerated texture compression formats

PVRTC1과는 달리 NPOT 텍스처 지원짝짝짝

Page 77: H/W accelerated texture compression formats

PVRTC1과는 달리 RGB+RGBA를 지원하지 않음이유는 뒤에서 설명

Page 78: H/W accelerated texture compression formats

R

RGB color (Opacity= 1)

Color A Modulation data (indices)Color B

Mode

ARGB color (Opacity= 0)

G B

R R G B

HardOpacity

Page 79: H/W accelerated texture compression formats

CONCLUSION3줄 요약

Page 80: H/W accelerated texture compression formats

포맷 뒤에 숫자가 높은 것이 갑이다물론 하드웨어가 지원해줘야 하지만

Page 81: H/W accelerated texture compression formats

뭘 써야 할지 모른다면 ETCOpenGL 표준임

Page 82: H/W accelerated texture compression formats

지원 안 된다고 못 쓰는 것은 아님다만 혜택이 없어질 뿐

Page 83: H/W accelerated texture compression formats

REFERENCEhttp://sv-journal.org/2014-1/06/en/index.html

Page 84: H/W accelerated texture compression formats

Q&AANY QUESTIONS?