1 3d –graphics and animation shading and surface characteristics harri airaksinen
Post on 22-Dec-2015
218 views
TRANSCRIPT
2
Shading and surface normals
Shading = the moment in the rendering process when visible surfaces are assigned a shading value
Shading is depend on object surface and lights Calculating the surface reflection is done by using surface
normals Common surface shading techniques include :
faceted smooth specular shading
3
Faceted Shading (polygonal shading, tai constant value faceted shading )
Simplest and fastest – one shading value located in the middle of the polygon, direction is surface normal. Value tells how much light is received at the center of the polygon only. (how light it is)
take into account parameters of ambient light only (some diffuse) do not handle complex surface characteristics such as texture and
transparency well or not at all
4
Smooth Shading (Gouraud shading, intensity interpolation
shading ) continuous shading value; blends throughout the visible polygons on the
surface -> idea: to average the surface normals of adjacent polygons, creating a smooth transition of shading between polygons :
sampling the amount of light reaching the surface normals in the center of polygons creating a vertex normal, averages the values of the surface normals of adjacent
polygons blending the intensifies of the vertex normals in a polygon
No reflective surfaces and only surfaces with a matte finish. take into account ambient and diffuse lighting parameters, and handle some of
the complex surface characteristics well.
5
Specular Shading (normal vector interpolation shading ,Phong, Blinn,
Cook) Mirror –like shading calculates the shading at every point on the surface of a polygon
done by interpolating the vertex normals, and shading every point on the surface of the polygon by computing the relation between the angle of its normal and the angle of the incident light
can handle ambient, diffuse, and specular lighting, and detailed surface characteristics extremely well
6
Surface Shader
Material editor tool for simulating materials
The shaders includes: reflectivity color texture transparency
9
Surface Layers
• by adding layers and compoundingtheir effects to determine the finallook of the surface
• Makes it possible to build complexsurface materials
10
Image mapping
2D image and mapping it on the surface of a three-dimensional object by projecting or wrapping
Very efficiently simulate not only the texture of a three-dimensional surface, but also other surface attributes such as reflectivity, transparency, and roughness
11
Image mapping
Images maps can modulate the surface characteristics by linking the brightness or color of a pixel in the image map to the characteristics of the point in the surface where that pixel is mapped -> the brightness of a pixel in an image map can control the reflectivity of the point on the surface where the pixel is mapped, or its color, or its transparency.
12
Creating the Map
2D -images that can be mapped onto 3D -surfaces: painted images photographic images abstract patterns (rule-based)
Input devices: recording a live image with a digital camera scanning an existing photograph painting with a flatbed laser digital scanner image libraries (software vendors, net …)
14
Projection Methods
• How the picture/pattern is projected over the 3D object?
Modifier UV-mapping
15
Projection Methods
Most useful projection methods include: The flat projection method (planar) applies maps onto surfaces
in a flat way - identical results as long as the three-dimensional surface is parallel to the projection plane
The cubical projection method (box) is a variation of the flat projection method that repeats the map on each of the six sides of a cube - effective with cubes but only as long as one of the planes of the cube is parallel to the projection plane
The cylindrical projection method applies maps onto surfaces by wrapping the sides of the map around the shape until the two ends of the map meet behind the object – bottom & top problem
The spherical projection applies a rectangular map by wrapping it around a surface until the opposite sides meet, and then pinching it at the top and bottom and stretching it until the entire object is covered
16
Projection Methods- wrapping -
Textures to be projected onto 3D objects in a straight way, but also be stretched until the four sides of the map are pressed against each other
17
Positioning the Map- local coordination -
Not use XY –coordination, but surface local coordination system, U, V, W
U = horizontal, V = Vertical Offset control how the picture islocated on the surface, example.0.5. and 0.5 locate the picture in half wayin both directionn
19
Image map as a mask- Blending with matting techniques -
• Using ALPHA –image to mask holes to object surface•Alpha –channel use:
• a CREYSCALE image file a that is linked to an image map• saved with an image file in the form of a fourth channel in a RGB image • determine degree of blending of the image map with a surface based on• the intensity of brightness values of the pixels file used=alpha channels
20
Surface Reflectivity
The basic three types of surface reflectivity are: ambient diffuse specular
Surface reflectivity types: Matte surfaces can be simulated by using a combination of ambient
and diffuse reflections. Metallic surfaces can be simulated with ambient and specular
reflections. Plastic surfaces are typically simulated with a combination of
ambient, diffuse, and specular reflections
21
Environment Maps
They are special type of reflection map because they reflect not only the objects surrounding the mapped object, but also the environment surrounding the reflective surfaces
Environment maps can
be animated: if something
happened around the
object, the movement is
reflected to the object
surface
26
Surface textures
Texturing techniques can be grouped: Visual textures are flat simulations of 3D -texture and no affect the geometrical
surface of the object; they look textured but they are not. Example, a visual texture bricks is like brick wallpaper, and different from a real
wall of bricks with relief textures that can be felt by touch. A benefit of using visual textures is make possible the creation of complex and rich textures with a minimal investment of polygons. Like color and procedural maps, environment, bump, and transparency maps
Spatial textures exist in 3Dand affect the spatial integrity of the smooth surface of an object.
27
Bump Maps
1978, developed by James Blinn Simulates the bumps or wrinkles in a surface without the
need for geometric modifications to the model The surface normal of a given surface is perturbed
according to a bump map. The perturbed normal is then used instead of the original normal when shading the surface using the Lambertian technique
28
Displacement Maps
Provide a unique way to use an image map to actually modify not only the shading but also the geometry of the surface being mapped
Displacement maps are often used to create 3D terrain. Terrains can be built with displacement maps that are based on photographic images of aerial views where the different elevations are coded with different colors or shades of gray.
29
Three-Dimensional Procedural Texture Maps
Solid textures if you cut the object, cutline is presented in “correct” way
Rules control texture creation
30
Transparency
Surface feature how the light penetrate the object Can be faked or using ray tracing and real materials transparency map consists of a monochromatic 2D -image that is
applied to a 3D -surface with the purpose of making all or some of the surface transparent
31
Controlling environment-dependent variables
Antialiasing – When the spatial resolution of an image is too low, its details are often lost
32
Controlling environment-dependent variables
Fast movement Motion Blur Needed feature when animation include fast object
movements not a default setup Usually speeds of 1/250th of a second are necessary to
freeze fast-moving objects. 30 fps (frame per sec = 1/30 seconds per picture)