170 likes | 361 Views
Splatting. Josh Anon Advanced Graphics 1/29/02. Types of Rendering Algorithms. Backward mapping Image plane mapped into data Ray casting Forward mapping Map data onto image plane Accumulate image front-back, back-front Image complete when every data point displayed or pixel “full”.
E N D
Splatting Josh Anon Advanced Graphics 1/29/02
Types of Rendering Algorithms • Backward mapping • Image plane mapped into data • Ray casting • Forward mapping • Map data onto image plane • Accumulate image front-back, back-front • Image complete when every data point displayed or pixel “full”
Backward Mapping Problems • Basic parallel solns require volume be duplicated at each node • Input values often not right on ray, so interpolated • Requires anti-aliasing to correct for tri-linear interpolation
Goal of Splatting • Avoid artifacts from convential volume rendering • Simplify computation • Parallelize, lookup tables, etc. • Be fast!
Enter Forward Mapping Algo • Treat each data point in isolation so avoid replicating volume • Since working in 2D with a footprint function, don’t have to interpolate • Footprint = area of pixels a voxel affects • Uses tables as often as possible
Basic Algorithm • Input mapped to screen space • Density, gradient strength/direction, and screen coordinates • Packet then shaded • Splatted • Composited
Screen mapping • DDA Dx Dy Dz dx/di dx/dj dx/dk dy/di dy/dj dy/dk dz/di dz/dj dz/dk Di Dj Dk =
Shading • 4 tables • Emitted color • Reflected color • Opacity • Table to modulate opacity • Also use gradient vector for each sample (generated during pre-processing)
Calculations • Iemit = Tableemit[indexemit] • Idiff = Tablerefl[indexrefl] * dot(l, g) • Ispec = Tablerefl[indexrefl] * dot(h, g)n • L: light vector, g: gradient, h: vector half-way between eye and light, n: specular power • Ifin = Iemit + Idiff + Ispec
Opacity • Afin = Tableopac[indexopac] * Tablemod[indexmod] • Colors in table are opaque color, so color attenuated by opacity during combining phase
Reconstruction • Backward mapping associates pixel w/ n samples • Forward mapping associates a sample w/ n pixels • Reconstruct image-space voxels by using a filter
Reconstruction… • Vol reconstruction eqn • i ranges over input samples in kernel centered @ (x,y,z) • Effect @ point(x,y,z) from sample i is:
Combining Samples • Old: integrate brightness along view direction • New: footprint function that lets you compute the weight of a pixel affected by a sample
Using Tables • Footprint independent spatial position, so store in a table • When rendering, multiple RGBA by table value and add to buffer • Splatting: process of table lookup, weighting, and combining
Sample front-back traversal • Io = Ic + ((1-Ac) * (In*An)) • Ao = Ac + ((1-Ac) * An) • I: intensity, A: opacity, o: output, c: what’s in image buffer, n: point
Results • 96x128x113 CT scan rendered at full res in < 3 minutes (low-res at ~3 seconds) • (Except for a Sun-3/60M w/ 8MB memory) • Certainly faster on today’s machines, esp if using hardware