Upcoming SlideShare
×

# DOF

1,150 views

Published on

DOF, depth of field

Published in: Technology
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
1,150
On SlideShare
0
From Embeds
0
Number of Embeds
111
Actions
Shares
0
8
0
Likes
0
Embeds 0
No embeds

No notes for slide

### DOF

1. 1. Depth of Field http://ozlael.egloos.com/
2. 2. DOF 란 ● 피사계심도 ● 사진 렌즈로 어떤 거리의 피사체에 초점을 맞추면 그 앞쪽 [ 近點 ] 과 뒤쪽 [ 遠點 ] 의 일정한 거리 내에 초점이 맞는데 이때 그 범 위를 이르는 말 . ● PhotoRealistic Rendering
3. 3. Pinhole Camera Model
4. 4. Thin Lens Camera Model
5. 5. Implementation ● Simulation of CoC ● Pass 1 : Scene Rendering ● Pass 2 : Pos-processing
6. 6. Pass 1 : Scene Rendering ● 장면 랜더링 ● Depth and Blurriness factor ● MRT 사용
7. 7. Pass 1 : Scene Rendering ● Depth
8. 8. Pass 1 : Scene Rendering ● Mapping Depth to Blur Focal Range 1 Blur Depth -1 Focal Dist float blur = saturate( abs( depth - focalDist) * (2/focalRange));
9. 9. Pass 1 : Scene Rendering ● MRT output
10. 10. Pass 2 : Pos-processing ● Use CoC ● Poisson distribution
11. 11. Pass 2 : Pos-processing ● Blurriness 와 Filter Size
12. 12. Pass 2 : Pos-processing ● Leaking
13. 13. Pass 2 : Pos-processing // Get center sample float4 colorSum = tex2D(SceneColorSampler, v.vTexCoord); float2 centerDepthBlur = tex2D(DepthBlurSampler, v.vTexCoord); // Compute CoC size based on blurriness float sizeCoC = centerDepthBlur.y * maxCoC; float totalContribution = 1.0f; // Run through all taps for (int i = 0; i < NUM_DOF_TAPS; i++) { // Compute tap coordinates float2 tapCoord = v.vTexCoord + filterTaps[i] * sizeCoC; // Fetch tap sample float4 tapColor = tex2D(SceneColorSampler, tapCoord); float2 tapDepthBlur = tex2D(DepthBlurSampler, tapCoord); // Compute tap contribution float tapContribution = (tapDepthBlur.x > centerDepthBlur.x) ? 탭의 깊이 비교 1.0f : tapDepthBlur.y; // Accumulate color and contribution 샘플링 탭이 Blurriness 0 면 색이 적용 X colorSum += tapColor * tapContribution; totalContribution += tapContribution; } // Normalize to get proper luminance float4 finalColor = colorSum / totalContribution;