Point-Based Rendering
Total Page:16
File Type:pdf, Size:1020Kb
Point-Based Rendering • Introduction and motivation Point-Based Rendering • Surface elements •Rendering • Antialiasing Matthias Zwicker • Hardware Acceleration Computer Graphics Lab • Conclusions ETH Zürich Point-Based Computer Graphics Matthias Zwicker 1 Point-Based Computer Graphics Matthias Zwicker 2 Motivation 1 Motivation 1 • Performance of 3D hardware has exploded (e.g., GeForce4: 136 million vertices per second) • Projected triangles are very small (i.e., cover only a few pixels) • Overhead for triangle setup increases (initialization of texture filtering, rasterization) Quake 2 Nvidia GeForce4 A simpler, more efficient rendering 1998 2002 primitive than triangles? Point-Based Computer Graphics Matthias Zwicker 3 Point-Based Computer Graphics Matthias Zwicker 4 Points as Rendering Motivation 2 Primitives • Modern 3D scanning devices • Point clouds instead of triangle meshes [Levoy and (e.g., laser range scanners) Whitted 1985, Grossman and Dally 1998, Pfister et acquire huge point clouds al. 2000] • Generating consistent triangle meshes is time consuming and difficult A rendering primitive for direct visualization of point clouds, without the need to triangle mesh (with point cloud generate triangle meshes? 4 million pts. [Levoy et al. 2000] textures) Point-Based Computer Graphics Matthias Zwicker 5 Point-Based Computer Graphics Matthias Zwicker 6 1 Point-Based Surface Representation Surface Elements - Surfels •Points are samples of the surface • Each point corresponds to a surface • The point cloud describes: element, or surfel, describing the surface in • 3D geometry of the surface a small neighborhood • Surface reflectance properties (e.g., diffuse color, etc.) • Basic surfels: • There is no additional information, such as • connectivity (i.e., explicit BasicSurfel { y neighborhood information between position points) position; color • texture maps, bump maps, etc. color; z } x Point-Based Computer Graphics Matthias Zwicker 7 Point-Based Computer Graphics Matthias Zwicker 8 Surfels Surfels • How to represent the surface between the • Surfels can be extended by storing additional points? attributes • This allows for higher quality rendering or advanced shading effects holes between the points ExtendedSurfel { position; normal color; position • Surfels need to interpolate the surface normal; between the points radius; color radius •A certain surface area is associated with etc... surfel disc each surfel } Point-Based Computer Graphics Matthias Zwicker 9 Point-Based Computer Graphics Matthias Zwicker 10 Surfels Model Acquisition • Surfels store essential information for • 3D scanning of physical objects rendering • See Pfister, acquisition • Surfels are primarily designed as a • Direct rendering of acquired point clouds point rendering primitive • No mesh reconstruction necessary • They do not provide a mathematically smooth surface definition (see [Alexa 2001], point set surfaces) [Matusik et al. 2002] Point-Based Computer Graphics Matthias Zwicker 11 Point-Based Computer Graphics Matthias Zwicker 12 2 Model Acquisition Model Acquisition • Sampling synthetic objects • Processing and editing of point-sampled • Efficient rendering of complex models geometry • Dynamic sampling of procedural objects and animated scenes (see Stamminger, dynamic sampling) spectral processing point-based surface editing [Pauly, Gross 2002] [Zwicker et al. 2002] (see Gross, spectral processing) (see Pauly, Pointshop3D) [Zwicker et al. 2001] [Stamminger et al. 2001] Point-Based Computer Graphics Matthias Zwicker 13 Point-Based Computer Graphics Matthias Zwicker 14 Point Rendering Pipeline Point Rendering Pipeline Point Frame- Cloud buffer Forward Filtering Image Visibility Warping and Shading Reconstruction Forward Filtering Image Visibility Warping and Shading Reconstruction • Perspective projection of each point in the point cloud • Simple, pure forward mapping pipeline • Analogous to projection of triangle • Surfels carry all information through the pipeline („surfel stream“) vertices • No texture look-ups • homogeneous matrix-vector product • Framebuffer stores RGB, alpha, and Z • perspective division Point-Based Computer Graphics Matthias Zwicker 15 Point-Based Computer Graphics Matthias Zwicker 16 Point Rendering Pipeline Point Rendering Pipeline Forward Filtering Image Forward Filtering Image Visibility Visibility Warping and Shading Reconstruction Warping and Shading Reconstruction •Per-point shading • Visibility and image reconstruction is • Conventional models for shading (Phong, performed simultaneously Torrance-Sparrow, reflections, etc.) • Discard points that are occluded from the • High quality antialiasing is an advanced current viewpoint topic discussed later in the course • Reconstruct continuous surfaces from projected points Point-Based Computer Graphics Matthias Zwicker 17 Point-Based Computer Graphics Matthias Zwicker 18 3 Visibility and Image Overview Reconstruction without visibility and with visibility and image reconstruction image reconstruction Forward Filtering Image Visibility Warping and Shading Reconstruction 2. 1. foreground point occluded background point surface discontinuity (“hole”) Point-Based Computer Graphics Matthias Zwicker 19 Point-Based Computer Graphics Matthias Zwicker 20 Quad Rendering Image Reconstruction Primitive • Goal: avoid holes • Draw a colored quad centered at the projected point • Use surfel disc radius r to cover • The quad side length is h, where h = 2 * r * s surface completely •The scaling factors given by perspective projection and viewport transformation 3D object space • Hardware implementation:screen spaceOpenGL GL_POINTS normal colored quad surfel disc h projected point } radius r y x Point-Based Computer Graphics Matthias Zwicker 21 Point-Based Computer Graphics Matthias Zwicker 22 Projected Disc Rendering Primitive Comparison • Project surfel discs from object to screen space • Quad primitive • Projecting discs results in ellipses in screen space • Low image quality (primitives do not adapt to • Ellipses adapt to the surface orientation surface orientation) screen space object space • Efficient rendering normal • Supported by conventional 3D accelerator hardware (OpenGL GL_POINTS) • Projected disc primitive surfel disc y y • Higher image quality (primitives adapt to surface orientation) z • Not directly supported by graphics hardware x x • Higher computational cost projected surfel disc Point-Based Computer Graphics Matthias Zwicker 23 Point-Based Computer Graphics Matthias Zwicker 24 4 Visibility: Z-Buffering Splatting • No blending of rendering primitives • A splat primitive consists of a colored point primitive and an alpha mask framebuffer pixel z1 z >z 1 2{ y * y = y z2 y x x x z colored point alpha mask splat primitive x primitive c w(x,y) c * w(x,y) (often a 2D Gauss function) Point-Based Computer Graphics Matthias Zwicker 25 Point-Based Computer Graphics Matthias Zwicker 26 Splatting Splatting • The final color c(x,y) is computed by additive alpha blending, i.e., by computing the weighted without normalization with normalization sum color of splat i alpha of splat i at position (x,y) c w (x, y) c(x, y) = ∑i i i w (x, y) ∑i i • Normalization is necessary, because the weights do not sum up to one with irregular point distributions varying brightness no artifacts w (x, y) ≠ 1 because of irregular ∑i i point distribution Point-Based Computer Graphics Matthias Zwicker 27 Point-Based Computer Graphics Matthias Zwicker 28 Splatting Extended Z-Buffering • Extended z-buffering surface 1 surface 2 DepthTest(x,y) { if (abs(splat z – z(x,y)) < threshold) { c(x,y) = c(x,y) + splat color w(x,y) = w(x,y) + splat w(x,y) } else if (splat z < z(x,y)) { z(x,y) = splat z c(x,y) = splat color z-buffer pixel surfel disc w(x,y) = splat w(x,y) z } z-threshold discard splats accumulate } splats Point-Based Computer Graphics Matthias Zwicker 29 Point-Based Computer Graphics Matthias Zwicker 30 5 Splatting Comparison High Quality Splatting elliptical circular splats surface • High quality splatting requires careful splats with min. radius splatting minif. analysis of aliasing issues • Review of signal processing theory • Application to point rendering • Surface splatting [Zwicker et al. 2001] magnif. 128 x 192 128 x 192 128 x 192 Point-Based Computer Graphics Matthias Zwicker 31 Point-Based Computer Graphics Matthias Zwicker 32 Aliasing in Computer Aliasing in Computer Graphics Graphics • Aliasing = Sampling of continuous functions • Aliasing: high frequencies in the input signal below the Nyquist frequency appear as low frequencies in the • To avoid aliasing, sampling rate must be twice as reconstructed signal high as the maximum frequency in the signal •Aliasingeffects: • Loss of detail • Moire patterns, jagged edges • Disintegration of objects or patterns • Aliasing in Computer Graphics • Texture Mapping • Scan conversion of geometry Point-Based Computer Graphics Matthias Zwicker 33 Point-Based Computer Graphics Matthias Zwicker 34 Occurrence of Aliasing Aliasing-Free Reconstruction Spatial Domain Frequency Domain Spatial Domain Frequency Domain Spatial Domain Frequency Domain Spatial Domain Frequency Domain Point-Based Computer Graphics Matthias Zwicker 35 Point-Based Computer Graphics Matthias Zwicker 36 6 Antialiasing Resampling •Prefiltering discrete input signal discrete output signal • Band-limit the continuous signal before sampling warp • Eliminates all aliasing (with an ideal low-pass filter) • Closed form solution not available in general resampling • Supersampling 1. 4. •Raise