Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction | Crepuscular rays and Caustics Caustics are high intensity highlights due to convergence of light via different paths Crepuscular rays (godrays)

Similar presentations


Presentation on theme: "Introduction | Crepuscular rays and Caustics Caustics are high intensity highlights due to convergence of light via different paths Crepuscular rays (godrays)"— Presentation transcript:

1

2 Introduction | Crepuscular rays and Caustics Caustics are high intensity highlights due to convergence of light via different paths Crepuscular rays (godrays) are formed by the in-scattering of light in dense participating media, like water Why are godrays and caustics important? –Both phenomena present in shallow water environments –They convey the presence of a dense volume –Define the proximity and direction of surface and lighting

3 Introduction | Offline rendering Caustics: –Bidirectional ray tracing –Particle tracing from light source (sun) Local contribution to shading (no gathering step) Godrays: –Ray marching - Integration of in/out-scattering functions over the line of sight in view direction. Monte Carlo integration Stratified sampling with constant jittering

4 Moving to Real Time | Early Approaches Caustics –Render the caustics as an animated texture –Projective texturing –Inverse tracing of rays to a light map above water using surface vertex data –Intersect geometric light shafts (polyhedra) with receiving geometry Godrays –Render godrays as geometry “shafts” (polyhedra) –Sample a variable density function on planes parallel to the view plane.

5 Moving to Real Time | Particle Tracing? Generic GPU-based particle tracing: –Fully captures the effects –Unsuitable for real-time rendering (too slow) Point-based particle tracing (splatting) –Can effectively model caustics –Replaces near-sample search (particle tracing) by point accumulation –The approach: Considers light-space line segments Intersects segments with Z-buffer Accumulates point samples in frame buffer –Does not account for godrays

6 Our Method | Introduction Specialized particle tracing Traces particles from the light through the water surface to the underwater part of the scene Handles both caustics and godrays Compatible with both direct and deferred rendering schemes

7 Our Method | Overview Render the scene (camera view)  depth buffer Render the scene (light view)  shadow map Create photon mask Cast photons: –Generate coarse light-space point grid –Tesselate the grid –Cast photons and create refracted trajectories –Intersect trajectories with depth buffer  photon positions –Produce underwater godray line segments Draw (image space splatted) photons  caustics Draw (image space weighted) godrays Filter caustics and godrays Combine results Mask

8 Frame Preparation Rendering: –The scene is normally rendered –We record the frame buffer (in FBO) –The shadow map of the “sun” light source is captured The above steps are standard to any rendering engine Photon (shadow) mask: –The shadow map is compared with the water level –No photons will be cast for lit points above water level (outside the water volume) –Saves on calculations –Ensures proper shadowing for floating props Mask Shadow map Depth buffer

9 Photon Tracing | Photon generation (in light space) Render a coarse grid of points In a geometry shader: –Tesselate grid –Generate primary ray –Produce refracted ray –Calculate intersection point between refracted ray and shadow map

10 Photon Tracing | Intersection estimation Uses an Newton-Rhapson-like image space (shadow map) estimator Approximates the intersection point in two iterations: Water surface intersection Initial estimate d Water surface intersection second estimate d Water surface intersection final point projection A B

11 Rendering the Caustics | Splatting Splatting replaces the photon storage and search stage of conventional photon mapping Photons are transformed to screen space and rendered as points We splat the photons by perspectively varying the point primitive size: –Account for perspective foreshortening –Ensure adequate blending for photons near view plane –Avoid excessive overlap for distant photons Points are attenuated according to distance from water surface (absorption) γ = 9.2W/sr

12 Rendering the Caustics | Splatting

13 Rendering the Godrays Godrays are rendered as line primitives in screen space They are attenuated per fragment accounting for: –Fragment-to-eye absorption (out-scattering) –Surface-to-fragment absorption (out-scattering) –Light-to-viewing direction contribution (in-scattering) Mie scattering is modeled by the Henyey-Greenstein phase function d fromViewer Line frags

14 Post-Filtering In low-intensity areas (poor photon concentration), aliasing may occur The same goes for the godrays Both buffers are post-filtered to spread the intensity We use a rotating-kernel joint bilateral gaussian filter –Kernel size is modulated by depth

15 Post-Filtering | Caustics Unfiltered Filtered

16 Post-Filtering | Godrays Unfiltered Filtered

17 Putting it All Together Godrays + caustics + filtering + SSAO + shadows: 1440X850 @ 60+ fps 800X600 @ 110+ fps

18 Thank you! The work presented in this paper is funded by the Athens University of Economics and Business Special Account for Research Grants (EP-1600- 10/00-1)


Download ppt "Introduction | Crepuscular rays and Caustics Caustics are high intensity highlights due to convergence of light via different paths Crepuscular rays (godrays)"

Similar presentations


Ads by Google