1 / 35

Pre-computed Radiance Transfer

Pre-computed Radiance Transfer. Allen Chen. Outlines. Traditional GI solutions and problems Spherical harmonics Pre-computed radiance transfer Per-pixel PRT implementation Performance analysis. Global Illumination. Ray tracing Radiosity Precomputed radiance transfer. Ray Tracing.

sef
Download Presentation

Pre-computed Radiance Transfer

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. Pre-computed Radiance Transfer Allen Chen

  2. Outlines • Traditional GI solutions and problems • Spherical harmonics • Pre-computed radiance transfer • Per-pixel PRT implementation • Performance analysis

  3. Global Illumination • Ray tracing • Radiosity • Precomputed radiance transfer

  4. Ray Tracing • Cast ray from camera to pixel center • Generate shadow rays towards all light sources • Generate secondary rays until the ray leaves the scene

  5. Ray Tracing • Physically accurate lighting model • Hard shadows and mirror-like reflections • Much slower compared to other algorithms

  6. Radiosity • Transfer of radiant energy between surfaces • Radiosity equation describes the amount of energy emitting from a surface, can be used as final intensity of the light • Form factor describes the fraction of energy leaving one surface that reaches a second surface

  7. Radiosity • Soft shadows and diffuse inter-reflections • Preprocessing the geometries is required • Large computational and storage costs

  8. Recomputed Radiance Transfer • Render equation • Represent as a light source function and a pre-computable transfer function • Light source function describes the fraction of the incident light at point x from direction that has been emitted from a light source • Transfer function describes how light arriving at the point x is transformed into irradiance in direction

  9. Recomputed Radiance Transfer • Depending on the light model used, T can be expressed as a spherical function • For view-independent light models, T can be approximated by SH coefficients • For view-dependent light models, T can be approximated by SH transfer matrix

  10. Spherical Harmonics • Basis functions in spherical polar coordinates • Represented by associated Legendre polynomials • A total of l(l+1) polynomials in a l-th band series

  11. Spherical Harmonics • Integrating the product of spherical function and basis functions generates coefficients • Combining scaled basis functions produces original function • Combining band-limited basis functions produces approximation of original function

  12. Spherical Harmonics Properties • Integrating two band-limited functions is the same as calculating the dot product of their coefficients • Arbitrary rotation for the original function implies the same rotation for band-limited function

  13. Transfer Functions • Lambert light model - BRDF as a const value • Diffuse unshadowed transfer function • Diffuse shadowed transfer function

  14. Per-Vertex PRT • Pre-compute diffuse shadowed transfer function in offline tool • Cast rays in upper hemisphere of each vertex into the scene • Calculate geometry and visibility terms from each ray • Project the result onto SH basis and store coefficient as vertex component • Reconstruct rendering equation with light coefficient in application

  15. Diffuse Shadowed Per-vertex Transfer Wireframe mode

  16. Per-Vertex PRT • Pros • Easy to implement • No hardware limitation (gouraud shading) • Cons • Shading quality depends on mesh topology • Require re-computation if any position change on any of the models in the scene

  17. Per-Pixel PRT • Similar idea with lightmap to store luminance information into texture • Require additional unwrapped UV for each affected models • Store pre-computed coefficientsto the texture • Use floating point volume texture since each pixel has n coefficients

  18. Per-Pixel PRT • Can be slow as the calculation now is in pixel level • Mark legal pixel beforehand to reduce the calculation • Check whether the pixel located in any triangle in UVW space • Save 16 coefficients (4 bands) into RGBA16F Depth4 texture

  19. Visualize a floating point coefficient texture Only the values in red channel are displayed

  20. PPPRT Pixel Shader

  21. Rendering Artifact Notice the black border of the box

  22. Rendering Artifact • Current sample value is the average value of its neighbor pixels • Fill the neighbor pixels if they are illegal

  23. Shading Quality • Primary parameters affecting the shading quality • More ray count, more accurate integral result • More SH bands, better approximation of the transfer function • Larger texture size, more shading details • Increase any of these parameters result in more pre-computing and storage cost

  24. Shading Quality • Ray = 256, Texture Size = 256x256x4, Band = 4

  25. Shading Quality • Ray = 625, Texture Size = 256x256x4, Band = 4

  26. Shading Quality • Ray = 625, Texture Size = 256x256x8, Band = 5

  27. Integration with Normal Map • Half-life2 basis vectorsas normals in pre-computing step • Decouple pre-computing transfer function from pixel normal information • More data need to be stored (3 copies of coefficients per pixel)

  28. Per-Pixel PRT • Pros • Decouple shading quality from model topology • More accurate result compared to PVPRT • Cons • Require floating point and volume texture format • Large storage(VRam) cost even without considering normalmap • VRam bandwidth can be the bottleneck easily

  29. Future Work • Use bounding volume tree to accelerate pre-computing step • Further compress the texture data • Research transfer matrix to take BRDF into account • Diffuse indirect lighting

  30. Diffuse Indirect Lighting • Accumulate the diffuse color from closest triangle of ray intersection in Monte Carlo sampling step • Store the coefficients and color information for each vertex or pixel • Color bleeding effect as commonly seen in radiosity

  31. Diffuse Shadowed Transfer

  32. Diffuse Indirect Transfer

  33. Q & A

More Related