Download presentation
Presentation is loading. Please wait.
1
Computer Graphics Imaging
Lecture 11 and 12 Texture Mapping
2
Texture mapping The question: how to modify the color of an object to make it look real or interesting? Lighting and surface materials settings produce smooth and uniform visual appearance Often not realistic enough The solution: use texture image to further modify the color of the object
3
Texture mapping The final color of an object is often a combination of several layers of effects Lighting + Base material + textures There are different ways to mix the textures and materials
4
Texture channels In the “Texture” tab under the “Material Buttons panel” You can apply multiple textures to an object Applied from bottom to top – layered upon each other Can create a new texture for each channel Can copy and paste texture settings between channels and between objects Can turn on and off individual texture channels
5
Types of textures Press the “Add New” button in the “Texture” tab under the “Material Buttons” panel Then click the “Texture Buttons” icon Procedural texture Usually semi-random patterns Generated through mathematical models Image or video Can use video as texture Environment map
6
Repeat or extend a texture image
You may want to make a small texture image cover a large area Click on the “Texture Buttons” icon Under the “Map Image” panel Extend: extend the color of edge pixels along the two axes Clip: one image only (no repeating or extending) ClipCube Repeat: repeat the image along the two axes Checker: repeat image in checker pattern
7
Crop a texture image In “Texture buttons” panel, “Map Image” panel
Set MinX, MinY, MaxX, MaxY
8
Texture color In “Texture buttons” panel, “Colors” tab
May tint the color of a texture by brightening each red, green and blue channel All textures may be modified by the Bright(ness) and Contr(ast) buttons in the Colors panel.
9
Texture decal Apply decals to a 3D object Steps
E.g. attach a logo to a T-shirt Steps Insert an Empty object into the scene You may want to give it a meaningful name Move it close to the object that you want to apply the decal to The Empty object’s Z axis should point away from the mesh Add an image texture to the mesh. Set UseAlpha and ClipCube in the Map Image panel In the Map Input field, press Object and type in the name of the Empty object
10
Texture decal Can move, rotate, and scale the Empty object to move, rotate, and scale the texture image You may want to make the Empty object the child of the object you are texturing So that the decal moves with the object Or animate the Empty object to animate the decal
11
Understanding “Map Input”
Where do you want to place the texture image? Glob: texture image is placed at global (0, 0, 0) Texture mapping happens when the target object covers the origin Object: texture image is attached to an object other than the target object Usually an Empty object Texture mapping happens if the two objects are close enough UV: texture mapping is determined by a UV map Most accurate but also quite time consuming to do
12
Understanding “Map Input”
Where do you want to place the texture image? Orco: texture image is attached to the target object Win: texture image is placed over the window Only part of the image is mapped to the object Imagine that a texture image is placed at certain location and is projected through a certain axis (the default is Z) When the target object intersects with that projection, texture mapping happens.
13
Understanding “Map Input”
Do you want to change the shape of the texture (image)? Flat (image) Cube Tube Sphere
14
Understanding “Map Input”
By default, the center of the image is mapped to the (x=0, y=0) of the coordinate system that it’s attached to See “where do you want to place the texture image?” Do you want to move the texture away from (0, 0)? Change “ofsX”, “ofxY”, “ofsZ” Do you want to scale the texture image? Modify “sizeX”, “sizeY”, “sizeZ”
15
Understanding “Map Input”
By default, the texture image is placed on the X-Y plane, and is projected through Z axis What if you want to project it through another axis? Project through Y: click the X button on the first row, and click the Z button on the second row Project through X: click the Y button on the first row, and click the Z button on the second row What if you want to rotate the image for 90 degrees? Switch the axes on the first and second row What if you want to rotate the image for 180 degrees? Set “sizeX” and “sizeY” to the negative values
16
3D view texture space transform
Select the object Press T Select “grab/move” or “size” to shift or scale the texture image Equivalent to changing ofsX/Y/Z or sizeX/Y/Z in the “Map Input” field
17
Understanding “Map To”
You can control how images are used in the texture mapping process Col: image mapped to color. This is the standard usage. Nor: image mapped to normals. This is for bump mapping. Disp: image used to displace vertices. This is for displacement mapping. And a number of other options
18
Understanding “Map To”
Blending mode: how this texture channel is combined with other texture channels Mix, add, substract, multiply, divide, etc. See for details
19
Understanding “Map To”
Impact sliders: how much impact will the texture have? Col: how much impact will the texture has on color? (standard texture mapping) Nor: how much will the normal map change the normal vectors? (bump mapping) Disp: how will the texture intensity displace the vertices? (displacement mapping)
20
Understanding “Map To”
Stencil: use one texture channel as a mask Create and load a black and white image for this channel By default the areas that is black will prevent the subsequent texture channels from being applied Can reverse this by pressing “Neg” button Add the texture image to the next channel Press “Stencil” button and “No RGB” button
21
Understanding “Map To”
Warp: use the current texture channel to distort the texture coordinates of the texture channel Press “Warp” button Adjust the “Fac” value
22
Bump mapping Bump mapping is a technique to create the visual appearance of uneven and bumpy surface out of smooth objects Avoid using too many vertices The process Create a normal map Use the normal map to change the directions of normal vectors of the vertices The end result: the surface will look uneven
23
Bump mapping A common practice in video games
Create two versions of a 3D model: a high resolution model and low resolution model Generate a normal map out of the high resolution model Use the normal map to do bump mapping on the low resolution model After bump mapping, the low resolution model will look like a high resolution model, but with far fewer vertices See
24
Bump mapping Basic ideas behind bump mapping
Each vertex has a normal vector, which is used for calculating the vertex color. On a smooth surface, the normal vectors are either uniformly oriented, or the change of the normal orientation is gradual During bump mapping, a normal map is used to change the directions of the normal vectors Vertex colors are then calculated based on the modified normal vectors This may create the illusion of a bumpy surface
25
How to create normal map in Blender?
Create the 3D model Preferably a high resolution model Create a new material for the 3D model, if it doesn’t have one Set the diffuse color of material to black (0.0, 0.0, 0.0) Under “Material buttons”, press “Shadeless”
26
How to create normal map in Blender?
Create three texture channels for the object Set the texture type to “Blend” for three channels For the first channel, Under “Map Input”, press “Nor”, and only select X axis Under “Map To”, set the color to Red (1, 0, 0) For the second channel Under “Map Input”, press “Nor”, and only select Y axis Under “Map To”, set the color to Green (0, 1, 0) For the third channel Under “Map Input”, press “Nor”, and only select Z axis Under “Map To”, set the color to Blue (0, 0, 1)
27
How to create a normal map in Blender?
Under “World Buttons”, set the background color to be black (0, 0, 0) Place the camera so that it’s directly above the object Under “Editing”, press “Orthographic” (projection) Press F12 to render the scene Press F3 to save the image (e.g. as jpg)
28
How to create a normal map in Blender?
See and for more details
29
How to do bump mapping? Select the target 3D object
Create texture channel and load a normal map Press the "Normal map" button in the Image Panel under “Texture buttons” Select “object” instead of the default “tangent” Under “Material buttons”, in "Map To" panel, press "Nor“ and un-press “Col” Adjust “Nor” impact slider
30
Displacement mapping Use an image to displace vertices
Create true bumpy surfaces, but need to use a lot more vertices Quite expensive Works better on very dense mesh models
31
Displacement mapping You may need to subdivide the 3D model multiple times to increase the number of vertices Load a displacement map into a texture channel Under “Material buttons”, in "Map To" panel, press “Disp“ and unpress “Col” Adjust “Disp” impact slider
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.