Date post: | 26-May-2015 |
Category: |
Education |
Upload: | taewoo-kim |
View: | 1,980 times |
Download: | 2 times |
Deferred Rendering Transparency
Shader Study (http://cafe.naver.com/shader.cafe)
Codevania (http://codevania.tistory.com)
INDEX
• Introduction• Transparency– Deferred Rendering– Overview DRT– Rendering DRT
• Result Discussion– Performance– Downsides
• Summary and Future Work• References
• Introduction• Transparency– Deferred Rendering– Overview DRT– Rendering DRT
• Result Discussion– Performance– Downsides
• Summary and Future Work• References
Transparency
• 렌더링 엔진에서 필수적인 부분
• glass, water, smoke, fire, or decals 렌더링 시에 필요
• 불행히도 , deferred rendering 에서 가장 문제가 있는 부분 중에 하나임
Transparency
Deferred Rendering
• 장점–중복된 정점 변환 피할 수 있음–아주 많은 동적 조명 사용–깊이 복잡도 감소– Early Z-buffer 로 부하가 줄어듬
• 단점–투명도를 다룰 수 없다– H/W Anti-Aliasing 이 지원 안됨
뭐가 장단점 ?
Deferred Rendering Transparency
• 불투명 , 투명 오브젝트간의 lighting consistency 를 제공
Deferred Rendering Transparency
• 핵심 아이디어– Geometry Phase: 투명 오브젝트를
불투명 오브젝트와 함께 interlace.– Perform Lighting– Composition Phase:
de-interlace and blend them.
• 장점– G-buffer 에 저장될 transparency alpha 만 필요–추가적인 데이터 , 파이프라인 변경 필요 없음
• Introduction• Transparency– Deferred Rendering– Overview DRT– Rendering DRT
• Result Discussion– Performance– Downsides
• Summary and Future Work• References
Transparency
• 부분적으로 투명한 색을 background 와 조합하는 처리
• Source, Destination 의 두 컬러를 필요로 함
• Introduction• Transparency– Deferred Rendering– Overview DRT– Rendering DRT
• Result Discussion– Performance– Downsides
• Summary and Future Work• References
Deferred Rendering Phases
• Geometry phase
• Lighting phase
• Composition phase
• Post-processing phase
Splitting the rendering pipeline
• Render opaque objects–모든 불투명 오브젝트들을
deferred rendering 으로 렌더링–최종 조합된 이미지를 얻기 위해
G,L,C phase 를 수행
• Render transparent objects–뒤에서 앞으로 정렬된 모든 투명 오브젝트들을
렌더링– deferred rendering 된 최종 이미지와
blend 시킨다
Problems
• lighting inconsistency
• split pipelines 를 위한 추가적인 관리와 코드 필요
• 투명 오브젝트를 그리기 위한 traditional rendering
Alpha-to-Coverage
• Transparency 에 대한 해법• 불행히도 ,
블렌딩을 위해 높은 레벨의 supersampling 이 요구되는데 , 이것은 deferred-rendering에서 잘 제공되지 않음 .
New Approach
• Deferred rendering 을 사용할 때 투명 오브젝트들의 lighting consistency 문제를 해결하는 알고리즘
• Deferred Rendering Transparency 로 명명
• 장점– Lighting consistency– Simple and robust– Speed
Lighting consistency
• 투명 /불투명 오브젝트들이 같은 lighting pipeline 을 사용하기 때문에 동일한 lighting quality 를 보여줌
• lighting glitches 없이 불투명 오브젝트들이 서서히 fade out 됨
Simple and robust
• No pipeline change
• No additional object sorting or object separation
• 추가적인 코딩 없이 , 정점 레벨과 텍스처 레벨의 투명도를 다 처리할 수 있음
Speed
• Only + 7~10 shader instruction
• Only + 2 texture fetch
• No additional render targets switching
• Introduction• Transparency– Deferred Rendering– Overview DRT– Rendering DRT
• Result Discussion– Performance– Downsides
• Summary and Future Work• References
Deferred Rendering Transparency
• 기존의 deferred rendering 에 삽입할 pixel shader code 조각 2 개 필요
– G-phase 에서 투명 오브젝트들을 interlace
– C-phase 에서 투명 오브젝트들을 de-interlace 시키고 background 와 blend 시킴
In the G-buffer Creation phase
In the Composition phase
• Introduction• Transparency– Deferred Rendering– Overview DRT– Rendering DRT
• Result Discussion– Performance– Downsides
• Summary and Future Work• References
Geometry Phase
• 모든 투명 /불투명 오브젝트들 렌더링• 알파 테스팅 활성화
• 마치고 , deferred rendering 에서 하던 데로 lighting pass 수행
Composition Phase
• Color, lighting RT 들이 조합됨• 픽셀 쉐이더에서–투명 오브젝트를 백그라운드와
de-interlace & blend
Artifacts at the edges
Fix the problem
• Introduction• Transparency– Deferred Rendering– Overview DRT– Rendering DRT
• Result Discussion– Performance– Downsides
• Summary and Future Work• References
PC spec
• Intel 2.4GHz• 2GB RAM• NVIDIA GeForce 8800 GTS
기본 DR 에 추가된 instruction
• Geometry phase– 7 arithmetic instructions– 0 texture instructions
• Composition phase– 10 arithmetic instructions– 3 texture instruction (point sampled)
Result of test
• Introduction• Transparency– Deferred Rendering– Overview DRT– Rendering DRT
• Result Discussion– Performance– Downsides
• Summary and Future Work• References
Downsides
• Vertical blur–투명 오브젝트에서 2- 픽셀 버티컬 블러가
약간 보임• interlacing 정보가 손실되기 때문
–이것은 투명 오브젝트들에 대한 정보를 보존하기 위해 vertical oversampling 으로 해결 가능• 하지만 성능이 심각하게 떨어진다 .
• Jaggy edges• Only one transparency layer
Downsides
• Vertical blur• Jaggy edges–앨리어싱 . 래스터 그래픽스에서 피할 수 없는 문제–투명 오브젝트들의 경계에서
약간의 jaggy edge 들이 보인다 .
• Only one transparency layer
Downsides
• Vertical blur• Jaggy edges• Only one transparency layer–알고리즘의 태생적 한계–최근접 투명 오브젝트만이 보인다 .
• Introduction• Transparency– Deferred Rendering– Overview DRT– Rendering DRT
• Result Discussion– Performance– Downsides
• Summary and Future Work• References
Future Work
• Better de-interlacing– C-phase 에서 더 나은 de-interlacing 처리로
jagged edge 효과를 줄일 수 있다–아마 (?) 텍스처 read 수를 줄일 수 있을 것임
• Blending modes• Vertical blur
Future Work
• Better de-interlacing• Blending modes–추가적인 픽셀 속성을 가져서 ,
다른 유용한 블렌딩 모드들을 구현 가능–multiply, add, overlay
• Vertical blur
Future Work
• Better de-interlacing• Blending modes• Vertical blur–이 문제에 대한 빠르고 간단한 솔루션이
연구되어야 한다–예를 들면 , 2 개의 8bit color 값들을
16bit render target 에 저장하는 것 ...
• Introduction• Transparency– Deferred Rendering– Overview DRT– Rendering DRT
• Result Discussion– Performance– Downsides
• Summary and Future Work• References
References
• Alpha-to-coverage in depth, ShaderX 5• Deferred shading, GDC 2004• The triangle processor and normal vector
shader, SIGGRAPH 1998
Lisence