Download presentation
Presentation is loading. Please wait.
Published byPreston Golden Modified over 8 years ago
2
2 COEN 290 - Computer Graphics I Evening’s Goals n Discuss application bottleneck determination n Discuss various optimizations for making programs execute faster 2D 3D
3
3 COEN 290 - Computer Graphics I 2D Applications n “Scroller” games n Photo / Image viewing software n Photoshop-type applications
4
4 COEN 290 - Computer Graphics I How We’ve Rendered So Far … nForced to redraw every pixel in the viewport Potentially very wasteful for certain types of applications Clear the window Redraw all contents using new positions Swap Buffers Go to
5
5 COEN 290 - Computer Graphics I “Dirty Rectangles” n For 2D applications, clearing the entire window may be wasteful n Only update pixels that were “damaged” Refill where players were with background image Use Painter’s Algorithm to determine drawing order
6
6 COEN 290 - Computer Graphics I “Dirty Rectangles” Update floor Update bookcase
7
7 COEN 290 - Computer Graphics I What Makes Applications Slow n Poor data structure use in application n Too much geometry per frame Vertex transformations Lighting computations Texture coordinate generation n Too many pixels to fill Depth testing Texture mapping
8
8 COEN 290 - Computer Graphics I Keeping things “Real Time” n What’s your hardware capable of doing? Polygons / second Pixels / second n Determining what’s realistic Computing the polygon budget –Controlling model complexity Estimating how many pixels need to be filled per frame –Need to consider rejected pixels from depth testing
9
9 COEN 290 - Computer Graphics I Polygon Budget n Need to consider How many frames you want a second (Hertz) How many geometric primitives do you need to render per frame
10
10 COEN 290 - Computer Graphics I Computing Bounding Volumes n Bounding sphere Easy to compute Easy to work with Not the most accurate representation
11
11 COEN 290 - Computer Graphics I Hierarchical Bounding Volumes
12
12 COEN 290 - Computer Graphics I View Frustum Culling Needs to be computed in either eye space or world coordinates
13
13 COEN 290 - Computer Graphics I Portal Culling n Determine what geometry’s visible from a certain vantage point Useful for interior scenes: rooms, hallways, etc. n For each room For each wall (and optionally floor and ceiling) –A list of what’s visible when looking at each wall –Include what can be viewed through each portal May be possible to depth sort these primitives so that they don’t need to be depth buffered
14
14 COEN 290 - Computer Graphics I Binary Space Partition Trees n Store primitives in a binary tree based on their location to their parent n Partition space based on a primitive’s line or plane equation n Use faced-ness of primitive to determine front and back sides BF
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.