logo资料库

Graphics Gems III.pdf

第1页 / 共444页
第2页 / 共444页
第3页 / 共444页
第4页 / 共444页
第5页 / 共444页
第6页 / 共444页
第7页 / 共444页
第8页 / 共444页
资料共444页,剩余部分请下载后查看
Graphics Gems III
Cover
Copyright
About the Cover
Contents
Foreward
Preface
Mathmatical Notations
Pseudo-Code
Contributors
I Image Processing
Introduction
1-Fast Bitmap Stretching
2-General Filtered Image Rescaling
3-Optimization of Bitmap Scaling Operations
4-A Simple Color Reduction Filter
5-Compact Isocontours from Sampled Data
6-Generating Isovalue Contours from a Pixmap
7-Compositing Black-and White Bitmaps
8-2.5D Depth-Of-Field Simulation for Computer Animation
9-Fast Boundary Generator for Composited Regions
II Numerical and Programming Techniques
Introduction
1-IEEE Fast Square Root
2-Simple Fast Memory Allocator
3-The Rolling Ball
4-Interval Arithmetic
5-Fast Generation of Cyclic Sequences
6-Generic Pixel Selection Mechanism
7- Nonuniform Random Point Sets Via Warping
8-Cross Product in 4D and Beyond
9-Fast-Conn. Line Seg. in an n-D Space
III Modeling and Transformations
Introduction
1-Quarternion Interpolation w/ extra spins
2-Decomposing Projective Transformations
3-Decomposing Linear & Affine Transformations
4-Fast Random Rotation Matrices
5-Key Framing Transformations
6-Uniform Random Rotations
7-Interpolation using Bézier Curves
8-Rigid Physically Based Superquadratics
IV 2D Geometry and Algorithms
Introduction
1-Parametric Elliptical Arc Algorithm
2-Simple Conn. Algorithm for 2D Drawing
3-Fast Circle Clipping Algorithm
4-Computation of 2D Intersections
5-Joining Two lines with a Circular Arc Fillet
6-Line Seg. Intersection
7-Problem of Apollonius and Related Problems
V 3D Geometry and Algorithms
Introduction
1-Triangles Revisited
2-Partitioning 3-D Convex Polygon with An Arbitrary Plane
3-Signed Distance From Point to Plane
4-Grouping Nearly Coplanar Polygons into Coplanar Sets
5-Newell’s Method for Computing Plane Equation of Polygon
6-Plane-To-Plane Intersection
7-Triangle-Cube Intersection
8-n-Dimensional Extent Overlap Testing
9-Subdividing Simplices
10-Understanding Simploids
11-Converting Bézier Triangles into Rectangular Patches
12-Curve Tessellation Criteria Through Sampling
VI Ray Tracing and Radiosity
Introduction
1-Ray Tracing with the BSP Tree
2-Intersecting a Ray with a Quadratic Surface
3-Residency Masks & Object Space Partitioning
4-Panoramic Virtual Screen for Ray Tracing
5-Rect. Bounding Vol. for Popular Primitives
6-Linear-Time Simple Bounding Vol. Algorithm
7-Direct Lighting for Distribution Ray Tracing
8-Hemispherical Projection of a Triangle
9-Linear Radiosity Approx. Using Vertex-To Vertex Form Factors
10-Delta Form-Factor Calc. for the Cubic Tetrahedral Algorithm
11-Accurate Form-Factor Computation
VII Rendering
Introduction
1-Shadow Depth Map Revisted
2-Fast Linear Color Rendering
3-Edge & Bit-Mask Calc. for Anti-Aliasing
4-Fast Span Conversion: Unrolling Short Loops
5-Progressive Image Refinement Via Gridded Sampling
6-Polygon Scan Conversion Using Half-Open Intervals
7-Darklights
8-Anti-Aliasing in Triangular Pixels
9-Motion Blur on Graphics WorkStations
10-The Shader Cache: A Rendering Pipeline Accelerator
References
Index
A-C
C-F
F-L
L-P
P-R
R-T
T-Z
GRAPHIC GEMS II Edited by DAVID KIRK i
GRAPHIC GEMS II Edited by DAVID KIRK This is a volume in The Graphics Gems Series The Graphics Gems Series The Graphics Gems Series The Graphics Gems Series The Graphics Gems Series A Collection of Practical Techniques for the Computer Graphics Programmer Series Editor Andrew S. Glassner Xerox Palo Alto Research Center Palo Alto, Califomia ii
GRAPHIC GEMS II Edited by DAVID KIRK GGGGGRAPHICS RAPHICS RAPHICS RAPHICS RAPHICS GGGGGEMSEMSEMSEMSEMS III III III III III edited by DAVID KIRK California Institute of Technology California Institute of Technology California Institute of Technology California Institute of Technology California Institute of Technology Computer Graphics Laboratory Computer Graphics Laboratory Computer Graphics Laboratory Computer Graphics Laboratory Computer Graphics Laboratory Pasadena, California Pasadena, California Pasadena, California Pasadena, California Pasadena, California AP PROFESSIONAL Boston San Diego NewYork ˚ London Sydney Tokyo Toronto iii
Copyright (c) 1995 by Academic Press, Inc. GRAPHICS GEMS copyright (c) 1990 by Academic Press, Inc. GRAPHICS GEMS II copyright (c) 1991 by Academic Press, Inc. GRAPHICS GEMS III copyright (c) 1992 by Academic Press, Inc. QUICK REFERENCE TO COMPUTER GRAPHICS TERMS copyright (c) 1993 by Academic Press, Inc. RADIOSITY AND REALISTIC IMAGE SYNTHESIS copyright (c) 1993 by Academic Press Inc. VIRTUAL REALITY APPLICATIONS AND EXPLORATIONS copyright (c) 1993 by Academic Press Inc. All rights reserved. No part of this product may be reproduced or transmitted in any form or by any means, electronic or mechanical, including input into or storage in any information system, other than for uses specified in the License Agreement, without permission in writing from the publisher. Except where credited to another source, the C and C++ Code may be used freely to modify or create programs that are for personal use or commercial distribution. Produced in the United States of America ISBN 0-12-059756-X
GRAPHIC GEMS II Edited by DAVID KIRK About the Cover About the Cover About the Cover About the Cover About the Cover Cover image copyright reprinted from Graphics Gems III, edited by David Kirk, copyright rights reserved. 1992 The VALIS Group, RenderMan image created by The VALIS Group, 1992 Academic Press, Inc. All This cover image evolved out of a team effort between The VALIS Group, Andrew Glassner, Academic Press, and the generous cooperation and sponsorship of the folks at Pixar. Special thanks go to Tony Apodaca at Pixar for post-processing the gems in this picture using advanced Render- Man techniques. The entire cover image was created using RenderMan from Pixar. demonstrate the kind of images that can be rendered with VALIS’ products and Pixar ’s RenderMan We saw the Graphics Gems III cover as both an aesthetic challenge and an opportunity to . Given the time constraints, all of the geometry had to be kept as simple as possible so as not to require any complex and lengthy modeling efforts. Since RenderMan works best when the geometric entities used in a 3-D scene are described by high order surfaces, most of the objects consisted of surfaces made up of quadric primitives and bicubic patches. Andrew’s gem data and the Archimedean solids from the VALIS Prime RIBTM library are-the only polygonal objects in the picture. In RenderMan Once all of the objects were defined, we used Pixar’s ShowplaceTM, a 3-D scene arranging application on the Mac, to position the objects and compose the scene. Showplace also allowed us to position the camera and the standard light sources as well as attach shaders to the objects , shaders literally endow everything in the image with their own characteristic appearances, from the lights and the objects to the atmosphere. The shaders themselves are procedural descriptions of a material or other phenomenon written in the RenderMan Shading Language. We did not use any scanned textures or 2-D paint retouching software to produce this picture. Where appropriate, we used existing shaders on the surfaces of objects in this picture, taken from our commercially available VG ShadersTM + VG LooksTM libraries. For example,we used Hewn Stone Masonry (Volume 3) to create the temple wall and well; Stone Aggregate (Volume 3) for the jungle-floor, and polished metal (Volume 2) for the gold dish. In addition to these and other existing shaders, several new shaders were created for this image. The custom shaders include those for the banana leaves, the steamy jungle atmosphere, the well vapor, and the forest canopy dappled lighting effect. Shaders also allowed us to do more with the surfaces than merely effect the way they are colored. In RenderMan , shaders can transform simple surfaces into more complex forms by moving the surface geometry to add dimension and realistic detail. Using shaders we turned a cylinder into a stone well, spheres into boulders and rocks, and a flat horizontal plane into a jungle floor made up of stones and pebbles. Similarly, we altered the surface opacity to create holes in surfaces. In this instance, we produced , the ragged edges of the banana leaves and the well vapor by applying our custom RenderMan shaders to flat pieces of geometry before rendering with PhotoRealistic RenderMan . Initially, this image was composed at a screen resolution of 450 · 600 pixels on a MacIIfx using Showplace. Rendering was done transparently over the network on a Unix workstation using Pixar’s NetRenderManTM. This configuration afforded us the convenience and flexibility of using a Mac for design and a workstation for quick rendering and preview during the picture-making process. 3000 pixel resolution. The final rendering of this image was done on a 486 PC/DOS machine with Truevision’s RenderPakTM and Horizon860TM card containing 32 MBytes of RAM. Once the design was complete, the final version of the image was rendered at 2250 · During the rendering process, RenderMan separates shadows into a temporary file called a shadow map. The 2k · 2k shadow map for this image was rendered in less than an hour. However, using shaders to alter the surface geometry increases rendering time and memory requirements dramatically. As a result, we had to divide the image into 64 separate pieces and render each one individually. The total rendering time for all 64 pieces was 41.7 hours. Once these were computed, v
GRAPHIC GEMS II Edited by DAVID KIRK ABOUT THE COVER the TIFF tools from Pixar’s RenderMan ToolkitTM were used to join the pieces together into a single, 33 MByte image file. When the image was ready for output to film, we transferred the image file to a removable cartridge and sent it to a local output service. They output the electronic file onto 4 · 5 Ecktachrome color film and had it developed. The transparency was then sent to Academic Press in Cambridge, Massachusetts where they added the title and other elements to the final (over and had everything scanned and turned into four-color separations which were then supplied to their printer. We hope you like this image. Producing it was fun and educational. As you might guess, many “graphic gems” were employed in the software used to produce this picture. Mitch Prater, Senior Partner Dr. Bill Kolomyjec, Senior Partner RoseAnn Alspektor, Senior Partner The VALIS Group Pt. Richmond, CA March, 1992 vi
CONTENTS CONTENTS CONTENTS CONTENTS CONTENTS CONTENTS The Symbol C denotes gems that have accompanying C implentations in the Appendix. Foreword By Andrew Glassner Preface Mathematical Notation Pseudo-Code Contributors IIIII MAGE PROCESSING MAGE PROCESSING IIIIIMAGE PROCESSING MAGE PROCESSING MAGE PROCESSING Introduction 1. Fast Bitmap Stretching C Tomas Möller 2. General Filtered Image Rescaling C Dale Schumacher 3. Optimization of Bitmap Scaling Operations Dale Schumacher 4. A Simple Color Reduction Filter C Dennis Bragg xvii xix xxi xxiii xxviii 3 4 8 17 20 vii
CONTENTS 5. Compact Isocontours from Sampled Data Douglas Moore and Joseph Warren 6. Generating Isovalue Contours from a Pixmap C Tim Feldman 7. Compositing Black-and-White Bitmaps David Salesin and Ronen Barzel 8. 2 1 2 -D Depth-of-Field Simulation for Computer Animation Cary Scofield 9. A Fast Boundary Generator for Composited Regions C Eric Furman II II II II II UMERICAL AND PROGRAMMING UMERICAL AND PROGRAMMING NNNNNUMERICAL AND PROGRAMMING UMERICAL AND PROGRAMMING UMERICAL AND PROGRAMMING ECHNIQUES ECHNIQUES TTTTTECHNIQUES ECHNIQUES ECHNIQUES Introduction 1. IEEE Fast Square Root C Steve Hill 2. A Simple Fast Memory Allocator C Steve Hill 3. The Rolling Ball C Andrew J. Hanson 4. Interval Arithmetic C Jon Rokne 5. Fast Generation of Cyclic Sequences C Alan W. Paeth 6. A Generic Pixel Selection Mechanism Alan W. Paeth 23 29 34 36 39 47 48 49 51 61 67 77 viii
分享到:
收藏