1 / 40

Computer Graphics SS 2014 Sampling

Computer Graphics SS 2014 Sampling. Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung. Overview . So far : Image synthesis Ray tracing ; models , transformations , shading & lighting , textures , acceleration Today Aliasing and antialiasing techniques

geneva
Download Presentation

Computer Graphics SS 2014 Sampling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Graphics SS 2014 Sampling Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung

  2. Overview • So far: • Image synthesis • Ray tracing; models, transformations, shading & lighting, textures, acceleration • Today • Aliasing andantialiasingtechniques • Prefiltering • Supersampling • Postfiltering • Stochasticand adaptive sampling

  3. Sampling • Mathematically, point sampling using regularly spaced sample points is the multiplicationof the function with a comb function x 0 T 2T

  4. Sampling • Recall: imagesynthesismeanspointsamplingof a continuoussignal • Image containssamplesof a continuoussignal at a discretesetofpositions • Pixel spacingdeterminesthefrequencies (thesizeofdetails) thatcanbereconstructed • Undersamplingtheimage(takingtoolesssamplestoallow for thereconstructionofthesignalfromthesamples) causesaliasingartifacts (alias = ghost)

  5. Aliasing • Original sceneandluminosity (brightness) distributionalong a scanline

  6. Aliasing • Point sampling the scene at pixel centers

  7. Aliasing • The rendered image

  8. Aliasing • Jaggedprofiles

  9. Aliasing • Loss of details

  10. Aliasing • Note: thesamplingfrequencydecreaseswithincreasingdistancetotheviewpoint d0 d1 d2 d3 viewpoint

  11. Aliasing • Withincreasingdistancetotheviewerandslopeofthesurface, an ever larger surfaceareafalls in-betweenadjacentrays

  12. Aliasing • Causeofaliasing • Sampling frequencyis not highenoughto cover all details • ItisbelowtheNiquistlimit Shannons Sampling Theorem: The signalhastobesampled at a frequencythatisequaltoorhigherthantwotimesthehighestfrequency in thesignal

  13. Aliasing • Aliasing artefacts • Spatialaliasing • Temporal aliasing

  14. Antialiasing • Howtoavoidaliasingcausedby an undersamplingofthesignal, i.e. thesamplingfrequencyis not highenoughto cover all details • Supersampling - increasesamplingfrequency • Prefiltering - decreasethehighestfrequency in thesignal, i.e. filterthesignalbeforesampling • Postfiltering– filtering after sampling, but just blurrestheimage

  15. Antialiasing • Supersampling- increasesamplingfrequency • Usemorerays per pixel, i.e. virtuallyincreasetheresolutionofthepixel raster • e.g. use 4x4 rays per pixel and computeaverageof all 16 colorsas final pixelcolor • Sharp edgesarewashed out • OK, but doesn´teliminatealiasingbecause sharp edgescontaininfinitelyhighfrequencies

  16. Antialiasing • Supersampling • Regular supersampling

  17. Antialiasing • Filtering: average weighted samples

  18. Antialiasing • Filtering example

  19. Antialiasing • Filtering - jitteredinsteadofregularsampling

  20. Antialiasing • Regular sampling • Visibilityofaliasesalso causedbytheregularsamplinggrid • Human visualsystemis sensitive againstregularstructures, but ratherinsensitiveagainsthigh frequencynoise • Stochasticsupersampling • Place samplesrandomlywithinpixel • Alias frequenciesareconvertedtonoise • But canresult in clustersof sample

  21. Antialiasing • Poisson-disksampling • Random generationofsampleswithlimitfortheminimumdistancebetweensamples • Jitteredsampling • Random jitteringfromregulargridpoints • Stratifiedrandomsampling • Regular partitioningofpixelregion • Onerandom sample per partition

  22. Antialiasing • Comparison • Regular, 1x1Regular 3x3Regular, 7x7Jittered, 3x3Jittered, 7x7

  23. Antialiasing • Example:

  24. Antialiasing • Example:

  25. Antialiasing • Example:

  26. Antialiasing • Example:

  27. Antialiasing • Prefiltering • Antialiasing beforesampling (mainlyused in texturemapping) • Filtering (smoothing) a signaltoremovedetailsbelowthefrequencywhichisusedto sample thesignal

  28. Antialiasing • Prefiltering combines color contributions into a pixel

  29. Antialiasing in texturemapping • Manytexels fall ontoonepixels

  30. Antialiasing in texturemapping • Mip-Mapping:prefilteredlevels of detail (LOD) in a pyramid • At every level:average 2x2texels from thefiner levelinto one texel

  31. Antialiasing in texturemapping

  32. Antialiasing in texturemapping

  33. Antialiasing in texturemapping • Mip-Mapping: howdoesitwork? • When a fragmentistexturemapped, themip-maplevelatwhichthetexelsizeisequaltothepixelsizeiscomputed • Fromthislevelthetextureisthensampled • Itremainstobeansweredhowtheleveliscomputed

  34. Antialiasing in texturemapping • Wewanttoknowwhatthesizeofonetexelwrtthesizeofonepixelis – thisallowsestimatinghowmanytexels fall intoonepixel

  35. Antialiasing in texturemapping • Computing themip-maplevel:Check screen pixel “size” in texture coordinates less than one texel per pixelwe call this magnification more than one texel per pixelwe call this minification u,v: fragmentstexturecoordinates x,y: pixelcoordinates

  36. Antialiasing in texturemapping

  37. Antialiasing in texturemapping without MipMapping with MipMapping

  38. Antialiasing in texturemapping Isotropicfiltering (mipmapping) Anisotropicfiltering

  39. Sample 0 assign Select resolution interpolate Sample 1 Antialiasing in texturemapping • Mip-Mapping • The mip-maponlystores a discretesetoflevels • Ifpixelsizematchestexelsizeat a level in between, itisinterpolatedbetweenthetwoadjacentlevels Bilinear in texture + linear betweenlevels = trilinear

  40. Summary • Quality ofrenderingstronglydepends on antialiasingalgorithmsused • Typically, supersampling in combinationwithprefilteringisused • Supersamplingandmipmapping • Wearenowreadytoimplement a highquality and efficientraytracingalgorithm • Whatcomesnextis an alternative imagesynthesisapproachbased on theprojectionofgeometryontotheimage plane

More Related