Unformatted text preview:

AnnouncementsTextureNo TexturesWith TexturesTexture ImageProcedural TextureSlide 7Slide 8Slide 9Example Procedural ModelsSlide 11Slide 12Slide 13Example Procedural TexturesWhat is Texture?Perlin NoiseSlide 17Strategy1D Perlin Noise2D Perlin NoiseSmooth NoiseLinear InterpolationCubic InterpolationGradient (Perlin) NoiseMultiple OctavesFractsum 10 x 10Perlin TurbulenceTurbulence 10 x 10Spatial regularitiesNonlinear changes in intensitySummaryOpenGL TexturingSpecify a 2D Texture ObjectSpecify how Texture is appliedEnable the Texture and DrawCreate a Texture ObjectPutting it all togetherReview of PS 1Texture SynthesisSynthesis as probabilistic modelingMarkov ModelMarkov model of Printed EnglishSlide 44Slide 45Slide 46Slide 47Slide 48Markov models of wordsSame thing for pixelsSlide 51This is like copying, but not just repetitionWith BlocksSlide 54Slide 55Slide 56Announcements•Problem Set 2 distributed. –Due March 10 weeks.–Has been shortened, due to snow.–Tour of skeleton code.•#include <stdlib.h>•Problem Set 1, accepted without penalty until now.Texture•Pattern of Intensity and color.–Can be generalized to 3D texture.•How do we get them?–Take pictures.–Write a program (procedural textures).–Synthesize from examples•How do we apply them?–Specify a mapping from texture to object.–Interpolate as needed.–This can be a challenging problem, but we’ll consider simpler version.No TexturesImage courtesy, Foley, van Dam, Feiner, HughesImage RemovedWith TexturesImage courtesy, Foley, van Dam, Feiner, HughesImage RemovedTexture Imagevu110Courtesy, http://titan.spaceports.com/~seymorImage RemovedProcedural Texturevu110Image RemovedProcedural Texturevu770Assuming 3 bits:Uwave = u % 2Procedural Texturevu770Assuming 3 bits:Vwave = v % 2Procedural Texturevu770Uwave = u % 2Vwave = v % 2Pix(u, v) = UwaveVwaveExample Procedural ModelsImages from Texturing and Modeling: A Procedural Approach By Ebert, Musgrave, Peachey, Perlin, and WorleyImage RemovedExample Procedural ModelsImages from Texturing and Modeling: A Procedural Approach By Ebert, Musgrave, Peachey, Perlin, and WorleyImage RemovedExample Procedural ModelsImages from Texturing and Modeling: A Procedural Approach By Ebert, Musgrave, Peachey, Perlin, and WorleyImage RemovedExample Procedural ModelsImages from Texturing and Modeling: A Procedural Approach By Ebert, Musgrave, Peachey, Perlin, and WorleyImage RemovedExample Procedural TexturesImages from Texturing and Modeling: A Procedural Approach By Ebert, Musgrave, Peachey, Perlin, and WorleyImage RemovedWhat is Texture?•Something that repeats (or continues, or has structure) with variation.•Must separate what repeats and what stays the same.•Model as repeated trials of a random process–The probability distribution stays the same.–But each trial is different.–This may be true (eg., pile of objects)–Or not really (tile floor).Perlin Noise•Natural phenomenon derives its richness from variations•But we don’t want white noise!•Almost all movies use some form of Perlin noise:–James Cameron Movies (Abyss,Titanic,...)–Animated Movies (Lion King, Moses,...) –Arnold Movies (T2, True Lies, ...) –Star Wars Episode I, Star Trek Movies –Batman Movies –Refer noisemachine.com for detailsPerlin Noise•Reproducibility•No repeatability •Band limited (smoothly changing)•User controlStrategy•Generate smooth noise.–Generate noise with particular frequency•Pick random values•Interpolate to connect them smoothly.–Sum noise over many frequencies•Map real numbers to intensity or color in interesting way.–Turn numbers into color.–Distort numbers spatially–Turbulence–Non-linear mappings.1D Perlin NoiseImage courtesy of Paul BourkeImage Removed2D Perlin NoiseImages courtesy of Paul BourkeImage RemovedSmooth Noise1. Populate an integer grid with random values. 2. Interpolate in between to get values at non-integer points•This creates a kind of smoothingAdvantages:1. Randomness at grid points2. Band limitedLinear Interpolationf(x) = floor(x)*(x-floor(x)) + ceiling(x)*(ceiling(x)-x)• Average of neighboring points weighted by distance to them.Cubic InterpolationInstead of weighting by distance, d, weight by:1 – 3d2 + 2|d|3•Smooth•SymmetricGradient (Perlin) Noise•Generate unit vectors (a, b) at each integer lattice point (ix, iy)–Use zero intensity at each lattice point.•For a non-integer evaluation point (x, y) determine the 4 nearest integer grid points.•For each integer grid point (ix, iy), find the fractional value of the vector (fx, fy) from (ix, iy) to (x, y, z) and take its dot product with the gradient vector at that integer point (ix, iy). •Interpolate the 4 dot-product values to compute the noise value at the grid point•This has more high-frequency energy than value noise.Multiple OctavesHow about if we introduce more frequencies?double fractalsum(double x, double y, double z){double value = 0;double f;for(f = MINFREQ; f < MAXFREQ; f *= 2)value += gnoise(x * f, y * f) / f;return(value);}Demo of assignment executableFractsum 10 x 10Image RemovedPerlin Turbulencedouble turbulence(double x, double y, double z){ double value = 0;double f; for(f = MINFREQ; f < MAXFREQ; f *= 2)value += fabs(gnoise(x * f, y * f, z * f) / f);return(value);}Turbulence 10 x 10Image RemovedSpatial regularities•Multiply intensities by sine of x coordinates.•DemoMap Intensities to ColorDemoNonlinear changes in intensityBlue channel always 255, others taken from noise.Summary•Smooth randomness.–More low frequencies than high.–Only low frequencies are kind of boring.–World seems to have such frequencies.•User Control–Spatial and color variations.–Controls somewhat intuitive.OpenGL Texturing•Create and specify a texture object –Create a texture object –Specify the texture image–Specify how texture has to be applied for each pixel•Enable texture mapping•Draw the textured polygons–Identify the active texture–Specify texture coordinates with verticesSpecify a 2D Texture Object• glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLVoid *texels);–Eg: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 128, 128, 0, GL_RGBA, GL_UNSIGNED_BYTE, image);–format and type used to specify the way the texels are stored–internalFormat specifies how OpenGL should store the data internally–width and height have to


View Full Document

UMD CMSC 427 - Texture

Download Texture
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 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 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?