SlideShare une entreprise Scribd logo
1  sur  26
Gamma와
Linear-Color-Space
            이민웅
         Shader Study
http://cafe.naver.com/shader
뭔가 부드럽다… 왜(?)



          간지난다!
sRGB
     • HP, MS에서 지정한 표준 컬러 스페이스, 1996
     • 감마는 2.2
          – 윈도우 sRGB(2.2) 맥 color sync(1.8)
       – HDTV, 모니터, 프린터, 인터넷용
     • 블랙으로는 1, 화이트로는 2.4로 비균일




                                    CIEXYZ 다이어 그램에서 삼각형은 sRGB의 표현영역
                                    CIEXYZ 모두를 표현할 수 있는 디바이스는 없음
Gamma, Color Space의 이해 이장호 - kasa
시각의 특성
• 인간의 시각은 베버의 법칙에 따라 밝기에 대해 비
  선형적으로 반응
• 베버의 법칙
 – 감각기에서 자극의 변화를 느끼기 위해서는 처음 자극
   에 대해 일정 비율 이상으로 자극을 받아야 된다는 법
   칙
• 예를 들면
 – 처음에 약한 자극을 받으면 자극의 변화가 적어도 그
   변화를 인지할 수 있다. 하지만 처음에 강한 자극을 받
   으면 자극의 변화가 커야지 그 변화를 인지할 수 있음
• 즉, 자극 사이의 절대적인 차이가 아닌, 자극 사이
  의 비율이 중요 ( 인간 시각의 비선형성 때문 )
선형 부호화
              • 밝기를 선형적으로 나눈것
              • 0이 검정, 255가 흰색
              • 어두분 부분은 25, 26 차이는 사람이 매우 크게 느낌
                  – ( (26/255 - 25/255)/ (25/255) *100 )
                  – 밝기 차이 비율 : 4%
              • 밝은부분은 200, 201의 차이는 거의 못 느낌
                  – ( (201/255 - 200/255)/ (200/255) *100 )
                  – 밝기 차이 비율 : 0.5%
              • 빛의 밝기를 선형적으로 나누어 부호화하면 어두운
                부분은 사람이 보기에 밝기 변화가 매우 큰 현상이
                나타남
                  – Posterization , contouring(윤곽?), banding(변색?)



Posterization : 분해된 사진의 원판을 써서 연속적인 톤[색조]의 사진 등에서 불연속적인 톤[색조]의 복제를 만드는 기법
네이버 백과사전 (포스터라이제이션)
선형으로 부호화를 하게 되면,
밝은 부분에서는 시각이 지각할 수
없는 쓸모 없는 데이터가 많아지고,
어두운 부분에서는 데이터가 부족해서
화질이 떨어지게 됩니다
•   채널 당 8 bit와 같이 한정된 정보양 안에               비선형적으로 부호화
    서 선형적으로 빛의 밝기를 기록하                      다음 그래프의 파란색 부분을 보
    면, 사람의 눈이 민감하게 반응하는 '어                  면 입력값(tristimulus value)
    두운 부분'의 경우 밝기가 변할 때 부드                  0~0.018은 이 함수를 거치면
    럽게 느껴지지 않고 단절되어 보이는 현                   0~0.081 사이의 값이 됩니다.
    상(posterization, contouring, banding)   즉, 어두운 부분의 경우 세밀하게
    이 발생합니다. 따라서, 주어진 정보양                   나누어 기록합니다. 이에 반해 입
    의 한계 안에서 최적의 화질을 보여주기
                                            력값 0.92~1는 이 함수를 거치면
    위해선 비선형적으로 부호화하여 '어두
    운 부분'의 차이를 세밀하게 기록할 필요                  0.96~1 사이의 값이 됩니다.
    가 있다. Rec. 709 transfer function과 같     즉, 밝은 부분은 큰 차이가 나야
    은 비선형 함수를 사용합니다.                        만 서로 다른 값으로 기록되게 됩
                                            니다
• 비선형적으로 기록한 데이터를 사람에게 보여주
  기 위해서는 보여주는 기기(보통 컴퓨터)에서 다
  음 그림의 녹색 함수와 유사한 함수를 사용하여
  원래의 밝기대로 보여주어야 합니다.
Gamma
• Gamma encoding, Decoding을 의미
  – Gamma = 감마 부호화 = 감마보정
           (Gamma encoding)   (Gamma correction)



• 감마보정의 잘못된 속설
  – 모니터의 출력 특성 때문
  – LCD 모니터들은 CRT가 아니기 때문에 감마 특성
    과 별 관련이 없음
• 감마 보정의 이유
  – 주어진 대역폭 내에서 최대한의 화질을 보여주기
    위해서
Gamma Correction
• gamma가 1.0이 되어야 함을 의미
  1보다 작으면 인코딩(compression)
  1보다 크면 디코딩(expansion)
Gamma Space
• 게임에서 쓰는 모든 텍스쳐는 감마가 적용
  된 텍스쳐!
• 디스플레이 출력 시, 올바른 색상을 표현하
  기 위해서, 1 / 2.2로 감마를 상쇄
         감마보정




                CRT감마
Texture는 Gamma Space

Pixel Shader는 Linear Space
Gamma / linear space example

Source image (16 b/ch)        Gamma (contrasted)                    Linear (contrasted)




           Kaplanyan-CryEngine3(SIGGRAPH 2010 Advanced RealTime Rendering Course)
감마 보정




sRGB 읽기                                 sRGB 쓰기



    0.45
                                          2.2
    1/2.2




            Uncharted 2: HDR Lighting
감마 보정
감마 보정




보정전           보정후
감마 보정
  Diffuse 텍스쳐를 가져올 때 감마적용
 float3 diffuseCol = pow( tex2D( diffTex, texCoord ), 2.2 );

   최종 칼라를 리턴할때 감마보정
  return float4( pow(finalCol, 1.0 / 2.2), pixelAlpha);
 sampler2D SamplerColor = sampler_state   하드웨어 사용시
 {                                        Texture : D3DSAMP_SRGBTEXTURE
    …                                     RenderTarget write: D3DRS_SRGBWRITEENABLE
    SRGBTexture=FALSE;
 };

 technique PostProcess
 {
    pass P0
    {
    ….
    SRGBWRITEENABLE=FALSE;
    }
 }

기본적으로 SRGBTexture는 꺼져있음
하드웨어 감마 보정시는 켜야 함
연기, GUI, 총 Glow 볼것
Reference
감마 보정(gamma correction), 감마 인코딩(gamma encoding)의 이해(http://shotgunlee.egloos.com/10607756)
http://www.w3.org/TR/PNG-GammaAppendix.html
http://www.poynton.com/PDFs/Rehabilitation_of_gamma.pdf
http://www.poynton.com/notes/Timo/index.html
위키백과 감마 보정 http://ko.wikipedia.org/wiki/%EA%B0%90%EB%A7%88_%EB%B3%B4%EC%A0%95
위키백과 베버의 법칙 http://ko.wikipedia.org/wiki/%EB%B2%A0%EB%B2%84%EC%9D%98_%EB%B2%95%EC%B9%99
Gamma, Color Space의 이해 – 이장호 – Kasa
GDC2008_PostProcessingInTheOrangeBox
Ndc11 올바른 HDR을 이용한 Bloom과 Dof ㈜소프트네트 이창희
GPU Gems3 chapter24_the_importance_of_being_linear
Hable-Uncharted2(SIGGRAPH 2010 Advanced RealTime Rendering Course)
Uncharted2-Hdr-Lighting
gamma(감마) – 임정환
Picture Perfect - Gamma Through the Rendering Pipeline
Kaplanyan-CryEngine3(SIGGRAPH 2010 Advanced RealTime Rendering Course)

Contenu connexe

Tendances

Cascade Shadow Mapping
Cascade Shadow MappingCascade Shadow Mapping
Cascade Shadow MappingSukwoo Lee
 
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근MinGeun Park
 
A Bit More Deferred Cry Engine3
A Bit More Deferred   Cry Engine3A Bit More Deferred   Cry Engine3
A Bit More Deferred Cry Engine3guest11b095
 
Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Tiago Sousa
 
Rendering Tech of Space Marine
Rendering Tech of Space MarineRendering Tech of Space Marine
Rendering Tech of Space MarinePope Kim
 
Gamma라고 들어봤니
Gamma라고 들어봤니Gamma라고 들어봤니
Gamma라고 들어봤니minwoo lee
 
Moving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based RenderingMoving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based RenderingElectronic Arts / DICE
 
[Ndc11 박민근] deferred shading
[Ndc11 박민근] deferred shading[Ndc11 박민근] deferred shading
[Ndc11 박민근] deferred shadingMinGeun Park
 
CryENGINE 3 Rendering Techniques
CryENGINE 3 Rendering TechniquesCryENGINE 3 Rendering Techniques
CryENGINE 3 Rendering TechniquesTiago Sousa
 
Anti-Aliasing Methods in CryENGINE 3
Anti-Aliasing Methods in CryENGINE 3Anti-Aliasing Methods in CryENGINE 3
Anti-Aliasing Methods in CryENGINE 3Tiago Sousa
 
07_PhysX 강체물리 입문
07_PhysX 강체물리 입문07_PhysX 강체물리 입문
07_PhysX 강체물리 입문noerror
 
Deferred shading
Deferred shadingDeferred shading
Deferred shadingFrank Chao
 
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunFive Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunElectronic Arts / DICE
 
Brdf기반 사전정의 스킨 셰이더
Brdf기반 사전정의 스킨 셰이더Brdf기반 사전정의 스킨 셰이더
Brdf기반 사전정의 스킨 셰이더동석 김
 
PBR 기초 이론과 사용되는 맵들 Vol.3
PBR 기초 이론과 사용되는 맵들 Vol.3PBR 기초 이론과 사용되는 맵들 Vol.3
PBR 기초 이론과 사용되는 맵들 Vol.3Jooyoung Yi
 
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero DawnThe Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero DawnGuerrilla
 

Tendances (20)

Cascade Shadow Mapping
Cascade Shadow MappingCascade Shadow Mapping
Cascade Shadow Mapping
 
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
[Ndc12] 누구나 알기쉬운 hdr과 톤맵핑 박민근
 
DirectX 11 Rendering in Battlefield 3
DirectX 11 Rendering in Battlefield 3DirectX 11 Rendering in Battlefield 3
DirectX 11 Rendering in Battlefield 3
 
A Bit More Deferred Cry Engine3
A Bit More Deferred   Cry Engine3A Bit More Deferred   Cry Engine3
A Bit More Deferred Cry Engine3
 
Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)Rendering Technologies from Crysis 3 (GDC 2013)
Rendering Technologies from Crysis 3 (GDC 2013)
 
Motion blur
Motion blurMotion blur
Motion blur
 
Rendering Tech of Space Marine
Rendering Tech of Space MarineRendering Tech of Space Marine
Rendering Tech of Space Marine
 
Gamma라고 들어봤니
Gamma라고 들어봤니Gamma라고 들어봤니
Gamma라고 들어봤니
 
Moving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based RenderingMoving Frostbite to Physically Based Rendering
Moving Frostbite to Physically Based Rendering
 
[Ndc11 박민근] deferred shading
[Ndc11 박민근] deferred shading[Ndc11 박민근] deferred shading
[Ndc11 박민근] deferred shading
 
CryENGINE 3 Rendering Techniques
CryENGINE 3 Rendering TechniquesCryENGINE 3 Rendering Techniques
CryENGINE 3 Rendering Techniques
 
Anti-Aliasing Methods in CryENGINE 3
Anti-Aliasing Methods in CryENGINE 3Anti-Aliasing Methods in CryENGINE 3
Anti-Aliasing Methods in CryENGINE 3
 
07_PhysX 강체물리 입문
07_PhysX 강체물리 입문07_PhysX 강체물리 입문
07_PhysX 강체물리 입문
 
Light prepass
Light prepassLight prepass
Light prepass
 
Deferred shading
Deferred shadingDeferred shading
Deferred shading
 
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunFive Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
 
Brdf기반 사전정의 스킨 셰이더
Brdf기반 사전정의 스킨 셰이더Brdf기반 사전정의 스킨 셰이더
Brdf기반 사전정의 스킨 셰이더
 
PBR 기초 이론과 사용되는 맵들 Vol.3
PBR 기초 이론과 사용되는 맵들 Vol.3PBR 기초 이론과 사용되는 맵들 Vol.3
PBR 기초 이론과 사용되는 맵들 Vol.3
 
Depth estimation using deep learning
Depth estimation using deep learningDepth estimation using deep learning
Depth estimation using deep learning
 
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero DawnThe Real-time Volumetric Cloudscapes of Horizon Zero Dawn
The Real-time Volumetric Cloudscapes of Horizon Zero Dawn
 

En vedette

UHD HDR "Dance untold story"
UHD HDR "Dance untold story"UHD HDR "Dance untold story"
UHD HDR "Dance untold story"승윤 이
 
Deferred decal
Deferred decalDeferred decal
Deferred decal민웅 이
 
후처리알아보기
후처리알아보기후처리알아보기
후처리알아보기종규 우
 
[Kgc2012] deferred forward 이창희
[Kgc2012] deferred forward 이창희[Kgc2012] deferred forward 이창희
[Kgc2012] deferred forward 이창희changehee lee
 
Light in screen_space(Light Pre Pass)
Light in screen_space(Light Pre Pass)Light in screen_space(Light Pre Pass)
Light in screen_space(Light Pre Pass)민웅 이
 
자동 동적 3차원 입체시각
자동 동적 3차원 입체시각자동 동적 3차원 입체시각
자동 동적 3차원 입체시각민웅 이
 
크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)
크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)
크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)민웅 이
 
1인개발자가되기전알아야할것들
1인개발자가되기전알아야할것들1인개발자가되기전알아야할것들
1인개발자가되기전알아야할것들Jinsub Jung
 
Shadow mapping 정리
Shadow mapping 정리Shadow mapping 정리
Shadow mapping 정리changehee lee
 
Overwatch 기술 분석
Overwatch 기술 분석Overwatch 기술 분석
Overwatch 기술 분석Yong-jun Choi
 
2nd ignite masan 이그나이트마산 09 설미정_ 기부, 기발함과 발칙함사이
2nd ignite masan   이그나이트마산 09 설미정_ 기부, 기발함과 발칙함사이2nd ignite masan   이그나이트마산 09 설미정_ 기부, 기발함과 발칙함사이
2nd ignite masan 이그나이트마산 09 설미정_ 기부, 기발함과 발칙함사이Ignite Masan
 
color theory design work
color theory design workcolor theory design work
color theory design workJisoo Jess Lim
 
스크래치와 역사
스크래치와 역사스크래치와 역사
스크래치와 역사Seung Joon Choi
 
LCD Monitor 선택 가이드와 Gamma의 이해
LCD Monitor 선택 가이드와 Gamma의 이해LCD Monitor 선택 가이드와 Gamma의 이해
LCD Monitor 선택 가이드와 Gamma의 이해SangYun Yi
 
기본 회전 공식
기본 회전 공식 기본 회전 공식
기본 회전 공식 cancan21st
 
2015_색채학_연구주제보고서_현지원
2015_색채학_연구주제보고서_현지원2015_색채학_연구주제보고서_현지원
2015_색채학_연구주제보고서_현지원JiwonHyeon
 

En vedette (20)

UHD HDR "Dance untold story"
UHD HDR "Dance untold story"UHD HDR "Dance untold story"
UHD HDR "Dance untold story"
 
Deferred decal
Deferred decalDeferred decal
Deferred decal
 
후처리알아보기
후처리알아보기후처리알아보기
후처리알아보기
 
[Kgc2012] deferred forward 이창희
[Kgc2012] deferred forward 이창희[Kgc2012] deferred forward 이창희
[Kgc2012] deferred forward 이창희
 
Light in screen_space(Light Pre Pass)
Light in screen_space(Light Pre Pass)Light in screen_space(Light Pre Pass)
Light in screen_space(Light Pre Pass)
 
자동 동적 3차원 입체시각
자동 동적 3차원 입체시각자동 동적 3차원 입체시각
자동 동적 3차원 입체시각
 
크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)
크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)
크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)
 
1인개발자가되기전알아야할것들
1인개발자가되기전알아야할것들1인개발자가되기전알아야할것들
1인개발자가되기전알아야할것들
 
0720ppt
0720ppt0720ppt
0720ppt
 
Shadow mapping 정리
Shadow mapping 정리Shadow mapping 정리
Shadow mapping 정리
 
Overwatch 기술 분석
Overwatch 기술 분석Overwatch 기술 분석
Overwatch 기술 분석
 
Id142 plan
Id142 planId142 plan
Id142 plan
 
2nd ignite masan 이그나이트마산 09 설미정_ 기부, 기발함과 발칙함사이
2nd ignite masan   이그나이트마산 09 설미정_ 기부, 기발함과 발칙함사이2nd ignite masan   이그나이트마산 09 설미정_ 기부, 기발함과 발칙함사이
2nd ignite masan 이그나이트마산 09 설미정_ 기부, 기발함과 발칙함사이
 
color theory design work
color theory design workcolor theory design work
color theory design work
 
스크래치와 역사
스크래치와 역사스크래치와 역사
스크래치와 역사
 
Shader Driven
Shader DrivenShader Driven
Shader Driven
 
Mesh slice 1
Mesh slice 1Mesh slice 1
Mesh slice 1
 
LCD Monitor 선택 가이드와 Gamma의 이해
LCD Monitor 선택 가이드와 Gamma의 이해LCD Monitor 선택 가이드와 Gamma의 이해
LCD Monitor 선택 가이드와 Gamma의 이해
 
기본 회전 공식
기본 회전 공식 기본 회전 공식
기본 회전 공식
 
2015_색채학_연구주제보고서_현지원
2015_색채학_연구주제보고서_현지원2015_색채학_연구주제보고서_현지원
2015_색채학_연구주제보고서_현지원
 

Similaire à Gamma and linear color-space

06_HDR 소개
06_HDR 소개06_HDR 소개
06_HDR 소개noerror
 
Game Visual Art Technologies
Game Visual Art TechnologiesGame Visual Art Technologies
Game Visual Art TechnologiesSangYun Yi
 
구세대 엔진 신데렐라 만들기 최종본 유트브2
구세대 엔진 신데렐라 만들기 최종본 유트브2구세대 엔진 신데렐라 만들기 최종본 유트브2
구세대 엔진 신데렐라 만들기 최종본 유트브2Kyoung Seok(경석) Ko(고)
 
Devtree lightmapping unity5_2_1stday
Devtree lightmapping unity5_2_1stdayDevtree lightmapping unity5_2_1stday
Devtree lightmapping unity5_2_1stdaySangYun Yi
 
Unite2015 probelight(150417)
Unite2015 probelight(150417)Unite2015 probelight(150417)
Unite2015 probelight(150417)SangYun Yi
 
니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌
니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌
니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌민웅 이
 
[Shader study]Shadow Map Silhouette Revectorization(2014.01.06)
[Shader study]Shadow Map Silhouette Revectorization(2014.01.06)[Shader study]Shadow Map Silhouette Revectorization(2014.01.06)
[Shader study]Shadow Map Silhouette Revectorization(2014.01.06)해강
 
10_Human Skin Rendering
10_Human Skin Rendering10_Human Skin Rendering
10_Human Skin Renderingnoerror
 
실전프로젝트 정서경 양현찬
실전프로젝트 정서경 양현찬실전프로젝트 정서경 양현찬
실전프로젝트 정서경 양현찬현찬 양
 
111118 ch 4_basic image manipulation_web
111118 ch 4_basic image manipulation_web111118 ch 4_basic image manipulation_web
111118 ch 4_basic image manipulation_webCARROTCG
 
2018.02.03 이미지 텍스처링
2018.02.03 이미지 텍스처링2018.02.03 이미지 텍스처링
2018.02.03 이미지 텍스처링Sukwoo Lee
 
김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019
김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019
김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019devCAT Studio, NEXON
 
Cheap realisticskinshading kor
Cheap realisticskinshading korCheap realisticskinshading kor
Cheap realisticskinshading kor민웅 이
 
Display color와 Digital texture format의 이해
Display color와 Digital texture format의 이해Display color와 Digital texture format의 이해
Display color와 Digital texture format의 이해SangYun Yi
 
게임 개발을 위한 렌더링 기법 한성환
게임 개발을 위한 렌더링 기법   한성환게임 개발을 위한 렌더링 기법   한성환
게임 개발을 위한 렌더링 기법 한성환Yggdrasil610
 
Real-Time Global Illumination Techniques
Real-Time Global Illumination TechniquesReal-Time Global Illumination Techniques
Real-Time Global Illumination TechniquesJangho Lee
 
[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)
[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)
[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)해강
 

Similaire à Gamma and linear color-space (20)

06_HDR 소개
06_HDR 소개06_HDR 소개
06_HDR 소개
 
Game Visual Art Technologies
Game Visual Art TechnologiesGame Visual Art Technologies
Game Visual Art Technologies
 
Color Control
Color ControlColor Control
Color Control
 
구세대 엔진 신데렐라 만들기 최종본 유트브2
구세대 엔진 신데렐라 만들기 최종본 유트브2구세대 엔진 신데렐라 만들기 최종본 유트브2
구세대 엔진 신데렐라 만들기 최종본 유트브2
 
Devtree lightmapping unity5_2_1stday
Devtree lightmapping unity5_2_1stdayDevtree lightmapping unity5_2_1stday
Devtree lightmapping unity5_2_1stday
 
Bump Mapping
Bump MappingBump Mapping
Bump Mapping
 
Unite2015 probelight(150417)
Unite2015 probelight(150417)Unite2015 probelight(150417)
Unite2015 probelight(150417)
 
니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌
니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌
니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌
 
[Shader study]Shadow Map Silhouette Revectorization(2014.01.06)
[Shader study]Shadow Map Silhouette Revectorization(2014.01.06)[Shader study]Shadow Map Silhouette Revectorization(2014.01.06)
[Shader study]Shadow Map Silhouette Revectorization(2014.01.06)
 
10_Human Skin Rendering
10_Human Skin Rendering10_Human Skin Rendering
10_Human Skin Rendering
 
Uncharted4 part1
Uncharted4 part1Uncharted4 part1
Uncharted4 part1
 
실전프로젝트 정서경 양현찬
실전프로젝트 정서경 양현찬실전프로젝트 정서경 양현찬
실전프로젝트 정서경 양현찬
 
111118 ch 4_basic image manipulation_web
111118 ch 4_basic image manipulation_web111118 ch 4_basic image manipulation_web
111118 ch 4_basic image manipulation_web
 
2018.02.03 이미지 텍스처링
2018.02.03 이미지 텍스처링2018.02.03 이미지 텍스처링
2018.02.03 이미지 텍스처링
 
김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019
김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019
김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019
 
Cheap realisticskinshading kor
Cheap realisticskinshading korCheap realisticskinshading kor
Cheap realisticskinshading kor
 
Display color와 Digital texture format의 이해
Display color와 Digital texture format의 이해Display color와 Digital texture format의 이해
Display color와 Digital texture format의 이해
 
게임 개발을 위한 렌더링 기법 한성환
게임 개발을 위한 렌더링 기법   한성환게임 개발을 위한 렌더링 기법   한성환
게임 개발을 위한 렌더링 기법 한성환
 
Real-Time Global Illumination Techniques
Real-Time Global Illumination TechniquesReal-Time Global Illumination Techniques
Real-Time Global Illumination Techniques
 
[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)
[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)
[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)
 

Plus de 민웅 이

Siggraph15 A Novel Sampling Algorithm for Fast and Stable Real-Time Volume Re...
Siggraph15 A Novel Sampling Algorithm for Fast and Stable Real-Time Volume Re...Siggraph15 A Novel Sampling Algorithm for Fast and Stable Real-Time Volume Re...
Siggraph15 A Novel Sampling Algorithm for Fast and Stable Real-Time Volume Re...민웅 이
 
PowerVR Low Level GLSL Optimisation
PowerVR Low Level GLSL Optimisation PowerVR Low Level GLSL Optimisation
PowerVR Low Level GLSL Optimisation 민웅 이
 
제노블레이도 2 ray marching을사용한 구름 표현
제노블레이도 2 ray marching을사용한 구름 표현제노블레이도 2 ray marching을사용한 구름 표현
제노블레이도 2 ray marching을사용한 구름 표현민웅 이
 
Compute shader DX11
Compute shader DX11Compute shader DX11
Compute shader DX11민웅 이
 
Post processing in_color
Post processing in_colorPost processing in_color
Post processing in_color민웅 이
 
「스퀘어 에닉스 오픈 컨퍼런스 2012」「Agni's Philosophy」비하인드 스토리
「스퀘어 에닉스 오픈 컨퍼런스 2012」「Agni's Philosophy」비하인드 스토리「스퀘어 에닉스 오픈 컨퍼런스 2012」「Agni's Philosophy」비하인드 스토리
「스퀘어 에닉스 오픈 컨퍼런스 2012」「Agni's Philosophy」비하인드 스토리민웅 이
 
Valient killzone ps4 lighting
Valient killzone ps4 lightingValient killzone ps4 lighting
Valient killzone ps4 lighting민웅 이
 
니시카와젠지의 3 d 게임 팬을 위한 ps4
니시카와젠지의 3 d 게임 팬을 위한 ps4니시카와젠지의 3 d 게임 팬을 위한 ps4
니시카와젠지의 3 d 게임 팬을 위한 ps4민웅 이
 
Microfacet brdf
Microfacet brdfMicrofacet brdf
Microfacet brdf민웅 이
 
Wrapped diffuse
Wrapped diffuseWrapped diffuse
Wrapped diffuse민웅 이
 
3D Engine Tools with C++/CLR
3D Engine Tools with C++/CLR3D Engine Tools with C++/CLR
3D Engine Tools with C++/CLR민웅 이
 

Plus de 민웅 이 (12)

Siggraph15 A Novel Sampling Algorithm for Fast and Stable Real-Time Volume Re...
Siggraph15 A Novel Sampling Algorithm for Fast and Stable Real-Time Volume Re...Siggraph15 A Novel Sampling Algorithm for Fast and Stable Real-Time Volume Re...
Siggraph15 A Novel Sampling Algorithm for Fast and Stable Real-Time Volume Re...
 
PowerVR Low Level GLSL Optimisation
PowerVR Low Level GLSL Optimisation PowerVR Low Level GLSL Optimisation
PowerVR Low Level GLSL Optimisation
 
제노블레이도 2 ray marching을사용한 구름 표현
제노블레이도 2 ray marching을사용한 구름 표현제노블레이도 2 ray marching을사용한 구름 표현
제노블레이도 2 ray marching을사용한 구름 표현
 
Compute shader DX11
Compute shader DX11Compute shader DX11
Compute shader DX11
 
Post processing in_color
Post processing in_colorPost processing in_color
Post processing in_color
 
「스퀘어 에닉스 오픈 컨퍼런스 2012」「Agni's Philosophy」비하인드 스토리
「스퀘어 에닉스 오픈 컨퍼런스 2012」「Agni's Philosophy」비하인드 스토리「스퀘어 에닉스 오픈 컨퍼런스 2012」「Agni's Philosophy」비하인드 스토리
「스퀘어 에닉스 오픈 컨퍼런스 2012」「Agni's Philosophy」비하인드 스토리
 
Valient killzone ps4 lighting
Valient killzone ps4 lightingValient killzone ps4 lighting
Valient killzone ps4 lighting
 
니시카와젠지의 3 d 게임 팬을 위한 ps4
니시카와젠지의 3 d 게임 팬을 위한 ps4니시카와젠지의 3 d 게임 팬을 위한 ps4
니시카와젠지의 3 d 게임 팬을 위한 ps4
 
Microfacet brdf
Microfacet brdfMicrofacet brdf
Microfacet brdf
 
Wrapped diffuse
Wrapped diffuseWrapped diffuse
Wrapped diffuse
 
3D Engine Tools with C++/CLR
3D Engine Tools with C++/CLR3D Engine Tools with C++/CLR
3D Engine Tools with C++/CLR
 
Ceh
CehCeh
Ceh
 

Gamma and linear color-space

  • 1. Gamma와 Linear-Color-Space 이민웅 Shader Study http://cafe.naver.com/shader
  • 3. sRGB • HP, MS에서 지정한 표준 컬러 스페이스, 1996 • 감마는 2.2 – 윈도우 sRGB(2.2) 맥 color sync(1.8) – HDTV, 모니터, 프린터, 인터넷용 • 블랙으로는 1, 화이트로는 2.4로 비균일 CIEXYZ 다이어 그램에서 삼각형은 sRGB의 표현영역 CIEXYZ 모두를 표현할 수 있는 디바이스는 없음 Gamma, Color Space의 이해 이장호 - kasa
  • 4. 시각의 특성 • 인간의 시각은 베버의 법칙에 따라 밝기에 대해 비 선형적으로 반응 • 베버의 법칙 – 감각기에서 자극의 변화를 느끼기 위해서는 처음 자극 에 대해 일정 비율 이상으로 자극을 받아야 된다는 법 칙 • 예를 들면 – 처음에 약한 자극을 받으면 자극의 변화가 적어도 그 변화를 인지할 수 있다. 하지만 처음에 강한 자극을 받 으면 자극의 변화가 커야지 그 변화를 인지할 수 있음 • 즉, 자극 사이의 절대적인 차이가 아닌, 자극 사이 의 비율이 중요 ( 인간 시각의 비선형성 때문 )
  • 5. 선형 부호화 • 밝기를 선형적으로 나눈것 • 0이 검정, 255가 흰색 • 어두분 부분은 25, 26 차이는 사람이 매우 크게 느낌 – ( (26/255 - 25/255)/ (25/255) *100 ) – 밝기 차이 비율 : 4% • 밝은부분은 200, 201의 차이는 거의 못 느낌 – ( (201/255 - 200/255)/ (200/255) *100 ) – 밝기 차이 비율 : 0.5% • 빛의 밝기를 선형적으로 나누어 부호화하면 어두운 부분은 사람이 보기에 밝기 변화가 매우 큰 현상이 나타남 – Posterization , contouring(윤곽?), banding(변색?) Posterization : 분해된 사진의 원판을 써서 연속적인 톤[색조]의 사진 등에서 불연속적인 톤[색조]의 복제를 만드는 기법 네이버 백과사전 (포스터라이제이션)
  • 6. 선형으로 부호화를 하게 되면, 밝은 부분에서는 시각이 지각할 수 없는 쓸모 없는 데이터가 많아지고, 어두운 부분에서는 데이터가 부족해서 화질이 떨어지게 됩니다
  • 7. 채널 당 8 bit와 같이 한정된 정보양 안에 비선형적으로 부호화 서 선형적으로 빛의 밝기를 기록하 다음 그래프의 파란색 부분을 보 면, 사람의 눈이 민감하게 반응하는 '어 면 입력값(tristimulus value) 두운 부분'의 경우 밝기가 변할 때 부드 0~0.018은 이 함수를 거치면 럽게 느껴지지 않고 단절되어 보이는 현 0~0.081 사이의 값이 됩니다. 상(posterization, contouring, banding) 즉, 어두운 부분의 경우 세밀하게 이 발생합니다. 따라서, 주어진 정보양 나누어 기록합니다. 이에 반해 입 의 한계 안에서 최적의 화질을 보여주기 력값 0.92~1는 이 함수를 거치면 위해선 비선형적으로 부호화하여 '어두 운 부분'의 차이를 세밀하게 기록할 필요 0.96~1 사이의 값이 됩니다. 가 있다. Rec. 709 transfer function과 같 즉, 밝은 부분은 큰 차이가 나야 은 비선형 함수를 사용합니다. 만 서로 다른 값으로 기록되게 됩 니다
  • 8. • 비선형적으로 기록한 데이터를 사람에게 보여주 기 위해서는 보여주는 기기(보통 컴퓨터)에서 다 음 그림의 녹색 함수와 유사한 함수를 사용하여 원래의 밝기대로 보여주어야 합니다.
  • 9. Gamma • Gamma encoding, Decoding을 의미 – Gamma = 감마 부호화 = 감마보정 (Gamma encoding) (Gamma correction) • 감마보정의 잘못된 속설 – 모니터의 출력 특성 때문 – LCD 모니터들은 CRT가 아니기 때문에 감마 특성 과 별 관련이 없음 • 감마 보정의 이유 – 주어진 대역폭 내에서 최대한의 화질을 보여주기 위해서
  • 10. Gamma Correction • gamma가 1.0이 되어야 함을 의미 1보다 작으면 인코딩(compression) 1보다 크면 디코딩(expansion)
  • 11. Gamma Space • 게임에서 쓰는 모든 텍스쳐는 감마가 적용 된 텍스쳐! • 디스플레이 출력 시, 올바른 색상을 표현하 기 위해서, 1 / 2.2로 감마를 상쇄 감마보정 CRT감마
  • 12. Texture는 Gamma Space Pixel Shader는 Linear Space
  • 13. Gamma / linear space example Source image (16 b/ch) Gamma (contrasted) Linear (contrasted) Kaplanyan-CryEngine3(SIGGRAPH 2010 Advanced RealTime Rendering Course)
  • 14.
  • 15. 감마 보정 sRGB 읽기 sRGB 쓰기 0.45 2.2 1/2.2 Uncharted 2: HDR Lighting
  • 18. 감마 보정 Diffuse 텍스쳐를 가져올 때 감마적용 float3 diffuseCol = pow( tex2D( diffTex, texCoord ), 2.2 ); 최종 칼라를 리턴할때 감마보정 return float4( pow(finalCol, 1.0 / 2.2), pixelAlpha); sampler2D SamplerColor = sampler_state 하드웨어 사용시 { Texture : D3DSAMP_SRGBTEXTURE … RenderTarget write: D3DRS_SRGBWRITEENABLE SRGBTexture=FALSE; }; technique PostProcess { pass P0 { …. SRGBWRITEENABLE=FALSE; } } 기본적으로 SRGBTexture는 꺼져있음 하드웨어 감마 보정시는 켜야 함
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24. 연기, GUI, 총 Glow 볼것
  • 25.
  • 26. Reference 감마 보정(gamma correction), 감마 인코딩(gamma encoding)의 이해(http://shotgunlee.egloos.com/10607756) http://www.w3.org/TR/PNG-GammaAppendix.html http://www.poynton.com/PDFs/Rehabilitation_of_gamma.pdf http://www.poynton.com/notes/Timo/index.html 위키백과 감마 보정 http://ko.wikipedia.org/wiki/%EA%B0%90%EB%A7%88_%EB%B3%B4%EC%A0%95 위키백과 베버의 법칙 http://ko.wikipedia.org/wiki/%EB%B2%A0%EB%B2%84%EC%9D%98_%EB%B2%95%EC%B9%99 Gamma, Color Space의 이해 – 이장호 – Kasa GDC2008_PostProcessingInTheOrangeBox Ndc11 올바른 HDR을 이용한 Bloom과 Dof ㈜소프트네트 이창희 GPU Gems3 chapter24_the_importance_of_being_linear Hable-Uncharted2(SIGGRAPH 2010 Advanced RealTime Rendering Course) Uncharted2-Hdr-Lighting gamma(감마) – 임정환 Picture Perfect - Gamma Through the Rendering Pipeline Kaplanyan-CryEngine3(SIGGRAPH 2010 Advanced RealTime Rendering Course)