page 1
play

Page 1 1 Review: Aliasing Review: Sampling Theorem and Nyquist - PDF document

University of British Columbia News CPSC 314 Computer Graphics P1 Hall of Fame take 2 May-June 2005 P4 grading signup Tamara Munzner 12-4 Mon Jun 20 Scientific Visualization, Information Visualization I/II Week 5, Thu Jun 9


  1. University of British Columbia News CPSC 314 Computer Graphics � P1 Hall of Fame take 2 May-June 2005 � P4 grading signup Tamara Munzner � 12-4 Mon Jun 20 Scientific Visualization, Information Visualization I/II Week 5, Thu Jun 9 http://www.ugrad.cs.ubc.ca/~cs314/Vmay2005 � Review: Image As Signal Review: Summing Waves I � 1D slice of raster image � discrete sampling of 1D spatial signal � theorem � any signal can be represented as an (infinite) sum of sine waves at different frequencies ��������� ������������������������������ ������������������������������������������������ � � Review: Summing Waves II Review: 1D Sampling and Reconstruction � represent spatial � problems signal as sum of � jaggies – abrupt changes sine waves � lose data (varying frequency and phase shift) � very commonly used to represent sound “spectrum” ! Page 1 1

  2. Review: Aliasing Review: Sampling Theorem and Nyquist Rate � Shannon Sampling Theorem � incorrect appearance of high frequencies as � continuous signal can be completely recovered from low frequencies its samples iff sampling rate greater than twice � to avoid: antialiasing maximum frequency present in signal � supersample � sample past Nyquist Rate to avoid aliasing � sample at higher frequency � twice the highest frequency component in the image’s spectrum � low pass filtering � remove high frequency function parts � aka prefiltering, band-limiting " # Review: Supersampling Review: Low-Pass Filtering $ %& Review: Invisible Primitives Review: Back-Face Culling � why might a polygon be invisible? � on the surface of a closed orientable � polygon outside the field of view / frustum manifold, polygons whose normals point � solved by clipping away from the camera are always � polygon is backfacing occluded: � solved by backface culling � polygon is occluded by object(s) nearer the viewpoint � solved by hidden surface removal note: backface culling alone doesn’t solve the hidden-surface problem! %% %� Page 2 2

  3. Review: Painter’s Algorithm Review: BSP Trees � draw objects from back to front � preprocess: create binary tree � problems: no valid visibility order for � recursive spatial partition � viewpoint independent � intersecting polygons � cycles of non-intersecting polygons possible %� %� Review: BSP Trees Review: Warnock’s Algorithm � runtime: correctly traversing this tree enumerates � start with root viewport objects from back to front and list of all objects � recursion: � viewpoint dependent � clip objects to � check which side of plane viewpoint is on at each node viewport � draw far, draw object in question, draw near � if only 0 or 1 objects � pros � done � simple, elegant scheme � else � works at object or polygon level � subdivide to new smaller viewports � cons � distribute objects to � computationally intense preprocessing stage restricts new viewpoints algorithm to static scenes � recurse % %! Review: Warnock’s Algorithm Review: Z-Buffer Algorithm � augment color framebuffer with Z-buffer or � termination depth buffer which stores Z value at each � viewport is single pixel pixel � at frame beginning, initialize all pixel depths � explicitly check for to ∞ object occlusion � when rasterizing, interpolate depth (Z) � single-pixel case across polygon common in high � check Z-buffer before storing pixel color in framebuffer and storing depth in Z-buffer depth complexity � don’t write pixel if its Z value is more distant scenes than the Z value already stored there %" %# Page 3 3

  4. Review: Back-Face Culling Review: Back-face Culling � most objects in scene are typically “solid” VCS VCS N 0 culling < � rigorously: orientable closed manifolds culling Z y y sometimes sometimes above above � orientable: must have two distinct sides misses polygons that misses polygons that below below No should be culled should be culled � cannot self-intersect z z eye eye � sphere is orientable instead, cull if eye is instead, cull if eye is � boundary partitions space into interior & exterior below polygon plane below polygon plane � Mobius strip or Klein bottle is not orientable Yes � do not partition space into interior & exterior NDCS NDCS above above � closed: cannot “walk” from one side to other eye eye y y below below � sphere is closed manifold, plane is not N z z 0 works to cull if works to cull if > Z � manifold: local neighborhood of all points isomorphic to disc No %$ �& Review: Rendering Pipeline Clarification/Review: Depth Test Precision object world viewing clipping � reminder: projective transformation maps VCS OCS OCS WCS WCS VCS CCS CCS eye-space z to generic z -range (NDC) /w /w Geometry Geometry Geometry Model/View Model/View Model/View Perspective Perspective Perspective Lighting Lighting Clipping Clipping Lighting Clipping � � Database Database Transform. Transform. Transform. Transform. Transform. 2 n r l Database Transform. + � � � � x � 0 0 � x N E � � r l r l � � − − � � (4D) � � 2 n t b � � + y � � y 0 0 � N � � E � normalized � � = t b t b ⋅ − − � � � � � � z ( f n ) 2 fn z − + − device � N � � E � 0 0 � � NDCS NDCS f n f n � � − − � � � � � � � � w w screen N � � E 0 0 1 0 − SCS SCS device (3D) � thus z N ~= 1/z E (2D) DCS DCS z f n 2 fn w + Frame- Frame Scan Scan Scan Depth Depth Frame- Depth ( f n ) 2 fn N E − + − Texturing Texturing = + Texturing Blending Blending Blending z z w , w z Conversion Conversion buffer buffer buffer = + = − Conversion Test Test Test w f n f n z − − N E E N E f n f n N E − − �% �� Reading � FCG Chapter 23 Scientific Visualization �� �� Page 4 4

  5. Surface Graphics Surface Graphics � pros � objects explicitly defined by surface or � fast rendering algorithms available boundary representation � hardware acceleration cheap � mesh of polygons � OpenGL API for programming � use texture mapping for added realism � cons � discards interior of object, maintaining only the shell � operations such cutting, slicing & dissection not possible � no artificial viewing modes such as semi- transparencies, X-ray � surface-less phenomena such as clouds, fog & gas are hard to model and represent 1000 polys 200 polys 15000 polys � �! Volume Graphics Volume Graphics � for some data, difficult to create polygonal mesh � pros � voxels: discrete representation of 3D object � formidable technique for data exploration � volume rendering: create 2D image from 3D object � cons � translate raw densities into colors and � rendering algorithm has high complexity! transparencies � special purpose hardware costly (~$3K-$10K) � different aspects of the dataset can be emphasized via changes in transfer functions �" �# volumetric human head (CT scan) Isosurfaces Volume Graphics: Examples � 2D scalar fields: isolines � contour plots, level sets � topographic maps � 3D scalar fields: isosurfaces industrial CT - structural failure, anatomical atlas from visible security applications human (CT & MRI) datasets shockwave visualization: simulation flow around airplane wing with Navier-Stokes PDEs �$ �& Page 5 5

  6. Isosurface Extraction MC 1: Create a Cube � array of discrete point � consider a cube defined by eight data values � � � � � samples at grid points � 3D array: voxels � � � � � (i,j+1,k+1) (i+1,j+1,k+1) � find contours � � � � � � closed, continuous (i,j,k+1) (i+1,j,k+1) � determined by iso-value � � � � � � several methods � marching cubes is most � � � � (i,j+1,k) (i+1,j+1,k) � common ������������� (i,j,k) (i+1,j,k) �% �� MC 2: Classify Each Voxel MC 3: Build An Index � classify each voxel according to whether lies � binary labeling of each voxel to create index � outside the surface (value > iso-surface value) � inside the surface (value <= iso-surface value) 10 v8 10 v7 �������� ����� ��������� ��������� 5 v4 5 v3 10 v5 �������� 8 v6 ����� ������ 8 8 v1 v2 ������� �������� �� �� �� �� �� �� �� �� �� �� MC 4: Lookup Edge List MC 4: Example � use index to access array storing list of edges � index = 00000001 � all 256 cases can be derived from 15 base � triangle 1 = a, b, c cases � � � � �! Page 6 6

Recommend


More recommend