1. 程式人生 > >關於計算機圖形學的學習

關於計算機圖形學的學習

引言

什麼是計算機圖形學? 本文儘量避免給它做嚴格的定義,但是通常來說,計算 機圖形學是數字圖象處理的逆過程,這只是一個不確切的定義,後面我們會看到, 實際上,計算機圖形學、數字圖象處理和計算機視覺在很多地方的區別不是非常 清晰的,很多概念是相通的。

計算機圖形學是用計算機來畫東西的學科,數字圖象處理是把外界獲得的圖象用 計算機進行處理的學科。在法國,圖形圖象是一門課程。

如何學習計算機圖形學呢?除了計算機圖形學的基礎知識以外,你還需要有以下 的知識,你懂的越多,當然做的越好。

  • 英語, 你一定要把英語學好,如果你想學習計算機圖形學的話,儘量看英文 的書籍和資料;
  • 數學,計算機圖形學裡面的數學用的比較多,,我們可以列舉一些常用的:高等數學,數值分析,微分幾何,拓撲,概率,插值理論,(偏)微分方程…
  • 物理,如果你要進行基於物理的建模,一些物理理論是要學習的:力學(運動學,動力學,流體力學…),光學,有限元…
  • 程式語言:C或C++是計算機圖形學最通用的‘普通話’;
  • 資料結構:你需要資料結構來描述你的圖形物件,除了通用的連結串列、樹等資料結構外,圖形學還有自己特殊的資料結構
  • 其他類別:有的時候你需要其他學科的知識,根據你的需要去學習吧

上面列舉的不是你必須學習的東西,而是計算機圖形學可能會用到的東西,一定要記住,不要指望通過一本教材就學會計算機圖形學,它比你想象的要複雜的多。

圖形學的問題

每個學科都有自己學科的特定問題,圖形學要解決的是如何畫出圖來,得到需要 的效果,當然這是圖形學最大的一個問題。

入門

在開始學習計算機圖形學的時候,找一本簡單的書看,對計算機圖形學有個大概的認識,你就可以開始圖形學之旅了:

OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 1.4, Fourth Edition
OpenGL SuperBible (3rd Edition)

是比較好的學習計算機圖形學的入門教材,在練中去學,一開始就去啃。

Foley的

Computer Graphics: Principles and Practice, Second Edition in C

不是好主意,會看的一頭霧水,一本什麼都講的書的結果往往是什麼都沒講清楚。 當你把OpenGL的基本內容掌握之後,你對圖形學就有了大概的瞭解了。

那麼下面你可以來學習一下計算機圖形學的資料結構和演算法,下面的書比較適合,Joseph O'Rourke 的

Computational Geometry in C

書裡面有C的原始碼,講述簡單,清晰,適合程式設計師學習。

建模與渲染

總的來說,計算機圖形學涉及到2大部分:建模和渲染。

建模

你想畫一個東西,首先要有它的幾何模型,那麼這個幾何模型從什麼地方來呢? 下面的書很不錯的,

Curves and Surfaces for CAGD: A Practical Guide. Gerald Farin

這本書就有一點的難度了,呵呵,要努力看啊。 它是 CAGD (計算機輔助幾何設 計)的經典圖書,CAGD 方面的全貌,還有兩本很好的講述曲面的書 Bezier 和 Nurbs 的書:

The Nurbs Book, Les A. Piegl, Wayne Tiller

書裡面有 NURBS 曲線、曲面的程式虛擬碼,很容易改成C的,書講的通俗、易懂,但是你要有耐心看的:)

曲線與曲面的數學

這本書是法國人寫的中文翻譯版,裡面還有Bezie本人寫的序J,翻譯的很不錯的, 看了你就掌握 Bezier 曲面技術了。

還有其他的一些造型技術,比如:

隱式曲面(Implicit Surface)的造型:就是用函式形式為 F( x ,y ,z ) = 0 的曲面進行造型,這樣的造型技術適合描述動物器官一樣的肉乎乎的東西,有2 本書推薦大家:

Introduction to Implicit Surfaces. Jules Bloomenthal

是一本專著,講述了 Implicit Surface 建模型(Modeling),面片化 (Polygonization),渲染(Rendering)的問題。

Implicit Objects Computer Graphics. Luiz Velho

也是一本專著,講述個更新的一些進展。

細分曲面(Subdivision Surface)造型:當用 NURBS 做造型的時候,曲面拼接 是複雜的問題,在動畫的時候,可能產生撕裂或者褶皺,Subdivision Surface 用來解決這個問題。

Subdivision Methods for Geometric Design: A Constructive Approach. Joe Warren

就是這方面的專著。

從實際物體中得到造型:現在的技術可以用三維掃描器得到物體表面的點,然後 根據這些點把物體的表面計算出來,稱為重建(Reconstruction),因為這些技術 之在文章中論述,所以我們省略對它的描述。

在你的幾何模型做好之後,有一些問題需要對這個模型進一步處理,得到適合的 模型,當面片很多的時候,或者模型很複雜的時候,需要對幾何模型進行簡化, 才可以滿足一些實時繪製的需要,這個技術叫做層次細節(LOD-Level of Detail)。下面的書就是講這個的:

Level of Detail for 3D Graphics. David Luebke

渲染

有了模型,怎麼把這個幾何模型畫出來呢?這個步驟就是渲染啦。

如果你看了上面的 OpenGL 的書,那麼你就知道一些渲染的知識了,但是別高興 的太早,OpenGL 使用的是區域性光照模型(Local Illumination Model),不要 被這個詞嚇住了。

Local illumination Model 指的是在做渲染的時候只考慮光源和物體之間的相 互作用,不考慮物體和物體之間的影響,所以 OpenGL 不支援陰影,一個(半) 透明物體的效果..,這些需要考慮物體之間的影響才可以實現。

雖然 OpenGL 本身不支援,但是通過一些方法可以實現的:),用 Google 搜尋 一下 Shadow Volume, OpenGL 就找到答案啦。

Global Illumination Model 這類模型考慮的就比較全啦。現在關於 Global Illumination 的技術有 3 大類,具體的技術就不在這裡介紹了,如果想了解,可 以聯絡我,大家一起討論。

光線追蹤(Ray Tracing)

關於Ray Tracing的好書有2本:

An Introduction to Ray tracing. Andrew Glassner

Glasser 是圖形界的名人,這本書也是 Ray Tracing 的經典。

Realistic Ray Tracing, Second Edition. R. Keith Morley, Peter Shirley

這本書第一版是虛擬碼,第二版是C程式碼。它的結構不是很清楚,虎頭蛇尾的感 覺。

輻射度(Radiosity)

關於Radiosity的好書有4本:

Radiosity and Realistic Image Synthesis. Michael Cohen

Cohen獲得 SIGGRAPH 1998 計算機圖形學成就獎,他把 Radiosity 變成實際可 用,現在 Cohen 在 MSR 圖形組。

Radiosity and Global Illumination. Francois X. Sillion

Sillion 是法國人,他的主要研究方向是 Radiosity,這本書寫的很不錯的,非 常清晰。

Philip Dutre 的新書

Advanced Global Illumination

看起來還不錯,剛拿到手,還沒看,呵呵,所以不好評價。

Radiosity: A Programmer's Perspective. Ian Ashdown

有原始碼的書啊!! 就憑這個,得給5*****。

Photon mapping

這個我也不知道怎麼翻譯,呵呵。這個技術出現的比較晚,一本好書!

Realistic Image Synthesis Using Photon Mapping. Henrik Wann Jensen

Henrik Wann Jensen是Photon mapping技術的發明者

這些也是圖形學嗎

非真實性圖形學(Non-Photorealistic Graphics

真實性不是計算機圖形學的唯一要求,比如:你給我畫一個卡通效果的圖出來, 或者我要用計算機畫水彩畫怎麼辦?或者:把圖象用文字拼出來怎麼做?,解決 這些問題要用到非真實性圖形學, 好書繼續推薦!!!

Non-Photorealistic Rendering. Bruce Gooch, Amy Ashurst Gooch

體圖形學(Volume Graphics)

用CT機做很多切片(比如頭骨),那麼能通過這些切片得到3D的頭骨嗎?Volume Graphics就是解決這樣的問題的

Volume Graphics. Min Chen

上面的2個圖形學技術就和圖象的界限不明顯了,實際上他們是圖形圖象的綜合。

CMU 圖形學開設課程簡介

關於實時渲染和 Shader 的書2

Essential Mathematics for Games and Interactive Applications, Jim Van Verth and Lars Bishop, ISBN 1-55860-863-X
GPU Gems, edited by Randima Fernando.
Collision Detection, by Gino van den Bergen (table of contents)
Game Physics, by Dave Eberly (companion web site)
ShaderX2: Introductions and Tutorials with DirectX 9, edited by Wolfgang F. Engel (table of contents)
ShaderX2: Shader Programming Tips and Tricks with DirectX 9, edited by Wolfgang F. Engel
Essential Mathematics for Games and Interactive Applications, by Jim Van Verth and Lars Bishop, Sept. 2003
Graphics Programming Methods, edited by Jeff Lander, July 2003
Real-Time 3D Terrain Engines Using C++ and DirectX 9 , by Greg Snook, June 2003
3D Computer Graphics: A Mathematical Introduction with OpenGL, by Samuel R. Buss, June 2003 (sample code, etc.)
Advanced 3D Game Programming with DirectX 9.0, by Peter Walsh and Adrian Perez, April 2003.
The Cg Tutorial: The Definitive Guide to Programmable Real-Time Graphics,
by Randima Fernando and Mark J. Kilgard, February 2003
(Sample chapters and more, Gamasutra excerpt)
Game Programming Tricks of the Trade, by Lorenzo Phillips, Sept. 2002
Direct3D ShaderX: Vertex and Pixel Shader Tips and Tricks, by Wolfgang F. Engel
(Table of Contents and more; Introduction; Samples 1 & 2),2002
The OpenGL Extensions Guide, by Eric Lengyel (table of contents and sample, in-depth table of contents)
3D Games, Volume 2: Animation and Advanced Real-Time Rendering, by Alan Watt and Fabio Policarpo
(their Fly3D SDK is online), 2003
Game Programming Gems 3, edited by Dante Treglia and Mark DeLoura,
2002 (see the series web site for upcoming volumes)
Geometric Tools for Computer Graphics, by Philip Schneider and David Eberly, Sept. 2002 (companion web site)
Focus On 3D Terrain Programming, by Trent Polack, Dec. 2002 (comes with CD; Publisher's description)
Vector Game Math Processors, by James C. Leiterman, Dec. 2002.
3D Math Primer for Graphics and Game Development, by Fletcher Dunn and Ian Parberry, Dec. 2002.
(more information at their site)
Fundamentals of Computer Graphics, by Peter Shirley, July 2002
Real-Time Shading, by Marc Olano et al., July 2002
Level of Detail for 3D Graphics, by David Luebke et al., July 2002 (companion web site)
Advanced 3D Game Development with OpenGL, by David Byttow and Ryan Parker, 2002
Real-Time Shader Programming, by Ron Fosner, Dec. 2002
Jim Blinn's Corner: Notation, Notation, Notation, by Jim Blinn, July 2002
Software Optimization Cookbook, by Richard Gerber, March 2002
Real Time Rendering Tricks and Techniques in DirectX, by Kelly Dempski, 2002
Texturing & Modeling: A Procedural Approach, 3rd Edition, by David Ebert et al., 2002 (companion web site)
Special Effects Game Programming with DirectX 8.0, by Mason McCuskey, 2002
Non-Photorealisting Computer Graphics, by Thomas Strothotte and Stefan Schlechtweg, June 2002 (companion web site)
Mathematics for 3D Game Programming & Computer Graphics, by Eric Lengyel, 2001
Game Programming Gems 2, edited by Mark DeLoura (Table of Contents and introduction), 2001
OpenGL Game Programming, by Kevin Hawkins and Dave Astle (source code), 2001
Subdivision Methods for Geometric Design: A Constructive Approach, by Joe Warren and Henrik Weimer, 2001
(companion web site and publisher's web site)
Non-Photorealistic Rendering, by Gooch and Gooch, 2001
Computer Animation: Algorithms and Techniques, by Richard Parent, 2001
Practical Algorithms for 3d Computer Graphics, by R. Stuart Ferguson, 2001
Game Programming Gems, edited by Mark DeLoura (Table of Contents and code updates), 2000
Game Engine Design: A Practical Approach to Real-Time Computer Graphics, by Dave Eberly (his code is online), 2000
3D Games, Volume 1: Real-time Rendering and Software Technology, by Alan Watt and Fabio Policarpo
(their Fly3D SDK is online), 2000
3D Graphics Programming: Games and Beyond, by Sergei Savchenko, 2000
Computational Geometry: Algorithms and Applications, by deBerg, Van Kreveld, Overmars, and Schwarzkopf, 2000
Computer Graphics Using OpenGL by F.S. Hill, Jr., 2000 (Table of Contents and sample chapter)
3D Game Engine Design, by David Eberly, Jan. 2001 (companion web site)
Essential Mathematics for Computer Graphics Fast, by John Vince,
Oct. 2001
Computer Graphics Through Key Mathematics, by Huw Jones, May 2001
Mathematics for Computer Graphics Applications, by Michael Mortenson, 1999

SIGGRAPH: 圖形學研究人員的聖地

SIGGRAPH(the ACM—Association for Computer Machinery—Special Interest Group on Computer Graphics),國內學術界一般都簡稱為國際圖形學年會,至 今已有三十多年的歷史了。它被公認為是全球計算機圖形學研究領域最負盛名的 會議,每年參加會議的人數超過4萬人,入選的40-50篇論文是從300-400篇優秀 論文中精選出來的。

在 Siggraph 上發表自己的論文,是每一個從事圖形影象學研究的人所夢寐以求 的榮譽,因為只有在圖形影象研究方面做出最尖端、最新銳、最令人激動的新發 明、新創造的人,才有機會在 Siggraph 大會上作報告。

浙江大學彭群生教授在 1988 年,與研究生邵敏之合作撰寫的有關光能輻射度新 方法的論文被美國 SIGGRAPH'88 錄用,從而實現了中國學者在這一國際最權威 的圖形學學術會議上"零"的突破。

SIGGRAPH 歷年論文情況如下所示:

Michael F. Cohen 及其論文

Michael F. Cohen 是微軟研究院的高階研究員,他在 Siggraph 1998 上贏得了計算 機圖形成就獎,他的主要貢獻是把輻射度(Radiosity)變成實際可用。


Hugues Hoppe 及其論文

Hugues Hoppe 是微軟研究院的高階研究員,他在 Siggraph 2004 上贏得了計算 機圖形成就獎,他贏得該成就獎是因為其在表面重建(surface reconstruction)、 漸進網格(progressive meshes)、幾何紋理和幾何影象方面進行了先驅性的工作。 他就漸進網格所發表的研討論文在計算機圖形領域最廣泛被引用,影響也最為深 遠。網格引數化對於對映紋理影象到表面上至關重要,極大地增強了可視細節和 質量。

他的絕大多數論文都可在其個人網站上下載,另外很有很多 demo, talks 等。

還有其它書嗎

一個講學習 3D 的理念性教程:To Those Learning 3D,內容包括 First Things First, Be an Artist 等。

還有一些好書啊,呵呵,好書看不完的:),繼續放送:

Graphics Gems I ~ V

一大幫子人寫的書,包括研究人員,程式設計師…,有計算機圖形學的各種資料結構, 程式設計技巧。

Tomas Akenine-Moller 等人編著的

Real-Time Rendering (2nd Edition)

許多最新的計算機圖形學進展。

David Ebert 等人的

Texturing & Modeling: A Procedural Approach, Third Edition

講述如何通過程式實現紋理、山、地形等圖形學要素 。

F. Kenton Musgrave 號稱分形狂(Fractal Mania),Ken Perlin 就是 Perlin 噪聲的發明者,用過 3d 軟體的人對 Perlin Noise 不會陌生的。

關於圖形學的特定物件,有特定的專題圖書:

Evan Pipho Focus On 3D Models

對於圖形學的常用模型格式,進行了講解;

  • Trent Polack的 Focus On 3D Terrain Programming 講地形的;
  • Donald H. House 的 Cloth Modeling and Animation 講布料的;
  • Nik Lever 的 Real-time 3D Character Animation with Visual C++ ,講角色動畫的。
  • Richard Parent的 Computer Animation: Algorithms and Techniques,當 然是講動畫的啦,呵呵;
  • David H. Eberly 的 3D Game Engine Design : A Practical Approach to Real-Time Computer Graphics ,有程式碼的啊!呵呵:)

最後,沒事情的時候,看看下面的書吧:

Alan H. Watt, 3D Computer Graphics (3rd Edition)

James D. Foley等人的 Computer Graphics: Principles and Practice in C (2nd Edition) ,這本聖經沒事的時候再看吧,呵呵

從哪裡找到這些書啊

我保證,上面的書在 www.amazon.com 都可以買到:) 別打我。

那好,大部分的書在國家圖書館可以影印到,北京的兄弟有福啦,3年前的書借 出來影印,1角/頁,但是新書要早圖書館裡影印,5~6角/頁,還是比 Amazon 便宜啊,呵呵。

不行大家就到國外買,合買吧,還負擔的起。

我對 DirectX 不瞭解,所以沒有涉及關於 DirectX 的內容:)