SX 3 2 15 Reduction of Lighting Calculations
- Slides: 24
SX 3 -2. 15 Reduction of Lighting Calculations Using Spherical Harmonics 조욱래 mech 12@nate. com www. cafe. naver. com/shader
Spherical Harmonics Based Lighting
Irradiance ± ± . Amount of light incident onto a point Computed by intergrating the incoming light ® E : Irradiance , Function of surface normal ® n : surface normal ® w : incoming light direction ® L(w) : whole environment map light
Coefficients Ylm ± Polynomial form ® X, y, z : cartesian coord of the incident vector
± E : expressed function of L ® Theta , pi : spherical coord ® A : term of dependent on n and w ® Alpha : error term ® p, q : number of term ® [Ramamoorthi 01]의하면 coeffi값은 9개정도만 해 도 높은 정밀도의 결과를 얻을수 있다.
Coefficents ± ± l = 0, 1, 2 m= 0 ® -1, 0, 1 ® -2, -1, 0, 1, 2 ®
게임상의 구현 ± 1 st : encode the lighting ENV in SH term. ® Static Light ENV Calculated offline ® distant sun, etc… ® Static is not mean cannot be rotated. ® ® SH Property is rotationally invriant. ® Dnynamic light source Need to encoding real time ® This mean calculating the Llm terms ®
게임상의 구현(2) ± 2 nd : calculating the actual irradiance, E ® E depends on theta , pi (Spherical coord) , and surface normal. ® 그래서 물체가 렌더링 되는 시점에서 계산되 야함.
The Two Methods
Analytical Lights ± Spot, point light, etc ® 빛이 무한대에 위치한다고 가정. ® Lighting ENV map의 일부로 가정. ® 각각의 빛은 해당 SH coeffi를 spatail domain 이나 frequency domain에서 쉽게 더함으로 해서 적용될 수 있다. ® Run time
Surface Lights ± Sky , pre-rendered ENV map, HDR, non-HDR map, bulb , neon light ® 전역광에 의한 더 정확한 사실 묘사에 유용. ± Ylm : Nine coefficents ® L=(0, 1, 2) and m=(-2, -1, 0, 1, 2) ± Llm ® ± Light weight of ENV map L ® 한지점에서의 빛세기.
Determining the Lights’ Contribution to the Scene
Putting It All Together-Code Explanation SH를 이용한 빛 계산은 크게 CPU tiime과 GPU time으로 분리된다. (GPU의 성능에 크게 영향을 받음. )
Surface Lights ± Compute SH’s coefficients
Analytical Lights ± To turn analytical light into SH
ENV map & Cube map (? ? ? ) Foreach ( 9 coeffi) //l, m For(every pixel in ENV map) Foreach ( 9 coeffi) //l, m For(pixels in 6 faces of ENV map) Get 2 D coeffi 극좌표->2 D 좌표& face ‘n’ -> 3 D좌표 극좌표->3 D좌표 Ylm계산 Integra += samplevalue(xp, yp) * Ylm CPU GPU Color계산 using normal & coeffi. Blend this with other incomming colour & vertex color
장단점 ± Vertex Program Work ® Fast ® Poor quality in low tessellated geometry ± Fragments Program Work ® Looks good ( diffuse light per pixel ) ® Slow
최종분석 ± Shader. X 3 -2. 15. vsd
Q&A
- Types of connections in steel structures
- Kinetic energy pyramid
- Infusion flow rate formula
- Hess's law
- The calculations of quantities in chemical reactions
- Dividing head formula
- Defining stoichiometry
- How to calculate tariffs grade 12
- Heating curve calculations
- Mousetrap car physics calculations
- Wetflag calculations
- Define volumetric analysis
- Htc calculator
- Entropy calculations
- Biochemical calculations examples
- The arithmetic of equations
- Fire hose friction loss coefficient chart
- Reliability calculations
- Drug dose calculation formula by weight
- Critical instant in dry docking
- Wiper mechanism calculations
- Activity sheet 1 how diversified are these portfolios
- Conversions and calculations chapter 6
- Calculations
- Chapter 2 measurements and calculations