Scissor Rect Mgun Scissor Optimizations Most important fillrate

  • Slides: 13
Download presentation
Scissor Rect Mgun.

Scissor Rect Mgun.

Scissor Optimizations -> Most important fill-rate optimization for stencil shadows -> Hardware does not

Scissor Optimizations -> Most important fill-rate optimization for stencil shadows -> Hardware does not generate fragments outside the scissor rectangle — very fast -> Scissor rectangle can be applied on a per-light basis or even a per- geometry basis -> Requires that lights have a finite volume of influence

Light Scissor No Light Scissor Shadow volumes extend to edges of viewport Light Scissor

Light Scissor No Light Scissor Shadow volumes extend to edges of viewport Light Scissor Shadow volume fill reduced significantly

Light Scissor -> Project light volume onto the image plane – 조명구가 시야에 보이는

Light Scissor -> Project light volume onto the image plane – 조명구가 시야에 보이는 경우, 뷰포트에서 그 광원이 영향을 미치는 영역이 뷰포트 전체가 아닐 수도 있다. 조명구를 이미지 평면에 투영해 그 영역에서만 랜더링. View Frustum Image Plane http: //www. gamasutra. com/view/feature/2942/th e_mechanics_of_robust_stencil_. php? page=2 Camera Light

Calculation Scissor Rect Calculation X축 (Y축도 계산방식이 동일) float f. D = (r 2

Calculation Scissor Rect Calculation X축 (Y축도 계산방식이 동일) float f. D = (r 2 * L 2. x - (L 2. x + L 2. z) * (r 2 - L 2. z)); if(f. D <= 0. 0 f) return false; float f. Sqrt. D = sqrtf(f. D); T 0. x = (f. Radius * v. L. x + f. Sqrt. D) / (L 2. x +L 2. z); T 0. z = (f. Radius - T 0. x * v. L. x) / v. L. z; T 1. x = (f. Radius * v. L. x - f. Sqrt. D) / (L 2. x +L 2. z); T 1. z = (f. Radius - T 1. x * v. L. x) / v. L. z; v. P[0] = v. L - f. Radius * T 0; v. P[1] = v. L - f. Radius * T 1;