DOC PREVIEW
MIT 6 837 - Texture-Mapping Tricks

This preview shows page 1-2-3 out of 8 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Lecture 21 Slide 1 6.837 Fall 2001Texture-Mapping Tricks Combining Textures Filtering Textures Textures and Shading Bump Mapping Solid TexturesLecture 21 Slide 2 6.837 Fall 2001Texture Mapping Modes Label textures Projective textures Environment maps Shadow maps …Lecture 21 Slide 3 6.837 Fall 2001The Best of All WorldsAll these texture mapping modes are great! The problem is, no one of them does everything well. Suppose we allowed several textures to be applied to each primitive during rasterization.Lecture 21 Slide 4 6.837 Fall 2001Multipass vs. MultitextureMultipass (the old way) - Render the image in multiple passes, and "add" the results.Multitexture - Make multiple texture accesses within the rasterizing loop and "blend" results.Blending approaches: Texture modulation Alpha Attenuation Additive textures Weird modes2Lecture 21 Slide 5 6.837 Fall 2001Texture Mapping in QuakeQuake uses light mapsin addition to texture maps. Texture maps are used to add detail to surfaces, and light maps are used to store pre-computed illumination. The two are multiplied together at run-time, and cached for efficiency.Resolution High LowInstanced Yes NoData RGB IntensityTexture MapsLight MapsLight map imageby Nick ChirkovLecture 21 Slide 6 6.837 Fall 2001When texture mapping it is rare that the screen-space sampling density matches the sampling density of the texture. Typically one of two things can occur:Sampling Texture MapsOversampling of the texture or Undersampling of the textureIn the case of oversampling we already know what to do... Interpolation (review on Antialiasing and Resampling). But, how do we handle undersampling?Lecture 21 Slide 7 6.837 Fall 2001How Bad Does it Look?Let's take a look at what undersampling looks like:Notice how details in the texture, in particular the mortar between the bricks, tend to pop (disappear and reappear).This popping is most noticeable around details (parts of the texture with a high-spatial frequency). This is indicative of aliasing (high-frequency details showing up in areas where we expect to see lowfrequencies). Lecture 21 Slide 8 6.837 Fall 2001We've Seen this Sort of Thing BeforeRemember... Aliasing?This was the phenomenon that occurred when we undersampled a signal. It caused certain high frequency features to appear as low frequencies. To eliminate aliasing we had to either band limit (low pass filter) our input signal or sample it at a higher rate:3Lecture 21 Slide 9 6.837 Fall 2001Spatial FilteringIn order to get the sort of images the we expect, we must prefilterthe texture to remove the high frequencies that show up as artifacts in the final rendering. The prefiltering required in the undersampling case is basically a spatial integration over the extent of the sample.We could perform this filtering while texture mapping (during rasterization), by keeping track of the area enclosed by sequential samples and performing the integration as required. However, this would be expensive. The most common solution to undersampling is to perform prefiltering prior to rendering.Lecture 21 Slide 10 6.837 Fall 2001MIP Mapping is one popular technique for precomputing and performing this prefiltering. MIP is an acronym for the latin phrase multium in parvo, which means "many in a small place". The technique was first described by Lance Williams. The basic idea is to construct a pyramid of imagesthat are prefiltered and resampled at sampling frequencies that are a binary fractions (1/2, 1/4, 1/8, etc) of the original image's sampling.MIP MappingComputing this series of filtered images requires only a small fraction of addtional storage over the original texture (How small of a fraction?).While rasterizing we compute the index of the decimated image that is sampled at a rate closest to the density of our desired sampling rate (rather than picking the closest one can in also interpolate between pyramid levels).Lecture 21 Slide 11 6.837 Fall 2001Storing MIP MapsOne convenient method of storing a MIP map is shown below. (It also nicely illustrates the 1/3 overhead of maintaining the MIP map).We must make a few small modifications to our rasterizer to compute the MIP map level. Recall the equations that we derived for mapping screen-space interpolants to their 3-space equivalent.Lecture 21 Slide 12 6.837 Fall 2001What we'd like to find is the step size that a uniform step in screen-space causes in three-space, or, in other words how a screen-space change relates to a 3-space change. This sounds like the derivatives, ( du/dt, dv/dt ). They can be computed simply using the chain rule:Finding the MIP levelNotice that the term being squared under the numerator is just the wplane equation that we are already computing. The remaining terms are constant for a given rasterization. Thus all we need to do to compute the derivative is a square the waccumulator and multiply it by a couple of constants.Now, we know how a step in screen-space relates to a step in 3-space. So how do we translate this to an index into our MIP table?4Lecture 21 Slide 13 6.837 Fall 2001MIP IndicesActually, you have a choice of ways to translate this gradient value into a MIP level.This also brings up one of the shortcomings of MIP mapping. MIP mapping assumes that both the u and v components of the texture index are undergoing a uniform scaling, while in fact the terms du/dtand dv/dtare relatively independent. Thus, we must make some sort of compromise. Two of the most common approaches are given below:The differences between these level selection methods is illustrated by the accompanying figure.Lecture 21 Slide 14 6.837 Fall 2001Summed-Area TablesThere are other approaches to computing this prefiltering integration on the fly. One, which was introduced by Frank Crow is called a summed-area table. Basically, a summed-area table is a tabularized two-dimensional cumulative distribution function. Imagine having a 2-D table of numbers the cumulative distribution function could be found as shown below.T(x1, y1) - T(x0, y1) - T(x1, y0) + T(x0, y0)To find the sum of region contained in a box bounded by (x0, y0) and (x1, y1): This approach can be used to compute the integration of pixels that lie under a pixel by dividing the resulting sum by the area of the rectangle,(y1-y0)(x1-x0).With a little more work you can compute the area under any four-sided polygon (How?). Lecture 21 Slide 15 6.837 Fall 2001Summed-Area TablesHow much storage


View Full Document

MIT 6 837 - Texture-Mapping Tricks

Documents in this Course
Shadows

Shadows

64 pages

Animation

Animation

37 pages

Radiosity

Radiosity

25 pages

Color

Color

86 pages

InterArch

InterArch

14 pages

Color

Color

15 pages

Animation

Animation

61 pages

Luxo Jr

Luxo Jr

14 pages

Animation

Animation

52 pages

Radiosity

Radiosity

37 pages

Load more
Download Texture-Mapping Tricks
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Texture-Mapping Tricks and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Texture-Mapping Tricks 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?