Realism in Computer Graphics
Total Page:16
File Type:pdf, Size:1020Kb
I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Realism in Computer Graphics • These notes have been created and revised each year by many generations of CS123 TAs and by John Hughes and Andy van Dam • Presented and updated in 2001 by John Alex (former 123 TA, now a Ph.D. student at MIT) • See also Chapter 14 in the book John Alex October 23, 2001 Realism 1/41 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Realism in Computer Graphics Roadmap • There are many definitions of “realism” - degree of “realism” you want to achieve depends on context – medium (still images, movie/video special effects, VR, etc.) – content – users – resources (time, money, processing power) • There are many categories of realism: – geometry and modeling – rendering – behavior – interaction • And many techniques for achieving realism within each category • Many degrees of realism within each category as well • Graphics can be realistic in some categories and unrealistic in others • Achieving realism usually requires making trade-offs – concentrate on the aspects most useful to your application • When resources run short, use hacks! John Alex October 23, 2001 Realism 2/41 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Realism and Media (1/2) • Each medium has its own standard for “realism” • In the early days of computer graphics, focus was primarily directed towards producing still images • With still images, “realism” typically meant “photorealism.” Goal was to accurately reconstruct a scene at a particular slice of time • Emphasis was placed on accurately modeling geometry and light reflection properties of surfaces • With the increasing production of animated graphics—commercials, movies, special effects, cartoons—a new standard of “realism” became important—behavior • Behavior over time: – character animation – natural phenomena: cloth, fur, hair, skin, smoke, water, clouds, wind – Newtonian physics: things that bump, collide, fall, scatter, bend, shatter etc. John Alex October 23, 2001 Realism 3/41 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Realism and Media (2/2) Real-time vs. Non-real-time • “Realistic” static images and animations are usually rendered in batch, and viewed later. They can often take hours per frame to produce. Time is a relatively unlimited resource • In contrast, other media emphasize real-time output: – graphics workstations: data visualization, 3D design – video games – virtual reality • Real-time media drastically reduce time available for geometric complexity, behavior simulation, rendering, etc. • Additionally, any media that involves user interaction (e.g., all of the above) also requires real-time interaction handling John Alex October 23, 2001 Realism 4/41 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Trade-off (1/5) Hierarchies of needs and definitions • We have a hierarchy of questions to ask before we can decide what constitutes “realism” • Are we producing stills or animated graphics? • If animated, is it real-time? • If it’s real-time, is it interactive? • What are our computing resources? • What is our content and what is our audience? • Depending on our answers to these and other questions, we’ll come up with a delicately balanced compromise between needs and costs • It’s a matter of making the right trade-off for the situation John Alex October 23, 2001 Realism 5/41 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Trade-off (2/5) Cost vs. Quality • Many computer graphics media (e.g., film vs. video vs. CRT) • Many categories of realism to attend to (far from exhaustive): – geometry – behavior – rendering – interaction • In a worst-case scenario (e.g., VR), we have to attend to all of these categories within an extremely limited time-budget • The optimal balance of resources for achieving “realism” depends a great deal on context of use: – medium – user – content – resources (especially hardware) • We will elaborate on these four points next… John Alex October 23, 2001 Realism 6/41 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Trade-off (3/5) • Medium – as said before, different media have different needs – consider a doctor examining patient’s x-rays – if the doctor is examining static transparencies, resolution and accuracy matter most – if the same doctor is interactively browsing a 3D dataset of the patient’s body online, she may be willing to sacrifice resolution or accuracy for faster navigation and the ability to zoom in at higher resolution on regions of interest • User – expert vs. novice users – data visualization: novice may see a clip of data visualization on the news, doesn’t care about fine detail (e.g., weather maps) – in contrast, expert at workstation will examine details much more closely and stumble over artifacts and small errors—“expertise” involves acute sensitivity to small fluctuations in data, anomalies, patterns, features John Alex October 23, 2001 Realism 7/41 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Trade-off (4/5) • Content – movie special-effects pack as much astonishment as possible into their budget: use every trick in the book – conversely, CAD model rendering typically elides detail for clarity, and fancy effects only interfere with communication – Scientific visualizations show artifacts and holes in the data, don’t smooth them out. Also, don’t introduce artifacts due to geometric or rendering approximations (e.g., contouring) • Resources – you settle for what you can get: – Intel 286 (1989): wireframe bounding boxes – nVidia GeForce 3 (2001) texture-mapped, environment-mapped, bump-mapped, shadow-mapped, high- polygon, articulated, physically-simulated bliss at 60 hertz for $300 – Microsoft Xbox (Nov. 2001): complete computer with graphics more powerful than a GeForce 3 for about $300 John Alex October 23, 2001 Realism 8/41 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Trade-off (5/5) Computing to a time budget (“time-critical” algos) • A vast array of techniques have been developed for generating “realistic” geometry, behavior, rendering… • The “best” can often be traded for the “good” at a much lower computational price • We call bargain-basement deals “hacks” • Some techniques use progressive refinement (or its inverse, graceful degradation): the more time we spend, the better output we get. Excellent for situations when we want the best quality output we can get for a fixed period of time, but we can’t overshoot our time limit (e.g., VR surgery!). Maintaining constant update rates is a form of guaranteed “Quality of Service” (a networking term). – web image downloads – progressive refinement for extremely large meshes John Alex October 23, 2001 Realism 9/41 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Digression - Definitions • Texture-Maps: map an image onto surface geometry to create the appearance of fine surface detail. A high level of realism may require many layers of textures. • Environment-Maps: multiple image maps which record the global reflection and lighting on a object. These image maps are resampled during rendering to extract view- specific information which is then applied as a texture to the object. • Bump-Maps: fake surface normals by applying a height field (intensities in the map indicate height above surface). From height field calculate gradient across surface and use this to perturb the surface normal. • Shadow-Maps: generate shadow texture by taking silhouettes of objects as seen from the light source. Project texture onto scene from light source. Note: must be recalculated for moving lights. John Alex October 23, 2001 Realism 10/41 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Techniques—Geometry (1/3) • The Hacked – Texture mapping: excellent way to fake fine surface detail—more often used to fake geometry than to add pretty colors – more complicated texture mapping strategies such as polynomial texture maps use image-based rendering techniques (see slide 23) for added realism • The Good – Polygonization: very finely tessellated meshings of curved surfaces John Alex October 23, 2001 Realism 11/41 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Techniques—Geometry (2/3) The Best • Splines – no polygons at all! Continuous mathematical surface representations (polynomials) – 2D and 3D curved surfaces: Non-Uniform Rational B-Splines (NURBS) – high order polynomials are hard to work with • Implicit Surfaces (blobbies) • Subdivision Surfaces – elegantly avoid gapping and tearing – support creases – allow multi-resolution deformations (editing of lower resolution representation of surface) John Alex October 23, 2001 Realism 12/41 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Techniques—Geometry (3/3) • The Gracefully Degraded – Level-of-Detail(LOD): as object gets farther away from viewer, replace it with a lower-polygon version or lower quality texture map.