Содержание
- 2. This slide includes practical examples about SH Lighting for the current hardware (PlayStation 2) HDR Rendering
- 3. SH Lighting gives you… Real-time Global Illumination
- 4. SH Lighting gives you… Soft shadow (but not accurate)
- 5. SH Lighting gives you… Translucent Materials
- 6. HDR Rendering gives you… Photo-realistic Light Effect Original Scene Bloom Effect added
- 7. HDR Rendering gives you… Photo-realistic Sunlight Effect Original Scene Sunlight and Bloom Effect added
- 8. HDR Rendering gives you… Photo-realistic Depth of Field Effect adds depth to images
- 9. SH and HDR give you… Using both techniques shows the synergistic effect GI without HDR GI
- 10. Where to use SH and HDR Don’t have to use all of them SH lighting could
- 11. Engine we’ve integrated Lighting specification (for each object) 4 vertex directional lights (including pseudo point light,
- 12. Engine we’ve integrated Lighting Shaders Color Rate Shader (light with intensity only) Lambert Shader Phong Shader
- 13. Engine we’ve integrated Custom Shaders (up to 4 shaders you can choose for each polygon) Physique
- 14. Rendering Pipeline Our engine has the following rendering pipeline Mesh Data Modifiers Custom Shaders Lighting Shaders
- 15. Rendering Pipeline
- 16. Where have we integrated? HDR : Adapting data for HDR -> Modifying mesh data Applying HDR
- 17. High Dynamic Range Rendering
- 18. Representing Intense Light Color (255,255,255) as maximum value can't represent dazzle How about by a real
- 19. Optical Lens Phenomena By camera - Various phenomena caused by light reflection, diffraction, and scattering in
- 20. Glare Effects Visible only when intense light enters May occur at any time but are usually
- 21. Depth of Field One of the optical phenomena but not a Glare Effect DOF generally is
- 22. Representing Intense Light - Bottom Line Accurate reproduction of Glare Effects creates realistic intense light representations
- 23. What is HDR? Stands for High Dynamic Range Dynamic Range is the ratio between smallest and
- 24. Physical Quantity for HDR For example, when you want to handle sunlight and blue sky at
- 25. Implementation of HDR Buffer on PS2 PS2 has no high precision frame buffer - Have to
- 26. Mach-Band Issue Resolution of the visible domain gets worse and Mach-Band is emphasized But with texture
- 27. Mach-Band Issue
- 28. Mach-Band Issue – with Texture
- 29. Tone Mapping One of the processes in HDR Rendering It involves remapping the HDR buffer to
- 30. Tone Mapping Typical Tone Mapping curves are nonlinear functions Measurement value of digital camera (EOS 10D)
- 31. Tone Mapping on PS2 But PS2 doesn't have a pixel shader, so simple scaling and hardware
- 32. Tone Mapping on PS2 PS2's alpha blending can scale up about six times on 1 pass
- 33. Tone Mapping - Multiple Bands Multiple bands process to represent nonlinear curves
- 34. Tone Mapping - Multiple Bands But in cases of more than two bands, it is necessary
- 35. Glare Filters on PS2 Rendering costs (Typical) Bloom 5-16Hsync Star (4-way) 7-13Hsync Persistence 1Hsync (frame buffer
- 36. Basic Topics for Glare Filters use Reduced Frame Buffer Filtering Threshold Shared Reduced Accumulation Buffer
- 37. Reduced Frame Buffer Using 128x128 Reduced Frame Buffer All processes substitute this for the original frame
- 38. Filtering Threshold In practice, the filtering portion of buffer that are over threshold values The threshold
- 39. Filtering Threshold This method could be an approximation of a logarithmic curve for Tone Mapping ??
- 40. Shared Reduced ACC Buffer Main frame buffers take a large area so fill costs are expensive
- 41. Work Buffer List Buffer sizes depend on PSMCT32 Page unit Buffer sizes will be 128x96 or
- 42. Bloom Using Gaussian Blur (Detail later) The work buffer size is 128x128 - 64x64 source Subtract
- 43. Bloom - Multiple Gaussian Filters Use Multiple Gaussian Filters MGF can reduce a blur radius compared
- 44. Bloom - Multiple Gaussian Filters Use 3 Gaussian filters in our case Radii are: 1st:40%, 2nd:20%,
- 45. Star Create each stroke on the work buffer and then accumulate it on the ACC Buffer
- 46. Star Issue Can't draw sharp edges on Reduced ACC buffer Copying directly from a work buffer
- 47. Persistence Send outcomes of filtering to Persistence Buffer as well as ACC Buffer Persistence Buffer size
- 48. More Details for Glare Filters Multiple Gaussian Filters How to create star strokes and so on..
- 49. Gaussian Blur for PS2 Gaussian Blur is possible on PS2 It creates beautiful blurs Good match
- 50. Gaussian Blur Use Normal Alpha Blending Requires many taps, so processing on Reduced Work Buffer is
- 51. Gaussian Filter on PS2 Compute Normal blending coefficients to distribute the pixel color to nearby pixels
- 52. Gaussian Filter on PS2 Example: To distribute 25% to both sides 1st pass, blend 25% /
- 53. Gaussian Filter on PS2 Gaussian Distribution can separate to X and Y axis This way, you
- 54. Gaussian Filter on PS2 In addition, using bilinear filtering you can blur 2 pixels once That
- 55. Lack of Buffer Precision 8-bit integer does not have enough precision to blur a wide radius.
- 56. Gaussian Filter Optimization Of course using VU1 saves CPU Avoiding Destination Page Break Penalty of a
- 57. Depth of Field Achievements of our system: Reasonable rendering costs: 8-24Hsync(typically), 35Hsync (frame buffer size :
- 58. Depth of Field
- 59. Depth of Field overview Basically, blend a frame image and a blurred image based on alpha
- 60. Multiple Blurred Layers There are at most 3 layers as the background and 2 layers as
- 61. Hopping Issue with Layers But hopping tends to occur when using more than two layers We
- 62. Formula for Blur Radius The optical formula for DOF below is acquired from The Thin Lens
- 63. Conversions of Frame Buffers DOF uses the conversions of frame buffers below (details later) Swizzling Each
- 64. Pixel-Bleeding Artifacts With wider blurs, Pixel-Bleeding Artifacts were fatally emphasized Solved
- 65. Pixel-Bleeding Artifacts Solve it by blurring with a mask Use normal alpha blending so put masks
- 66. Edge on Blurred Foreground Generally, blurred objects in the foreground have sharp edges Need to expand
- 67. Edge on Blurred Foreground But using the reduced Z buffer leaves the masks a little blurred
- 68. Expand Mask Our way also blurs and scales Blending Alpha Mask but intermediate values are broken
- 69. Unexpected Soft Focus Appears among layers or between a layer and the midground, or appears a
- 70. Unexpected Soft Focus One solution is to increase the number of layers Another way is to
- 71. Intermediate Mask of Gaussian The apparent difference of depth with single layer … a little better
- 72. Intermediate Mask of Gaussian The apparent distance of objects … but with a slight dirty blur
- 73. Intermediate Mask of Gaussian Wider blur … oops! With intermediate values Regular Gaussian
- 74. Unnatural Blur Gaussian Function is different from a real camera blur The real blur function is
- 75. Z Testing when Blending Layers Advantage Clearer edge with a reduced Z buffer
- 76. Z Testing when Blending Layers Disadvantage Hopping results when objects cross the borders of layers
- 77. Converting Flow Overview DOF flow Frame Buffer Z & Color Reduced Frame Buffer Glare Effects flow
- 78. Converting Flow Overview Glare Effects flow Darken Every Frame Add to Frame Buffer Reduce Intensity Reduce
- 79. Swizzling Each Color Element from G to A or A to G Look up a PSMCT32
- 80. Swizzling Each Color Element from G to A or A to G Copy with FBMSK 8
- 81. Converting Z to RGB with CLUT Convert PSMZ24 to PSMCT32 Native PSMZ24 PSMCT32 Block order Copy
- 82. Converting Z to RGB with CLUT Look up as PSMT8
- 83. Converting Z to RGB with CLUT Requires many tiny sprites such as 8x2 or 4x2, so
- 84. Issue of Converting Z to RGB Use CLUT to convert Z to RGB, so it can
- 85. Shifting Z bits toward Upper Side Step1 Save G of the Z-buffer in alpha plane Step2
- 86. Outdoor Light Scattering
- 87. Outdoor Light Scattering Implementation of: Naty Hoffman, Arcot J Preetham. "Rendering Outdoor Light Scattering in Real
- 88. Outdoor Light Scattering Adopting Tile Base Processing High OLS fillrate causes a bottleneck, so computing colors
- 89. Additional Parameters 2nd Mie Coefficients Can represent more complex coloring No change to fill costs Green
- 90. Additional Parameters Gamma It’s fake. It isn’t correct physically But it would be most useful Gamma
- 91. Additional Parameters Horizontal Slope & Gain Use the function from “Perez all weather luminance model” with
- 92. Additional Parameters Z bit Shift Is more important than using it with DOF Not Shifted
- 93. OLS - Episode Shifting Z bits causes a side effect where objects in the foreground tend
- 94. Spherical Harmonics Lighting
- 95. How to use SH Lighting easily? Use DirectX9c! Of course, we know you want to implement
- 96. Reason to use SH Lighting on PS2 Photo-realistic lighting Global Illumination with Light Transport Traditional Lighting
- 97. Reason to use SH Lighting on PS2 Dynamic light
- 98. Reason to use SH Lighting on PS2 Subsurface scattering
- 99. PRT Precomputed Radiance Transfer was published by Peter Pike Sloan et al. in SIGRAPH 2002 Compute
- 100. What to do with PRT Limited real-time global illumination Basically objects mustn't deform Basically objects mustn't
- 101. Limited Animation SH Light position can move or rotate But SH lights are regarded as infinite
- 102. SH Spherical Harmonics : are thought to be like a 2-dimensional Fourier Transform in spherical coordinates
- 103. How is data compressed? PRT data is considered as a response to rays from all directions
- 104. How is data compressed? This is an example of response to light from all directions in
- 105. How is data compressed? If there is a function like 2D Fourier Transform in spherical coordinates;
- 106. How is data compressed? You could think of Spherical Harmonics as a 2D Fourier Transform in
- 107. How data is compressed? Use lower order coefficients of SH to compress data (It is like
- 108. Why use linear transformations? It is easy to handle with vector processors A linear transformation is
- 109. Compare linear transformations This comparison is based on current papers. Recent papers hardly take up Spherical
- 110. Details of SH we use It is tough to use SH Lighting on PlayStation 2 Therefore
- 111. Details of SH we use ( ) including Secondary Light Shader Secondary Light Shader does light
- 112. Details of SH we use This is the SH Basis we use (Cartesian coordinate) SH[0] =
- 113. Details of SH we use Our SH Shader(2bands, 1ch) code for VU1 (Main loop is 6ops)
- 114. Details of SH we use Our SH Shader(3bands, 1ch) code for VU1 (Main loop is 13ops)
- 115. Details of SH we use Engineers think that SH can be used with at least the
- 116. Differences in appearance The 2nd order is inaccurate However, it’s useful (soft shading) The 3rd and
- 117. Differences in appearance The number of channels mainly influences color bleeding (Interreflection) The number of coefficients
- 118. Differences in appearance For sub-surface scattering, color channels tend to be more important than the number
- 119. Harmonize SH traditionally We harmonize SH Lighting with traditional lights: There is a function by which
- 120. Side effects of SH Lighting Useful SH Lighting (Shading) is smoother than traditional lighting Especially, it
- 121. Side effects of SH Lighting Disadvantage SH is an approximation of BRDF But using only a
- 122. Our precomputation engine supports : Lambert diffuse shading Soft-edged shadow Sub-surface scattering Diffuse interreflection Light transport
- 123. Materials Basic settings SH coefficient setting Computation precision (Number of rays) Low Pass Filter settings Texture
- 124. Materials Interreflection settings Interreflection intensity Number of passes Interreflection low pass filter Color settings Translucent settings
- 125. Algorithms for PRT Based on (Stratified) Monte Carlo ray-tracing
- 126. PRT Engine [1st stage] Calculate diffuse and occlusion coefficients by Monte Carlo ray-tracing: Cast rays for
- 127. PRT Engine [2nd stage] Calculate sub-surface scattering coefficients with diffuse coefficients by ray-tracing We used modified
- 128. PRT Engine [3rd stage] Calculate interreflection coefficients from diffuse and sub-surface scattering coefficients: Same as computing
- 129. PRT Engine [4th stage] Repeat from the 2nd stage for number of passes After that, Final
- 130. Optimize precomputation To optimize finding of rays and polygon intersection, we used those typical approaches (nothing
- 131. Optimize precomputation Multi-threading for every calculation was very efficient Example result (with dual Pentium Xeon 3.0GHz)
- 132. Optimize precomputation SSE2 (inline assembler) for finding intersections was quite efficient Example result (with dual Pentium
- 133. Optimize precomputation File Caching System SH coefficients and object geometry are cached in files for each
- 134. What is the problem It is still slow to maximize quality with many rays Decreasing the
- 135. Solving the problem We used 2-stage low pass filters to solve it Diffuse interreflection low pass
- 136. Solving the problem We used Gaussian Filter for a low pass filter Final LPF was efficient
- 137. Solving the problem Using too strong LPF causes inaccurate images Be careful using LPF 3,000rays without
- 138. Light Transport It is our little technique for expanding SH Lighting Shader It is feasible to
- 139. Details of Light Transport It is not used on the Spherical Harmonic basis Spherical Harmonics are
- 140. Details of Light Transport To obtain Light Transport coefficients, the precomputation engine calculates all their incoming
- 141. Details of Light Transport They are automatically computed by existing global illumination engine When you set
- 142. Result of Light Transport Light Transport 11.29Hsync 6,600vertices 9,207,000vertices/sec Spherical Harmonics (4 coefficients for each channel)
- 143. Image Based Lighting Our SH Lighting engine supports Image Based Lighting It is too expensive to
- 144. Image Based Lighting IBL light coefficients are precomputed in world coordinates It means they have to
- 145. SH rotation To obtain Spherical Harmonic rotation matrices is one of the problems of handling Spherical
- 146. SH animation Our SH Lighting engine supports limited animation Skinning Morphing
- 147. SH skinning Skinning is only for the 1st and 2nd order coefficients They are just linear
- 148. SH morphing Morphing is linear interpolation between different Spherical Harmonic coefficients It is just linear interpolation,
- 149. Future work Using high precision buffer and pixel shader!! More precise Glare Effects in optics Natural
- 150. Future Work Distributed precomputation engine SH Lighting for next-gen hardware Try: Thomas Annen et al. EGSR
- 151. References Masaki Kawase. "Frame Buffer Postprocessing Effects in DOUBLE-S.T.E.A.L (Wreckless)“ GDC 2003. Masaki Kawase. "Practical Implementation
- 152. References Peter-Pike Sloan et al. “Precomputed Radiance Transfer for Real-Time Rendering in Dynamic, Low-Frequency Lighting Environments.”
- 153. Acknowledgements We would like to thank Satoshi Ishii, Daisuke Sugiura for suggestion to this session All
- 155. Скачать презентацию