Click here to load reader

Introduction | Crepuscular rays and Caustics

  • View

  • Download

Embed Size (px)


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? - PowerPoint PPT Presentation

Text of Introduction | Crepuscular rays and Caustics

  • Introduction | Crepuscular rays and CausticsCaustics are high intensity highlights due to convergence of light via different pathsCrepuscular 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 environmentsThey convey the presence of a dense volumeDefine the proximity and direction of surface and lighting

  • Introduction | Offline rendering Caustics:Bidirectional ray tracingParticle 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 integrationStratified sampling with constant jittering

  • Moving to Real Time | Early Approaches

    CausticsRender the caustics as an animated textureProjective texturingInverse tracing of rays to a light map above water using surface vertex dataIntersect geometric light shafts (polyhedra) with receiving geometry

    GodraysRender godrays as geometry shafts (polyhedra)Sample a variable density function on planes parallel to the view plane.

  • Moving to Real Time | Particle Tracing?Generic GPU-based particle tracing:Fully captures the effectsUnsuitable for real-time rendering (too slow)

    Point-based particle tracing (splatting)Can effectively model causticsReplaces near-sample search (particle tracing) by point accumulationThe approach:Considers light-space line segmentsIntersects segments with Z-bufferAccumulates point samples in frame bufferDoes not account for godrays

  • Our Method | IntroductionSpecialized particle tracing Traces particles from the light through the water surface to the underwater part of the sceneHandles both caustics and godraysCompatible with both direct and deferred rendering schemes

  • Our Method | OverviewRender the scene (camera view) depth bufferRender the scene (light view) shadow mapCreate photon mask Cast photons:Generate coarse light-space point gridTesselate the gridCast photons and create refracted trajectoriesIntersect trajectories with depth buffer photon positionsProduce underwater godray line segmentsDraw (image space splatted) photons causticsDraw (image space weighted) godraysFilter caustics and godraysCombine results


  • Frame PreparationRendering:The scene is normally renderedWe record the frame buffer (in FBO)The shadow map of the sun light source is capturedThe above steps are standard to any rendering enginePhoton (shadow) mask:The shadow map is compared with the water levelNo photons will be cast for lit points above water level (outside the water volume)Saves on calculations Ensures proper shadowing for floating propsMaskShadow mapDepth buffer

  • Photon Tracing | Photon generation(in light space)Render a coarse grid of pointsIn a geometry shader:Tesselate gridGenerate primary rayProduce refracted rayCalculate intersection point between refracted ray and shadow map

  • Photon Tracing | Intersection estimationUses an Newton-Rhapson-like image space (shadow map) estimatorApproximates the intersection point in two iterations: Water surface intersectionInitial estimateInitial estimatedWater surface intersectionsecond estimatedWater surface intersectionfinal pointprojectionprojectionA B

  • Rendering the Caustics | SplattingSplatting replaces the photon storage and search stage of conventional photon mappingPhotons are transformed to screen space and rendered as pointsWe splat the photons by perspectively varying the point primitive size:Account for perspective foreshorteningEnsure adequate blending for photons near view planeAvoid excessive overlap for distant photons

    Points are attenuated according to distance from water surface (absorption) = 9.2W/sr

  • Rendering the Caustics | Splatting

  • Rendering the GodraysGodrays are rendered as line primitives in screen spaceThey 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

    dfromViewerLine frags

  • Post-FilteringIn low-intensity areas (poor photon concentration), aliasing may occurThe same goes for the godraysBoth buffers are post-filtered to spread the intensityWe use a rotating-kernel joint bilateral gaussian filterKernel size is modulated by depth

  • Post-Filtering | CausticsUnfiltered Filtered

  • Post-Filtering | GodraysUnfiltered Filtered

  • Putting it All Together

    Godrays + caustics + filtering + SSAO + shadows: 1440X850 @ 60+ fps 800X600 @ 110+ fps

  • 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)