Download presentation
Presentation is loading. Please wait.
Published byWinifred Doyle Modified over 9 years ago
1
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Other Rendering Techniques Types of rendering – Wireframe techniques – Scan-line conversion – Reyes rendering – Ray tracing (done) Shadows Reflections Depth of field, focus, etc. Antialiasing
2
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics2 Line only techniques Hidden-line removal – Line graphics – Wireframe images – “Halo” line images
3
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics3 Floating Horizon Algorithms
4
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics4 Robert’s Algorithm First visible line algorithm O(N 2 ) complexity All objects must be convex volumes Excessively complex
5
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics5 Warnock Algorithm Spatial subdivision – Quad-trees
6
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics6 Appel’s Algorithm Quantitative invisibility – When a line goes behind something, increment by 1 – When it comes out, increment by -1
7
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics7 Haloed Lines
8
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics8 So much for wireframe…
9
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics9 What are the ways to convert primitives to image? Scan-line conversion Ray tracing Anything else?
10
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics10 Scan-line conversion Each primitive is mapped to 2D and then converted to image – List priority algorithms – Z-buffer techniques – A-buffer techniques
11
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics11 Painters Algorithm Sort back to front Draw back to front – That’s all there is to it Does this always work?
12
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics12 Z-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?
13
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics13 A-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
14
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics14 Spanning 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
15
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics15 List priority algorithms Sort things in depth order – Painter’s 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
16
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics16 Doing things in a z-buffer world Z-buffer: the most common scan-line method – What’s good about it? – What’s bad about it?
17
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics17 Shadows? Why does OpenGL not show shadows?
18
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics18 Drawing Shadows Assume a light at (0,0,0). We want to know were the shadow projects on a plane defined by ax+by+cz+d=0 – An occluding point S=(s x,s y,s z,1) – Anything along line through S would be: ( s x, s y, s z,1) – Line intersection with plane is: – as x + bs y + cs z +d=0 – a=-d/(as x +bs y +cs z ) – Intersection with plane is: -d(s x,s y,s z )/(as x +bs y +cs z )
19
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics19 Using this equation -d(s x,s y,s z )/(as x +bs y +cs z ) 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 ??? Similar approach exists For lights at infinity
20
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics20 How 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…
21
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics21 Shadow Direction Image from light 0 viewpoint Image from light 1 viewpoint What all can we do with this?
22
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics22 Lit 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
23
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics23 Shadow Texture Image from light 0 viewpoint Image from light 1 viewpoint Create a texture map for each visible polygon
24
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics24 Shadow 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
25
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics25 Deep Shadow Maps 3D texture where each point is how much illumination we receive
26
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics26 Shadow Volumes Polygons cast polyhedra of shadow volumes Intersect polyhedra and object space
27
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics27 Reflections/Transparency? How?
28
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics28 Environment Maps Uses vertex normals to generate texture coordinates How can we use this to generate: – Reflections – Transparency with refraction?
29
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics29 Depth of Field? What? Why? How?
30
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics30 Motion Blur What? Why? How?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.