Title: Other%20Rendering%20Techniques
1Other Rendering Techniques
- Types of rendering
- Wireframe techniques
- Scan-line conversion
- Reyes rendering
- Ray tracing (done)
- Shadows
- Reflections
- Depth of field, focus, etc.
- Antialiasing
2Line only techniques
- Hidden-line removal
- Line graphics
- Wireframe images
- Halo line images
3Floating Horizon Algorithms
4Roberts Algorithm
- First visible line algorithm
- O(N2) complexity
- All objects must be convex volumes
- Excessively complex
5Warnock Algorithm
- Spatial subdivision
- Quad-trees
6Appels Algorithm
- Quantitative invisibility
- When a line goes behind something, increment by 1
- When it comes out, increment by -1
7Haloed Lines
8So much for wireframe
9What are the ways to convert primitives to image?
- Scan-line conversion
- Ray tracing
Anything else?
10Scan-line conversion
- Each primitive is mapped to 2D and then converted
to image - List priority algorithms
- Z-buffer techniques
- A-buffer techniques
11Painters Algorithm
- Sort back to front
- Draw back to front
- Thats all there is to it
- Does this always work?
12Z-buffer algorithms
- Associate a z value with each pixel
- Contains z for nearest point drawn so far
- OpenGL, Direct3D, etc.
- Where do we get the Z?
13A-Buffer Algorithms
- Create a list of polygons for each scan line
- Determine x extents for each line
- Sort in z order
- Draw pixel for nearest line
14Spanning Scan Line Algorithms
- Create a list of polygons for each scan line
- Determine x extents for each line
- Determine spans
- All end points and intersections partition spans
- Draw front line for each span
15List priority algorithms
- Sort things in depth order
- Painters algorithm paints back to front
- We could just paint front if no overlaps
- Newell-Newell-Sancha Algorithm
- Provides way to sort polygons
- Splits any polygons if there is a cyclical
relationship
16Doing things in a z-buffer world
- Z-buffer the most common scan-line method
- Whats good about it?
- Whats bad about it?
17Shadows?
- Why does OpenGL not show shadows?
18Drawing Shadows
- Assume a light at (0,0,0). We want to know were
the shadow projects on a plane defined by
axbyczd0 - An occluding point S(sx,sy,sz,1)
- Anything along line through S would be
(asx,asy,asz,1) - Line intersection with plane is
- aasxabsyacszd0
- a-d/(asxbsycsz)
- Intersection with plane is -d(sx,sy,sz)/(asxbsy
csz)
19Using this equation
Similar approach exists For lights at infinity
1. Translate so light is at origin 2. Put this
matrix on stack (using translated plane) 3. Draw
object we are casting shadow of in shadow color
???
20How I got this working
- I display the shadow into the stencil buffer
- I then draw the polygon with alpha value that
decreases brightness - See example program
21Shadow Direction
Image from light 0 viewpoint
Image from light 1 viewpoint
What all can we do with this?
22Lit Polygon Determination
Image from light 0 viewpoint
Image from light 1 viewpoint
Partition polygons into lit/not lit
sets Subdivide any that are partially lit
23Shadow Texture
Image from light 0 viewpoint
Image from light 1 viewpoint
Create a texture map for each visible polygon
24Shadow Map
Image from light 0 viewpoint
Depth map from light 0 viewpoint
The map partitions the space into shadowed/not
shadowed. For each point, determine which
partition we are in
25Deep Shadow Maps
3D texture where each point is how much
illumination we receive
26Shadow Volumes
- Polygons cast polyhedra of shadow volumes
- Intersect polyhedra and object space
27Reflections/Transparency?
28Environment Maps
- Uses vertex normals to generate texture
coordinates - How can we use this to generate
- Reflections
- Transparency with refraction?
29Depth of Field?
30Motion Blur