1 / 25

CSC418 Computer Graphics

CSC418 Computer Graphics. Polygon normals Back Faces Visibility Algorithms. Polygon Normal. Triangle normal calculation Polygon normal calculation Polymeshes (vertex normals). Polygon Normal. Triangle normal calculation N=(P2-P1)X(P3-P2). P1. P3. P2. Polygon Normal.

penn
Download Presentation

CSC418 Computer Graphics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSC418 Computer Graphics • Polygon normals • Back Faces • Visibility Algorithms

  2. Polygon Normal • Triangle normal calculation • Polygon normal calculation • Polymeshes (vertex normals)

  3. Polygon Normal • Triangle normal calculation N=(P2-P1)X(P3-P2) P1 P3 P2

  4. Polygon Normal • Polygon normal calculation N=(P2-P1)X(P3-P2) Pn P1 P5 P4 P3 P2

  5. Polygon Normal • Polygon normal calculation N=(P2-P1)X(P3-P2) Problems • Sliver triangles • Non-planar polygons Pn P1 P5 P4 P3 P2

  6. Polygon Normal • Polygon normal calculation Nx = S (yj – yi)(zj + zi) Ny = S (zj – zi)(xj + xi) Nz = S (xj – xi)(yj + yi) j= (i+1) mod n Pn P1 P5 P4 P3 P2

  7. Polymesh Normal • Face normals

  8. Polymesh Normal • Vertex normals

  9. Polymesh Normal • Vertex normals average the face normals

  10. Bilinear Interpolation Puv = (1-u)(1-v)P0 + ( u )(1-v)P1 + ( u )( v )P2 + (1-u)( v )P3 P3 P2 Puv v P0 u P1

  11. Bilinear Interpolation Puv = (1-u)(1-v)P0 + ( u )(1-v)P1 + ( u )( v )P2 + (1-u)( v )P3 Gourard shading (color interpolation) P3 P2 Puv v P0 u P1

  12. Visibility Problem • What is NOT visible?

  13. Visibility Problem • What is NOT visible? primitives outside of the field of view back-facing primitives primitives occluded by other objects closer to the camera

  14. Backface culling

  15. Backface culling

  16. Backface culling N V E

  17. Backface culling • N.V > 0 is a back face?

  18. Backface culling • N.(P-E) >0 P N V E

  19. canonical projection Backface culling Where in the graphics pipeline can we do backface culling?

  20. Occluded faces Does backface culling always determine visibility completely for a single object?

  21. Occluded faces • In typical scenes some polygons will overlap, we must determine which portion of each polygon is visible to eye!

  22. Painters Algorithm • Sort primitives in Z. • Draw primitives back to front (CBA). B C A

  23. Painters Algorithm • Problems • Large faces • Intersecting faces • Cycles

  24. Visibility Problem • Image space algorithms • Operate in display terms pixels, scanlines • Visibility resolved to display resolution • Examples: Z-buffer, ray-tracing • O(n*resolution) • Object Space algorithms • Analytically compute visible fragments • Examples: painters algorithm, BSP • O(n2 )

  25. CSC418 Computer Graphics • Next Lecture • BSP trees • Depth sorting • Z-buffer A-buffer

More Related