1 / 29

Shperical Harmonics Lighting

Shperical Harmonics Lighting. 계명대학교 이주영. 목 차. 1. Global Illumination 2. 몬테카를로 적분법 (Monte Carlo Integration) 3. 구 샘플링 4. Orthogonal Basis Functions 5. Spherical Harmonics 6. Spherical Harmonics Projection 7. Spherical Harmonics Lighting Example. Global Illumination.

Download Presentation

Shperical Harmonics Lighting

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Shperical Harmonics Lighting 계명대학교 이주영

  2. 목 차 1. Global Illumination 2. 몬테카를로 적분법 (Monte Carlo Integration) 3. 구 샘플링 4. Orthogonal Basis Functions 5. Spherical Harmonics 6. Spherical Harmonics Projection 7. Spherical Harmonics Lighting Example

  3. Global Illumination • Local Illumination – 물체 표면과 광원의 관계를 이용하여 계산하는 방법 • Global Illumination – 조명이 주변환경에 의해 반사되는 모든 빛을 계산하는 방법

  4. Global Illumination • Diffuse Surface Reflection • Rendering Equation : 점 x에서 방향으로 전달되는 빛의 총 세기 : 점 x에서 방향으로 스스로 내뿜는 빛의 세기 : 점 x에서 빛의 입,반사 방향에 대한 BRDF(반사율함수) : 다른 점 x’에서 방향으로 점 x에 입사하는 빛의 세기 : 점 x와 x’ 간의 기하학적 관계 : 서로가 서로에게 보이는지 유무, 0 또는 1

  5. Global Illumination • 한 정점에서의 빛의 입사 및 반사

  6. Monte Carlo Integration • 들어오는 광원을 표현하기 위한 함수를 근사치로 적분하기 위한 방법 • 수치계산으로 풀지 않고 확률 이용 - 대상 함수를 샘플링하고 평균을 내서 근사치의 적분값을 구하는 방법 • 대상 함수의 근사치를 구하는 식 • 샘플링을 많이 할수록 대상 함수에 더 가까워진다.

  7. 구 샘플링 • 구를 단위 영역으로 나누는 것 • 10,000개의 불규칙한 구 상의 샘플 -> (θ,φ)를 사용하는 구 좌표계로 Projection • x,y는 [0…1. 0…1] 범위 내에서 샘플링

  8. Orthogonal Basis Functions • Basis Functions은 어떤 함수를 나타낼 수 있는 작은 조각 • 크기를 적절하게 조정하고 결합하여 원래 함수의 근사치 계산 • Projection(내적) : 적절한 크기를 조절하기 위해서 원래 함수와 basis functions의 내적값을 구하는 것

  9. Orthogonal Basis Functions • 크기 조절을 마친 신호들을 결합하면 원래 함수와 비슷한 모양을 만들 수 있다.

  10. Orthogonal Basis Functions • Orthogonal Basis Function - 두 함수가 직각을 의미하고 두 함수는 서로 관련이 없다. - 두 함수를 더해도 원래의 두 함수로 분해할 수 있다.

  11. Orthogonal Basis Functions • basis functions을 구하기 위한 직교다항식 중에서 SHF에서는 Associated legendre polynomials를 사용 • Associated legendre polynomials

  12. Orthogonal Basis Functions • 4개 주파수에서의 associated Legendre polynomials

  13. Spherical Harmonics • 구를 생성하는 orthogonal basis를 형성 • 구 좌표계 상의 임의의 함수를 원하는 개수의 주파수 영역들로 분해하고, 복원할 수 있다. • SH function은 y로 표기 • P는 Associated legendre polynomials • K는 함수를 표준화하기 위한 크기 조절 요소

  14. Spherical Harmonics Thisdirection Thisdirection + + – – Not thisdirection Not thisdirection

  15. Spherical Harmonics • m = 2, l = 4

  16. Spherical Harmonics

  17. Spherical Harmonics • 데카르트 좌표계를 SH 입력값으로하여 다항식으로 나타낼 수 있다.

  18. Spherical Harmonics Projection • 구 좌표계 상의 함수 f(s)는 주어진 주파수 l,m에 대해서 상수 clm로 분해 • 특별한 주파수를 위한 하나의 계수를 계산하기 위해서는 원 함수 f(s)와 SH 함수의 곱들을 더하기만 하면 된다. • 함수 f(s)의 s는 구 샘플(θ,φ) • 각 샘플에 대해서 ylm을 한번만 구하고 여기에 대상 함수값을 곱하면 SH 계수 구할 수 있다.

  19. Spherical Harmonics Projection • 몬테카를로 적분법의 식 • xi는 샘플의 배열이고, 함수 f는 f(xi) = light(xi)yi(xi)이다. • 각샘플마다 가중치 같도록 하면, 하나의 샘플이 구 표면에서 나올 확률 p(xi) = 1/4π, 가중치 w(xi) = 4π • 각 샘플마다 가중치가 같으므로 상수가 된다.

  20. Spherical Harmonics Projection • 원 함수의 근사값을 구할 수 있다. • 주파수 수를 늘여 SH function의 개수가 많을수록 원 함수에 더 근접한 함수를 얻을 수 있다.

  21. Spherical Harmonics Projection Order 0 1 term Exact image 0 RMS error = 25 % 1 2 2 -2 -1 0 1

  22. Spherical Harmonics Projection Order 1 4 terms Exact image 0 RMS Error = 8% 1 2 2 -2 -1 0 1

  23. Spherical Harmonics Projection Order 2 9 terms Exact image 0 RMS Error = 1% 1 For any illumination, average error < 3% [Basri Jacobs 01] 2 2 -2 -1 0 1

  24. Spherical Harmonics Lighting 정리 입력값(θ,φ) 생성 구 샘플링( 몬테카를로 적분법 이용) Basis Function으로 Associated Legendre Polynomials를 이용한 Spherical Harmonics사용 (두 각으로 표현되는 구 좌표계 상의 임의의 함수를 원하는 개수의 주파수 영역들로 분해) 입력입사광에 대해 프로젝션한 벡터 생성 입사광에 대한 벡터 저장 미리 계산하여 저장하므로 렌더링시 연산량 줄여줌. 렌더링시 한 점에서 재질의 색상과 저장된 벡터의 내적으로 해당 점의 밝기 계산

  25. SHL Example • Sample : 2,500 • band: 4 • Basis Functions: 16개 • Rotation : θ(43.3),φ(225.0)

  26. SHL Example • GL Lighting

  27. SHL Example • SH Lighting - Unshadowed

  28. SHL Example • SH Lighting - Shadowed

  29. 감사합니다.

More Related