SlideShare ist ein Scribd-Unternehmen logo
1 von 9
Downloaden Sie, um offline zu lesen
Compression
           2009.5.10 이창희
     (cagetu79@gmail.com)
무엇을 압축하는가?
•   Vertex
•   Texture
•   Animation
•   ETC
Vertex 압축
• Float(4Byte)를 단위로…

• FixedPoint
 ▫ Icon2008 애니메이션을 위한 최적화 기법
• UBYTE4
 ▫ UBYTE4: 0~255 범위의 unsigned char형 4개
 ▫ UBYTE4N: 0~1 범위의 unsigned char형 4개
Vertex압축(Cont.)
• Texcoord
 ▫ -1.0~1.0의 float값
 ▫ Float2->Short2(4)로 압축(FixedPoint)
• Normal/Tangent/Binormal
 ▫ -1.0~1.0의 float값
 ▫ Float3->UBYTE4N(4)로 압축
    -1.0~1.0의 범위를 0.0~1.0의 범위로 scale필요.
• SkinWeights/SkinJoints
 ▫ Weight(0.0~1.0), Joints(0~x)
 ▫ Float4->UBYTE4N(4), Float4->UBYTE4(4)로 압축
    범위 내에 값이 존재함으로, 따로 변환하지 않는다.
Vertex압축(Cont.)
• Tip
 ▫ 압축 결과 Quality를 눈으로 비교하여, 적절히 적용
   한다.
 ▫ UBYTE4형을 지원하지 않는 그래픽카드의 지원을
   고려해야 한다면, COLOR(DWORD)형을 이용하거
   나 다른 방법을 사용해야 한다.
    Color와 UByte4는 rgba의 순서를 다르게 저장.
    실제 “콜오브듀티4 ”의 오류 중 하나의 예.
Texture
• .dds로 압축
• NormalMap을 압축할 경우, 압축 형식(DXT1, DXT5,
  DXT5nm)에 따라 shader내부에서 Sample을 처리한다.
• http://developer.nvidia.com/object/real-time-normal-
  map-dxt-compression.html
• 2048x2048 Texture
  ▫ TGA: 16.4M-> DXT5: 5.4M(mipmap포함)
Animation
• Icon2008 애니메이션을 위한 최적화 기법
  ▫ Quaternion 압축
  ▫ Key Sample 압축
기타
• HDR
 ▫ 0~255 칼라 이상을 저장하기 위해서, 보통
   A16B16G16R16F에 저장.
 ▫ PixelShader에서 최종색상을 출력할 때, 색상을 ½
   로 나누어서 저장하면, A8R8G8B8 포맷 텍스쳐에
   저장이 가능
Reference
• http://kimsama.egloos.com/1901622
• Nebula3 (April2009-SDK)
• http://gamecode.org

Weitere ähnliche Inhalte

Mehr von changehee lee

Gdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_glGdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_glchangehee lee
 
Smedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphicsSmedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphicschangehee lee
 
Fortugno nick design_and_monetization
Fortugno nick design_and_monetizationFortugno nick design_and_monetization
Fortugno nick design_and_monetizationchangehee lee
 
[Kgc2013] 모바일 엔진 개발기
[Kgc2013] 모바일 엔진 개발기[Kgc2013] 모바일 엔진 개발기
[Kgc2013] 모바일 엔진 개발기changehee lee
 
모바일 엔진 개발기
모바일 엔진 개발기모바일 엔진 개발기
모바일 엔진 개발기changehee lee
 
Mobile crossplatformchallenges siggraph
Mobile crossplatformchallenges siggraphMobile crossplatformchallenges siggraph
Mobile crossplatformchallenges siggraphchangehee lee
 
개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)
개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)
개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)changehee lee
 
개발자여! 스터디를 하자!
개발자여! 스터디를 하자!개발자여! 스터디를 하자!
개발자여! 스터디를 하자!changehee lee
 
[Kgc2012] deferred forward 이창희
[Kgc2012] deferred forward 이창희[Kgc2012] deferred forward 이창희
[Kgc2012] deferred forward 이창희changehee lee
 
Gamificated game developing
Gamificated game developingGamificated game developing
Gamificated game developingchangehee lee
 
Windows to reality getting the most out of direct3 d 10 graphics in your games
Windows to reality   getting the most out of direct3 d 10 graphics in your gamesWindows to reality   getting the most out of direct3 d 10 graphics in your games
Windows to reality getting the most out of direct3 d 10 graphics in your gameschangehee lee
 
Basic ofreflectance kor
Basic ofreflectance korBasic ofreflectance kor
Basic ofreflectance korchangehee lee
 

Mehr von changehee lee (20)

Visual shock vol.2
Visual shock   vol.2Visual shock   vol.2
Visual shock vol.2
 
Shader compilation
Shader compilationShader compilation
Shader compilation
 
Gdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_glGdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_gl
 
Smedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphicsSmedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphics
 
Fortugno nick design_and_monetization
Fortugno nick design_and_monetizationFortugno nick design_and_monetization
Fortugno nick design_and_monetization
 
카툰 렌더링
카툰 렌더링카툰 렌더링
카툰 렌더링
 
[Kgc2013] 모바일 엔진 개발기
[Kgc2013] 모바일 엔진 개발기[Kgc2013] 모바일 엔진 개발기
[Kgc2013] 모바일 엔진 개발기
 
Paper games 2013
Paper games 2013Paper games 2013
Paper games 2013
 
모바일 엔진 개발기
모바일 엔진 개발기모바일 엔진 개발기
모바일 엔진 개발기
 
V8
V8V8
V8
 
Wecanmakeengine
WecanmakeengineWecanmakeengine
Wecanmakeengine
 
Mobile crossplatformchallenges siggraph
Mobile crossplatformchallenges siggraphMobile crossplatformchallenges siggraph
Mobile crossplatformchallenges siggraph
 
개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)
개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)
개발 과정 최적화 하기 내부툴로 더욱 강력한 개발하기 Stephen kennedy _(11시40분_103호)
 
개발자여! 스터디를 하자!
개발자여! 스터디를 하자!개발자여! 스터디를 하자!
개발자여! 스터디를 하자!
 
[Kgc2012] deferred forward 이창희
[Kgc2012] deferred forward 이창희[Kgc2012] deferred forward 이창희
[Kgc2012] deferred forward 이창희
 
Light prepass
Light prepassLight prepass
Light prepass
 
Gamificated game developing
Gamificated game developingGamificated game developing
Gamificated game developing
 
Windows to reality getting the most out of direct3 d 10 graphics in your games
Windows to reality   getting the most out of direct3 d 10 graphics in your gamesWindows to reality   getting the most out of direct3 d 10 graphics in your games
Windows to reality getting the most out of direct3 d 10 graphics in your games
 
Basic ofreflectance kor
Basic ofreflectance korBasic ofreflectance kor
Basic ofreflectance kor
 
C++11(최지웅)
C++11(최지웅)C++11(최지웅)
C++11(최지웅)
 

Comporession

  • 1. Compression 2009.5.10 이창희 (cagetu79@gmail.com)
  • 2. 무엇을 압축하는가? • Vertex • Texture • Animation • ETC
  • 3. Vertex 압축 • Float(4Byte)를 단위로… • FixedPoint ▫ Icon2008 애니메이션을 위한 최적화 기법 • UBYTE4 ▫ UBYTE4: 0~255 범위의 unsigned char형 4개 ▫ UBYTE4N: 0~1 범위의 unsigned char형 4개
  • 4. Vertex압축(Cont.) • Texcoord ▫ -1.0~1.0의 float값 ▫ Float2->Short2(4)로 압축(FixedPoint) • Normal/Tangent/Binormal ▫ -1.0~1.0의 float값 ▫ Float3->UBYTE4N(4)로 압축  -1.0~1.0의 범위를 0.0~1.0의 범위로 scale필요. • SkinWeights/SkinJoints ▫ Weight(0.0~1.0), Joints(0~x) ▫ Float4->UBYTE4N(4), Float4->UBYTE4(4)로 압축  범위 내에 값이 존재함으로, 따로 변환하지 않는다.
  • 5. Vertex압축(Cont.) • Tip ▫ 압축 결과 Quality를 눈으로 비교하여, 적절히 적용 한다. ▫ UBYTE4형을 지원하지 않는 그래픽카드의 지원을 고려해야 한다면, COLOR(DWORD)형을 이용하거 나 다른 방법을 사용해야 한다.  Color와 UByte4는 rgba의 순서를 다르게 저장.  실제 “콜오브듀티4 ”의 오류 중 하나의 예.
  • 6. Texture • .dds로 압축 • NormalMap을 압축할 경우, 압축 형식(DXT1, DXT5, DXT5nm)에 따라 shader내부에서 Sample을 처리한다. • http://developer.nvidia.com/object/real-time-normal- map-dxt-compression.html • 2048x2048 Texture ▫ TGA: 16.4M-> DXT5: 5.4M(mipmap포함)
  • 7. Animation • Icon2008 애니메이션을 위한 최적화 기법 ▫ Quaternion 압축 ▫ Key Sample 압축
  • 8. 기타 • HDR ▫ 0~255 칼라 이상을 저장하기 위해서, 보통 A16B16G16R16F에 저장. ▫ PixelShader에서 최종색상을 출력할 때, 색상을 ½ 로 나누어서 저장하면, A8R8G8B8 포맷 텍스쳐에 저장이 가능
  • 9. Reference • http://kimsama.egloos.com/1901622 • Nebula3 (April2009-SDK) • http://gamecode.org