Texture Mapping - SIUE Computer Science

Report
COMPUTER GRAPHICS
CS 482 – FALL 2014
OCTOBER 6, 2014
TEXTURE MAPPING
•
•
•
•
TEXTURES
BUMP MAPPING
ENVIRONMENT MAPPING
PROCEDURAL TEXTURING
TEXTURES
BASICS
MAPPING A PATTERN
ONTO THE OBJECTS’
SURFACES CAN GREATLY
ENHANCE THE SCENE’S
APPEAL AND/OR
REALISM.
CS 482 – FALL 2014
OCTOBER 6, 2014: TEXTURE MAPPING
PAGE 149
TEXTURES
UV COORDINATES
ONE APPROACH TO TEXTURE MAPPING DIRECTLY MAPS THE 2D TEXTURE
COORDINATES (CALLED UV SPACE) INTO THE 3D WORLD SPACE
COORDINATES.
PLANAR MAPPING
CS 482 – FALL 2014
CYLINDRICAL MAPPING
SPHERICAL MAPPING
OCTOBER 6, 2014: TEXTURE MAPPING
PAGE 150
TEXTURES
TILING
WHEN THE SURFACE BEING TEXTURED IS MUCH LARGER THAN THE IMAGE
BEING MAPPED, IT IS POSSIBLE TO TILE THE IMAGE REPEATEDLY OVER THE
SURFACE.
CARE MUST BE TAKEN TO DEVELOP IMAGES THAT DO NOT PRODUCE
DISCERNIBLE SEAMS OR PATTERNS WHEN TILED.
THE SEAMS AND PATTERNS ARE MORE NOTICEABLE IN THE TILED HEDGE IMAGE
ON THE LEFT THAN THE ONE ON THE RIGHT.
CS 482 – FALL 2014
OCTOBER 6, 2014: TEXTURE MAPPING
PAGE 151
BUMP MAPPING
ADJUSTING NORMAL VECTORS
TO ADD MORE REALISM TO A TEXTURE-MAPPED IMAGE, AN ADDITIONAL ACTION,
KNOWN AS A BUMP MAPPING, CAN BE APPLIED TO THE OBJECT’S SURFACE.
APPLYING THE TEXTURE TO THIS SURFACE, WHILE COMPUTATIONALLY EXPENSIVE,
PRODUCES A SENSE OF DEPTH FAR SUPERIOR TO SIMPLE TEXTURE MAPPING.
BUMP MAPPING (LEFT) ALTERS THE
SURFACE’S NORMAL VECTOR, WHILE
DISPLACEMENT MAPPING (RIGHT)
ALTERS THE SURFACE ITSELF.
CS 482 – FALL 2014
OCTOBER 6, 2014: TEXTURE MAPPING
PAGE 152
BUMP MAPPING
INTACT SILHOUETTE
BUMP MAPPING BASICALLY APPLIES A PATTERN OF PERTURBATIONS TO THE
NORMAL VECTORS ON THE SURFACE OF THE OBJECT BEING RENDERED.

=
WHEN AN ILLUMINATION
MODEL (E.G., PHONG SHADING)
IS APPLIED WITH THESE
ALTERED NORMAL VECTORS,
THE APPEARANCE OF A RICH,
DETAILED TEXTURE RESULTS.
CS 482 – FALL 2014
OCTOBER 6, 2014: TEXTURE MAPPING
PAGE 153
BUMP MAPPING
DISPLACEMENT MAPPING
DISPLACEMENT MAPPING, WHICH ACTUALLY ALTERS THE
OBJECT’S UNDERLYING GRID TO IMPLEMENT THE 3D SURFACE
DETAILS, ELIMINATING THE SILHOUETTE INCONSISTENCIES, BUT
GREATLY INCREASING THE PROCESSING COST.
CS 482 – FALL 2014
OCTOBER 6, 2014: TEXTURE MAPPING
PAGE 154
ENVIRONMENT MAPPING
SPHERICAL MAPPING
TO PRODUCE AN EFFECT THAT APPEARS LIKE 3D REFLECTION, ENVIRONMENT
MAPPING PROJECTS THE SURROUNDING ENVIRONMENT ONTO A 2D IMAGE AND
THEN TEXTURE MAPS THAT RESULT ONTO THE “REFLECTIVE” OBJECT.
WITH SPHERICAL MAPPING, THE ENTIRE
ENVIRONMENT IS MAPPED TO A RADIUSONE DISK (THE FRONT TO THE INNER CORE
OF THE DISK AND THE REAR TO THE OUTER
RING).
CROSS-SECTION OF
ENVIRONMENT, WITH
FRONT ON THE RIGHT
AND REAR ON THE
LEFT
BAD NEWS: THE ENTIRE PERIMETER OF THE SPHERE MAP IS MAPPED TO A
“SINGULARITY” ON THE FAR SIDE OF THE OBJECT.
CS 482 – FALL 2014
OCTOBER 6, 2014: TEXTURE MAPPING
PAGE 155
ENVIRONMENT MAPPING
LATITUDE MAPPING
WITH LATITUDE MAPPING, THE SPHERE IS TREATED LIKE A GLOBE AND
MAPPED FROM 3D TO 2D VIA LONGITUDES AND LATITUDES.
BAD NEWS: THERE IS STILL A SEAM WHERE
THE LEFT AND RIGHT EDGES OF THE
TEXTURE MAP MEET WHEN MAPPED TO
THE OBJECT.
CS 482 – FALL 2014
OCTOBER 6, 2014: TEXTURE MAPPING
PAGE 156
ENVIRONMENT MAPPING
CUBE MAPPING
IN CUBE MAPPING, SIX TEXTURES ARE CREATED FROM EACH POSITIVE AND
NEGATIVE CARTESIAN DIRECTION SURROUNDING THE OBJECT.
BAD NEWS: PARTICULAR FACETS OF THE
OBJECT MIGHT REQUIRE UP TO THREE
RENDERINGS (E.G., FRONT, RIGHT, AND
BOTTOM) TO ENSURE THAT ALL FACES HIT
BY THE REFLECTION RAYS ARE DISPLAYED.
CS 482 – FALL 2014
OCTOBER 6, 2014: TEXTURE MAPPING
PAGE 157
PROCEDURAL TEXTURING
PERLIN NOISE
CERTAIN TEXTURES IN NATURE (CLOUDS, MARBLE, STREAMS, ETC.) TEND TO FOLLOW A
PSEUDORANDOM PATTERN THAT MAY BE SIMULATED BY MEANS OF NOISE
FUNCTIONS.
A SET OF PSEUDORANDOM VALUES ARE
GENERATED AT SET INTERVALS.
A CONTINUOUS CURVE IS GENERATED BY
SMOOTHLY INTERPOLATING BETWEEN THESE
VALUES.
SEVERAL CURVES LIKE THIS ARE GENERATED, EACH WITH
CERTAIN RESTRICTIONS ON THE AMPLITUDE (THE
DIFFERENCE BETWEEN THE MINIMUM AND MAXIMUM
SUMMING THESE
VALUES GENERATED) AND THE WAVELENGTH (THE
CURVES YIELDS THE
INTERVAL GAP).
FINAL NOISE
FUNCTION.
CS 482 – FALL 2014
OCTOBER 6, 2014: TEXTURE MAPPING
PAGE 158
PROCEDURAL TEXTURING
NOISE TEXTURES
EXTENDING THE GENERATING OF A NOISE FUNCTION TO TWO DIMENSIONS
YIELDS INTERESTING AND USEFUL TEXTURES.
+
+
CS 482 – FALL 2014
+
+
+
OCTOBER 6, 2014: TEXTURE MAPPING
=
PAGE 159
PROCEDURAL TEXTURING
TEXTURE SYNTHESIS
TO SYNTHESIZE A LARGER IMAGE THAT FOLLOWS THE SAME PATTERN AS A
GIVEN SMALLER IMAGE, START WITH A NOISY IMAGE OF THE DESIRED SIZE.
REPLACE EACH PIXEL IN THE
NEW IMAGE BY LOOKING AT ITS
ALREADY COLORED NEIGHBORS,
FINDING A PIXEL IN THE
ORIGINAL IMAGE WITH THE
CLOSEST PATTERN OF
NEIGHBORS, AND COLORING
THE NEW PIXEL WITH THAT OLD
PIXEL’S
COLOR.
CS 482 – FALL
2014
OCTOBER 6, 2014: TEXTURE MAPPING
PAGE 160

similar documents