














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Various techniques for texturing and filtering in opengl, including mipmapping, anisotropic filtering, multisample antialiasing, and occlusion queries. Topics covered include automatic mipmap generation, anisotropic texture filtering, non-power-of-two textures, multisample antialiasing, and occlusion queries. Understand the concepts behind these techniques and their applications in computer graphics.
Typology: Study notes
1 / 22
This page cannot be seen from the preview
Don't miss anything!















๎ (^) Mipmapping ๎ Automatic mipmap generation ๎ (^) Generate mipmaps on the GPU ๎ (^) Framebuffer attached textures ๎ (^) Anisotropic texture filtering ๎ (^) Non-power-of-two textures ๎ Multisample Antialiasing
๎ (^) Continuous signal represented as discrete samples ๎ Nyquist sampling rate ๎ (^) At least 2 times the highest frequency in the image Continuous signal and undersampled reconstruction.
๎ Mip (โ multum in parvoโ = โmany in a small placeโ ) ๎ Representation of an image at multiple scales ๎ (^) High spatial resolution image with high frequencies ๎ (^) Lower spatial resolution image with low frequencies To generate mipmaps : ๎ (^) Start from the highest resolution image (level = 0) ๎ (^) Smooth (low pass filter) ๎ (^) Subsample (take every other pixel)
๎ (^) Magnification ๎ (^) GL_NEAREST โ nearest texel center (1) ๎ (^) GL_LINEAR โ weighted average of surrounding 4 texels (4) ๎ Minification ๎ (^) GL_NEAREST, GL_LINEAR ๎ (^) GL_NEAREST_MIPMAP_NEAREST (1) ๎ (^) Choose mipmap with texel size nearest the pixels size ๎ (^) Do nearest neighbor filtering within that mipmap ๎ (^) GL_LINEAR_MIPMAP_NEAREST (bilinear) (4) ๎ (^) Linear filtering within the nearest mipmap ๎ (^) GL_NEAREST_MIPMAP_LINEAR (2) ๎ (^) Nearest filtering within two mipmap levels, then average ๎ (^) GL_LINEAR_MIPMAP_LINEAR (trilinear) (8) ๎ (^) Linear filtering within two mipmap levels, then average (required texture reads)
๎ (^) When the slope of a textured object is high with respect to the view plane the degree of minification may be much greater in one direction than another. Image from โAdvanced Graphics Programming Techniques Using OpenGLโ SIGGRAPH Course 1999
๎ (^) We may require different sampling rates in different directions. ๎ (^) This ratio (higher/lower) is referred to as the anisotropy Image from โAdvanced Graphics Programming Techniques Using OpenGLโ SIGGRAPH Course 1999
Without anisotropic filtering
An EXT extension ๎ (^) glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &max_anisotropy); ๎ (^) anisotropy is the maximum supported anisotropy level (driver and HW dependent) ๎ (^) glTexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, aniso); ๎ (^) Sets the maximum anisotropy to use for the currently bound texture object. ๎ (^) 1.0 is isotropic ๎ (^) Be careful ๎ (^) Could require 64 texture reads when anisotropy = 8.
Core feature since OpenGL 2. ๎ (^) Allows textures with width and height that are not a power of two. ๎ Requires no code changes. ๎ (^) Works for all texture targets ๎ (^) Cube faces must still be square ๎ (^) Mipmap sizes round down ๎ (^) Performance penalty is likely ๎ (^) You should still prefer power-of-two textures ๎ Also see ARB_texture_rectangle
๎ (^) Coverage โ 1 bit per sample ๎ (^) If sample inside polygon then coverage = 1 ๎ (^) Otherwise coverage = 0 No antialiasing : One sample per pixel Multisample antialiasing : 16 samples per pixel
๎ (^) Per pixel computations ๎ (^) Lighting ๎ (^) Texturing ๎ (^) Fragment shading ๎ (^) All covered samples in the sample pixel have the same color. ๎ (^) Color buffer will be very compressible ๎ Per sample computations ๎ (^) Coverage bit ๎ (^) Depth (if coverage == 1) ๎ Contrast with supersampling approach ๎ (^) Everything is done per sample.
Core feature as of OpenGL 1. ๎ (^) Promoted from ARB extension ๎ How many pixels get drawn by some sequence of commands? ๎ (^) Visibility testing ๎ (^) Don't draw what you can't see ๎ (^) Level-of-detail selection ๎ (^) Draw less detail for objects you can barely see. ๎ (^) Perform query for simple bounding geometry, such as a boxes. More info in OpenGL spec and ARB_occlusion_query spec.
Object creation/destruction ๎ (^) glGenQueries(n, *ids) ๎ glDeleteQueries(n, *ids) ๎ Can create multiple query objects, but only one can be active at a time. Start/end query ๎ (^) glBeginQuery(target, id) ๎ (^) target = GL_SAMPLES_PASSED ๎ glEndQuery(target)