310 likes | 335 Views
Instant Radiosity. Paper by Alexander Keller. What is Radiosity?. Perfect Diffuse Interaction View-Independent Must be Followed By Projection Computation May have a post-process Ray Tracing enhancement. Process. An array of emitting patches
E N D
Instant Radiosity Paper by Alexander Keller
What is Radiosity? • Perfect Diffuse Interaction • View-Independent • Must be Followed By Projection Computation • May have a post-process Ray Tracing enhancement
Process • An array of emitting patches • Diffuse-Diffuse Interaction between light patch and all receiving patches • Mostly iterative procedure • Applied to ENTIRE scene.
Advantages • Needs only be calculated once • Only if geometry changes is there a need to recalculate the form factors • If lighting changes then only equation needs resolving • Viewport changes do not need a form factor recalculation
Problems • Basic Radiosity Solution is Slow • Procedural Process • Must cover entire scene
Instant Radiosity Solution • Operates on the textured scene • Produce photorealistic images without any finite kernel or solution discretization of underlying integral equation • Rendering rates of a few seconds are obtained by • Hardware, quasi-random walk, jittered low discrepancy sampling. • Does NOT need to evaluate form factors or generate meshes
Algorithm Basics • Photons are traced from the light source into the scene • At the origin of the path of the photon, and where it hits a scene a point light is placed • The scene is rendered several times for each light source • Resulting image is composited in the accumulation buffer (hardware)
Algorithm Basics • Generates a particle approximation of the diffuse radiant scene using Quasi-random walk based on quasi-Monte Carlo integration • Hardware renders an image with shadows for each particle used as point light source • Illumination is obtained by summing up the single images in an accumulation buffer and displaying the result
The Algorithm • Calculate the average radiance passing through a pixel • Add that to a discrete density of point light sources • Evaluated for all pixels of the image matrix
In Mathematical Terms • The Radiance of m to n is an approximation of • Source Radiance * Avg Radiance from m to n • + • The Sum from 0 to M – 1 points of light of • Reflectiveness(BRDF) * Radiance of light i * Kronecker delta function of The point on the surface – the position of light i
Pseudocode Variable Defs • N – Number of Particles • – average reflectivity • w – attenuation • L – radiance of a point • y – point on the surface • – aligned normal to y
Pseudocode 1st Level Loop • Фn(i) – Base n Halton Sequence • yo(Ф2(i), Ф3(i)) – Isometry from unit square to onto each light source • Le(y) * supp Le – Sum of source radiance for y * support of the light sources
Pseudocode 2nd Level Loop • - Shoot A ray into direction • - Return the first point hit when shooting a ray from y into • - Reflectivity of the diffuse surface texture /
GL Calls • glRenderShadowedScene(LightPower,LightPosition) • 2d image that doesn't 'see' that light is black, otherwise it is colored as usual (hard shadows) • glAccum(GL_ACCUM, weight) • 2d image that was rendered in previous step added to current accumulated buffer • Repeated for different bright spots until N iterations are complete. Result is a soft shadowed scene that can be rendered very quickly in OpenGL
Disadvantages • View-dependency • Rendering tens to hundreds of light sources each frame is too costly • Somewhat more suitable for generating quick previews than interactive walkthroughs • Not very precise • Many point sources have to be rendered for accurate images • Problematic! Accumulation buffer only has a limited precision!
Walkthroughs • They are possible • We could render each lit surface into a texture, and use these as light maps • Very time consuming since for every texture a lot of images have to be composited • Keep last N images from the last N paths in memory, while the system keeps rendering new images for new paths • When an image is finished, the oldest image is replaced by the new one. • Suited for extremely slow walkthroughs
Specular Effects • Specular Effects • Let the algorithm use a full BRDF in the hardware lighting pass, enabling specular highlights • In The particle generation phase, random surfaces are tested to be specular or diffuse. • Virtual Lights for specular object
Conclusions • Provides quickly rendered images for the Global Illumination problem • Low precision • Inherent upper bounds issues with respect to hardware
OpenGL Implementation • 2D Points and the Depth Buffer • Shadow Maps • Software Restraints • Accumulation Buffer • Hardware Issues • Results
Applications • Stored Z Values for an X,Y point • Clamped [0, 1] • Crude vector-object collision detection • Special Cases • Shadow Maps • Hardware Restraints • Software Restraints
Accumulation Buffer • Not Hardware Accelerated (Most Cases) • Average execution time • N = 300 • ~265 seconds total • ~270 for Software Render • ~264 seconds in accumulator