Proseminar: WEB 3D - PowerPoint PPT Presentation

1 / 31
About This Presentation
Title:

Proseminar: WEB 3D

Description:

Problem: Given a set of 3D objects and a viewing specification, determine which ... Radix sort: complexity O(n) Quick sort: complexity O(n lg n) ... – PowerPoint PPT presentation

Number of Views:48
Avg rating:3.0/5.0
Slides: 32
Provided by: wwwbrueg
Category:
Tags: web | proseminar | radix

less

Transcript and Presenter's Notes

Title: Proseminar: WEB 3D


1
Proseminar WEB 3D
1
Proseminar Web 3D CG Fundamentals 3
  • Hidden Surface Removal
  • Lighting and Shading
  • Texture Mapping

2
Hidden Surface Removal
2
Proseminar Web 3D CG Fundamentals 3
  • Problem Given a set of 3D objects and a
    viewing specification, determine which lines or
    surfaces are invisible.

  • Primitives outside of the field of view
  • Back-facing primitives on a closed, convex object
  • Primitives occluded by other objects closer to
    the camera

3
Hidden Surface RemovalGeneral Approaches
3
Proseminar Web 3D CG Fundamentals 3
  • Image-Based Approach (Image Precision)
  • for(each pixel in the image)
  • determine the ray through the pixel
  • determine the closest object along the
    ray
  • draw the pixel in the color of the
    closest object

  • Object-Based Approach (Object Precision)
  • for (each object in the world)
  • determine unobstructed object parts
  • draw the parts in the appropriate color

4
Hidden Surface RemovalCoherence
4
Proseminar Web 3D CG Fundamentals 3
  • Objects typically have properties which vary
    smoothly
  • Face coherence
  • Edge coherence
  • Scan line coherence
  • Area coherence
  • Depth coherence
  • Frame coherence
  • Object coherence
  • Helps to avoid making expensive calculations, or
    to turn them into simple differences (like line
    drawing)


5
Hidden Surface RemovalPerspective
Transformations
5
Proseminar Web 3D CG Fundamentals 3
  • Depth comparisons are typically performed after
    the perspective transformation
  • Since were looking down the z axis, two points
    are now on the same ray if x1x2 and y1y2
  • The perspective transformation preserves
  • Relative depth
  • Straight lines
  • Planes


6
Hidden Surface RemovalNormalizing the Viewing
Frustum
6
Proseminar Web 3D CG Fundamentals 3
  • Transform frustum to a cube before clipping -
    that is convert perspective frustum to
    orthographic frustum

7
Hidden Surface RemovalHandling Occlusion
7
Proseminar Web 3D CG Fundamentals 3
  • Problem some polygons will overlap, therefore
    we must determine which portion of each polygon
    is visible to eye.

8
Hidden Surface RemovalBack Culling
8
Proseminar Web 3D CG Fundamentals 3
  • Reduces complexity only
  • Convex self-occlusion
  • Angle between the viewing direction an the
    normal vector of a polygon to determine
    visibility
  • Criterion vector product positive


9
Hidden Surface RemovalBack To Front Sorting
9
Proseminar Web 3D CG Fundamentals 3
  • aka The Painter's method
  • First Step The list of surfaces are sorted
    according to their distance from the viewpoint
  • Second Step The objects are then painted from
    back-to-front.
  • Criterion for polygon comparison simplest
    solution compare the maximum z coordinate

10
Hidden Surface RemovalProblems with Painters
10
Proseminar Web 3D CG Fundamentals 3
  • Choosing a suitable sorting algorithm
  • Bubble sort complexity O(n2)
  • Radix sort complexity O(n)
  • Quick sort complexity O(n lg n)
  • The criterion of comparing the maximum z
    coordinate is not correct in general
  • Mutual overlapping and piercing

11
Hidden Surface RemovalConstructing a BSP Tree
11
Proseminar Web 3D CG Fundamentals 3
  • The Binary Space Partition (BSP) algorithm
  • Select a partitioning plane/facet
  • Partition the remaining planes/facets according
    to the side of the partitioning plane that they
    fall on ( or -)
  • Repeat with each of the two new sets
  • In the case of a crossing facet we clip it into
    two halves

12
Hidden Surface RemovalComputing Visibility with
BSP Trees
12
Proseminar Web 3D CG Fundamentals 3
  • Starting from the root of the tree
  • Classify viewpoint as being in the positive or
    negative half-space of our plane
  • Call this routine with the opposite half-space
  • Draw the current partitioning plane
  • Call this routine with the same half-space

13
Hidden Surface RemovalPixel-level Visibilty
13
Proseminar Web 3D CG Fundamentals 3
  • Thus far - visibilty at the level of primitives
  • Now - visibilty at the level of each pixel

14
Hidden Surface RemovalRay Casting
14
Proseminar Web 3D CG Fundamentals 3
  • A very general algorithm
  • Works with any primitive we can write
    intersection tests for
  • but it's hard to make it run fast
  • And thats why
  • can use it for much more than visibility testing
  • shadows, refractive objects, reflections, motion
    blur,...

15
Hidden Surface RemovalScanline Visibilty
15
Proseminar Web 3D CG Fundamentals 3
  • Looks a lot like polygon rasterization
  • Maintains active object table
  • Looks at one scanline at a time - no need to
    store entire image - nice if memory scarce

16
Hidden Surface RemovalDepth (Z) Buffering
16
Proseminar Web 3D CG Fundamentals 3
  • Project all primitives and update depth of each
    pixel
  • set depth of all pixels to ZMAX
  • for (each primitive in the screen)
    determine pixels touched
  • for (each pixel in the primitive)
  • compute z at pixel
  • if (zlt depth)
  • pixel object color
  • depthz

17
Hidden Surface RemovalLooking at Depth (Z)
Buffering
17
Proseminar Web 3D CG Fundamentals 3
  • Pros
  • Any kind of primitives - not just planar polygons
  • Simple and well suited to H/W implementation
  • Spatial coherence - determination of z coordinate
    by linear interpolation
  • Primitives can be processed in any order
  • Cons
  • Excessive over-drawing
  • Doesn't handle transparency well
  • Needs intelligent selection of znear zfar
    clipping planes

18
Illumination and ShadingIllumination Models
18
Proseminar Web 3D CG Fundamentals 3
  • Illumintaion
  • Lightning
  • Shading
  • Illumination Models

19
Illumination and ShadingTwo Components of
Illumination
19
Proseminar Web 3D CG Fundamentals 3
  • Light Sources (Emitters)
  • Emission Spectrum (colour)
  • Geometry (positional and directional)
  • Directional Attenuation
  • Surface Properties
  • Reflectance Spectrum (colour)
  • Geometry (position, orientation, and
    micro-structure
  • Absorption

20
Illumination and ShadingLight Sources
20
Proseminar Web 3D CG Fundamentals 3
  • Ambient Light Sources
  • No spatial or directional characteristics
  • Independent of object's position and orientation
  • Directional Light Sources
  • All rays have common direction
  • Example sunlight
  • Spot Light Sources
  • Emits rays in a radial direction from its source
  • Example light bulb
  • Other Light Sources

21
Illumination and ShadingDiffuse Reflection and
Lighting
21
Proseminar Web 3D CG Fundamentals 3
  • Ideal Diffuse Reflection
  • A very rough surface on microscopic level
  • Example chalk
  • Lambert's Cosine Law
  • How much of the incoming light energy is
    reflected
  • Computing Diffuse Refelection

22
Illumination and ShadingSpecular Reflection and
Lighting
22
Proseminar Web 3D CG Fundamentals 3
  • Ideal Specular Reflection
  • A very smooth surface on microscopic level
  • Example mirror
  • Snell's Law
  • Non-ideal Reflectors
  • Empirical model

23
Illumination and ShadingPhong Illumination
23
Proseminar Web 3D CG Fundamentals 3
  • The Phong Illumination Model
  • Phong Examples
  • Variable direction of the light source and
    shininess coefficient

24
Illumination and ShadingSimple Shading
24
Proseminar Web 3D CG Fundamentals 3
  • Flat Shading
  • A only one illumination calculation for each
    primitive
  • Facet Shading
  • Apply illumination equation at each point

25
Illumination and ShadingGouraud Shading
25
Proseminar Web 3D CG Fundamentals 3
  • First applies the illumination model one subset
    of surface points
  • Then interpolates the intensity of the
    remaining points on the surface
  • But the facet artefacts are still visible

26
Illumination and ShadingPhong Shading
26
Proseminar Web 3D CG Fundamentals 3
  • Based on Goraud Shading
  • First the surface normal is linearly
    interpolated across polygonal facets
  • Then the illumination model is applied at every
    point

27
Illumination and ShadingAdvanced Lighting and
Shading
27
Proseminar Web 3D CG Fundamentals 3
  • Physically Based Illumination Models
  • use parameters that have clear physical analogies
  • predictive
  • Recursive Ray Casting
  • Radiosity
  • Uses the theory of heat transfer

28
Texture MappingThe Quest for Visual Realism
28
Proseminar Web 3D CG Fundamentals 3
  • At what point do things start to look real ?
  • Photo Texture

29
Texture MappingHow to do it ?
29
Proseminar Web 3D CG Fundamentals 3
  • Image space scan
  • samples the warped texture at the appropriate
    image pixel
  • May miss parts of the texture
  • Texture space scan
  • places each texture sample to the mapped image
    pixel
  • May not fill imageForward

30
Texture MappingProblems
30
Proseminar Web 3D CG Fundamentals 3
  • Problem 1 fitting - we deal with non-liner
    transformations
  • Problem 2 mapping form a pixel to texel -
    aliasing

31
Texture MappingHow to do it ?
31
Proseminar Web 3D CG Fundamentals 3
  • MIP Mapping
  • prefiltering technique we apply it before
    texture mapping (rasterization)
  • BUMP Mapping
  • alters the surface normal of an object
  • the actual shape of the object does not change
Write a Comment
User Comments (0)
About PowerShow.com