0% found this document useful (0 votes)
66 views88 pages

Opengl Shading Language PDF Download

The document provides information about the OpenGL Shading Language, a high-level procedural shading language for OpenGL, which allows developers to control graphics-processing stages. It includes a detailed introduction, examples of shaders, and an API function reference. The book serves as both a reference and tutorial for programmers transitioning to programmable graphics hardware.

Uploaded by

chanyaruddhy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views88 pages

Opengl Shading Language PDF Download

The document provides information about the OpenGL Shading Language, a high-level procedural shading language for OpenGL, which allows developers to control graphics-processing stages. It includes a detailed introduction, examples of shaders, and an API function reference. The book serves as both a reference and tutorial for programmers transitioning to programmable graphics hardware.

Uploaded by

chanyaruddhy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 88

Opengl Shading Language download

https://ebookbell.com/product/opengl-shading-language-981838

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Opengl Shading Language Rost Randi Jginsburg Danlichtenbelt

https://ebookbell.com/product/opengl-shading-language-rost-randi-
jginsburg-danlichtenbelt-22104632

Opengl Shading Language 2nd Edition Randijrost

https://ebookbell.com/product/opengl-shading-language-2nd-edition-
randijrost-929564

Opengl 4 Shading Language Cookbook 3rd Edition David Wolff

https://ebookbell.com/product/opengl-4-shading-language-cookbook-3rd-
edition-david-wolff-23946184

Opengl 4 Shading Language Cookbook 2nd Edition David Wolff

https://ebookbell.com/product/opengl-4-shading-language-cookbook-2nd-
edition-david-wolff-5496506
Openglr Shading Language 2nd Edition 2nd Edition Randi J Rost

https://ebookbell.com/product/openglr-shading-language-2nd-
edition-2nd-edition-randi-j-rost-1463316

Openglr Shading Language Randi J Rost

https://ebookbell.com/product/openglr-shading-language-randi-j-
rost-1354912

Opengl 40 Shading Language Cookbook David Wolff

https://ebookbell.com/product/opengl-40-shading-language-cookbook-
david-wolff-2381738

Opengl Build High Performance Graphics Learning Path 1st Edition


Muhammad Mobeen Movania David Wolff Raymond C H Lo

https://ebookbell.com/product/opengl-build-high-performance-graphics-
learning-path-1st-edition-muhammad-mobeen-movania-david-wolff-raymond-
c-h-lo-47374330

Opengl Programming Guide The Official Guide To Learning Opengl


Versions 30 And 31 R 5th Edition Shreiner

https://ebookbell.com/product/opengl-programming-guide-the-official-
guide-to-learning-opengl-versions-30-and-31-r-5th-edition-
shreiner-22104630
Contents

1. main
2. Table of Contents
3. Copyright
4. Praise for OpenGL® Shading Language
5. Foreword
6. Preface
7. Intended Audience
8. About This Book
9. About the Shader Examples
10. Errata
11. Typographical Conventions
12. About the Author
13. About the Contributors
14. Acknowledgments
15. Color Plates
16. Chapter 1. Review of OpenGL Basics
17. 1.1 OpenGL History
18. 1.2 Evolving OpenGL
19. 1.3 Execution Model
20. 1.4 The Frame Buffer
21. 1.5 State
22. 1.6 Processing Pipeline
23. 1.7 Drawing Geometry
24. 1.8 Drawing Images
25. 1.9 Coordinate Transforms
26. 1.10 Texturing
27. 1.11 Summary
28. 1.12 Further Information
29. Chapter 2. Basics
30. 2.1 Introduction to the OpenGL Shading Language
31. 2.2 Why Write Shaders?
32. 2.3 OpenGL Programmable Processors
33. 2.4 Language Overview
34. 2.5 System Overview
35. 2.6 Key Benefits
36. 2.7 Summary
37. 2.8 Further Information
38. Chapter 3. Language Definition
39. 3.1 Example Shader Pair
40. 3.2 Data Types
41. 3.3 Initializers and Constructors
42. 3.4 Type Conversions
43. 3.5 Qualifiers and Interface to a Shader
44. 3.6 Flow Control
45. 3.7 Operations
46. 3.8 Preprocessor
47. 3.9 Preprocessor Expressions
48. 3.10 Error Handling
49. 3.11 Summary
50. 3.12 Further Information
51. Chapter 4. The OpenGL Programmable Pipeline
52. 4.1 The Vertex Processor
53. 4.2 The Fragment Processor
54. 4.3 Built-in Uniform Variables
55. 4.4 Built-in Constants
56. 4.5 Interaction with OpenGL Fixed Functionality
57. 4.6 Summary
58. 4.7 Further Information
59. Chapter 5. Built-in Functions
60. 5.1 Angle and Trigonometry Functions
61. 5.2 Exponential Functions
62. 5.3 Common Functions
63. 5.4 Geometric Functions
64. 5.5 Matrix Functions
65. 5.6 Vector Relational Functions
66. 5.7 Texture Access Functions
67. 5.8 Fragment Processing Functions
68. 5.9 Noise Functions
69. 5.10 Summary
70. 5.11 Further Information
71. Chapter 6. Simple Shading Example
72. 6.1 Brick Shader Overview
73. 6.2 Vertex Shader
74. 6.3 Fragment Shader
75. 6.4 Observations
76. 6.5 Summary
77. 6.6 Further Information
78. Chapter 7. OpenGL Shading Language API
79. 7.1 Creating Shader Objects
80. 7.2 Compiling Shader Objects
81. 7.3 Linking and Using Shaders
82. 7.4 Cleaning Up
83. 7.5 Query Functions
84. 7.6 Specifying Vertex Attributes
85. 7.7 Specifying Uniform Variables
86. 7.8 Samplers
87. 7.9 Development Aids
88. 7.10 Implementation-Dependent API Values
89. 7.11 Application Code for Brick Shaders
90. 7.12 Summary
91. 7.13 Further Information
92. Chapter 8. Shader Development
93. 8.1 General Principles
94. 8.2 Performance Considerations
95. 8.3 Shader Debugging
96. 8.4 Shader Development Tools
97. 8.5 Summary
98. 8.6 Further Information
99. Chapter 9. Traditional Shaders
100. 9.1 Transformation
101. 9.2 Light Sources
102. 9.3 Material Properties and Lighting
103. 9.4 Two-Sided Lighting
104. 9.5 No Lighting
105. 9.6 Fog
106. 9.7 Texture Coordinate Generation
107. 9.8 User Clipping
108. 9.9 Texture Application
109. 9.10 Summary
110. 9.11 Further Information
111. Chapter 10. Stored Texture Shaders
112. 10.1 Accessing Texture Maps from a Shader
113. 10.2 Simple Texturing Example
114. 10.3 Multitexturing Example
115. 10.4 Environment Mapping Example
116. 10.5 Polynomial Texture Mapping with BRDF Data
117. 10.6 Summary
118. 10.7 Further Information
119. Chapter 11. Procedural Texture Shaders
120. 11.1 Regular Patterns
121. 11.2 Toy Ball
122. 11.3 Lattice
123. 11.4 Bump Mapping
124. 11.5 Summary
125. 11.6 Further Information
126. Chapter 12. Noise
127. 12.1 Defining Noise
128. 12.2 Noise Textures
129. 12.3 Trade-offs
130. 12.4 A Simple Noise Shader
131. 12.5 Turbulence
132. 12.6 Granite
133. 12.7 Wood
134. 12.8 Summary
135. 12.9 Further Information
136. Chapter 13. Animated Shaders
137. 13.1 On/Off
138. 13.2 Threshold
139. 13.3 Translation
140. 13.4 Key-Frame Interpolation
141. 13.5 Other Blending Effects
142. 13.6 Particle Systems
143. 13.7 Wobble
144. 13.8 Summary
145. 13.9 Further Information
146. Chapter 14. Antialiasing Procedural Textures
147. 14.1 Sources of Aliasing
148. 14.2 Avoiding Aliasing
149. 14.3 Increasing Resolution
150. 14.4 Antialiased Stripe Example
151. 14.5 Frequency Clamping
152. 14.6 Summary
153. 14.7 Further Information
154. Chapter 15. Non-Photorealistic Shaders
155. 15.1 Hatching Example
156. 15.2 Technical Illustration Example
157. 15.3 Mandelbrot Example
158. 15.4 Summary
159. 15.5 Further Information
160. Chapter 16. Shaders for Imaging
161. 16.1 Geometric Image Transforms
162. 16.2 Mathematical Mappings
163. 16.3 Lookup Table Operations
164. 16.4 Color Space Conversions
165. 16.5 Image Interpolation and Extrapolation
166. 16.6 Blend Modes
167. 16.7 Convolution
168. 16.8 Summary
169. 16.9 Further Information
170. Chapter 17. Language Comparison
171. 17.1 Chronology of Shading Languages
172. 17.2 RenderMan
173. 17.3 OpenGL Shader (ISL)
174. 17.4 HLSL
175. 17.5 Cg
176. 17.6 Summary
177. 17.7 Further Information
178. Appendix A. Language Grammar
179. Appendix B. API Function Reference
180. glAttachObjectARB
181. glBindAttribLocationARB
182. glCompileShaderARB
183. glCreateProgramObjectARB
184. glCreateShaderObjectARB
185. glDeleteObjectARB
186. glDetachObjectARB
187. glEnableVertexAttribArrayARB
188. glGetActiveAttribARB
189. glGetActiveUniformARB
190. glGetAttachedObjectsARB
191. glGetAttribLocationARB
192. glGetHandleARB
193. glGetInfoLogARB
194. glGetObjectParameterARB
195. glGetShaderSourceARB
196. glGetUniformARB
197. glGetUniformLocationARB
198. glGetVertexAttribARB
199. glGetVertexAttribPointervARB
200. glLinkProgramARB
201. glShaderSourceARB
202. glUniformARB
203. glUseProgramObjectARB
204. glValidateProgramARB
205. glVertexAttribARB
206. glVertexAttribPointerARB
207. Afterword
208. Glossary
209. Further Reading

< Day Day Up >

Table of Contents
OpenGL Shading Language
By Randi J. Rost

Publisher: Addison Wesley


Pub Date: February 20, 2004
ISBN: 0-321-19789-5
Pages: 608

The OpenGL Shading Language, a high-level procedural shading


language for OpenGL, is the most important new development in
graphics programming to emerge in years. OpenGL is the leading
cross-platform 3D-graphics API, and the OpenGL Shading Language
allows developers to take total control over the most important stages
of the graphics-processing pipeline.

OpenGL Shading Language is the experienced application


programmer's guide to writing shaders. Part reference, part tutorial, this
book thoroughly explains the shift from fixed-functionality graphics
hardware to the new era of programmable graphics hardware and the
additions to the OpenGL API that support this programmability. With
OpenGL and shaders written in the OpenGL Shading Language,
applications can perform better, achieving stunning graphics effects by
utilizing the capabilities of both the visual processing unit and the central
processing unit.

In this book, you will find a detailed introduction to the OpenGL


Shading Language and the new OpenGL function calls that support it.
The text begins by describing the syntax and semantics of this high-level
programming language. Once this foundation has been established, the
book explores the creation and manipulation of shaders using new
OpenGL function calls.

OpenGL Shading Language features extensive examples of shaders


and their underlying algorithms, including

• Procedural texturing

• Noise

• Particle systems

• Hatching

• Analytic antialiasing

• Image processing

The color plate section illustrates the power and sophistication of the
OpenGL Shading Language. The API Function Reference at the end of
the book is an excellent quick reference to the API entry points that
support the OpenGL Shading Language. An enhanced online index
allows readers to quickly and easily search the entire text for specific
topics.

< Day Day Up >

< Day Day Up >

Table of Contents
OpenGL Shading Language
By Randi J. Rost
Publisher: Addison Wesley
Pub Date: February 20, 2004
ISBN: 0-321-19789-5
Pages: 608

Copyright
Praise for OpenGL Shading Language
Foreword
Preface
Intended Audience
About This Book
About the Shader Examples
Errata
Typographical Conventions

About the Author


About the Contributors
Acknowledgments
Color Plates
Chapter 1. Review of OpenGL Basics
Section 1.1. OpenGL History
Section 1.2. Evolving OpenGL
Section 1.3. Execution Model
Section 1.4. The Frame Buffer
Section 1.5. State
Section 1.6. Processing Pipeline
Section 1.7. Drawing Geometry
Section 1.8. Drawing Images
Section 1.9. Coordinate Transforms
Section 1.10. Texturing
Section 1.11. Summary
Section 1.12. Further Information

Chapter 2. Basics
Section 2.1. Introduction to the OpenGL Shading Language
Section 2.2. Why Write Shaders?
Section 2.3. OpenGL Programmable Processors
Section 2.4. Language Overview
Section 2.5. System Overview
Section 2.6. Key Benefits
Section 2.7. Summary
Section 2.8. Further Information

Chapter 3. Language Definition


Section 3.1. Example Shader Pair
Section 3.2. Data Types
Section 3.3. Initializers and Constructors
Section 3.4. Type Conversions
Section 3.5. Qualifiers and Interface to a Shader
Section 3.6. Flow Control
Section 3.7. Operations
Section 3.8. Preprocessor
Section 3.9. Preprocessor Expressions
Section 3.10. Error Handling
Section 3.11. Summary
Section 3.12. Further Information

Chapter 4. The OpenGL Programmable Pipeline


Section 4.1. The Vertex Processor
Section 4.2. The Fragment Processor
Section 4.3. Built-in Uniform Variables
Section 4.4. Built-in Constants
Section 4.5. Interaction with OpenGL Fixed Functionality
Section 4.6. Summary
Section 4.7. Further Information
Chapter 5. Built-in Functions
Section 5.1. Angle and Trigonometry Functions
Section 5.2. Exponential Functions
Section 5.3. Common Functions
Section 5.4. Geometric Functions
Section 5.5. Matrix Functions
Section 5.6. Vector Relational Functions
Section 5.7. Texture Access Functions
Section 5.8. Fragment Processing Functions
Section 5.9. Noise Functions
Section 5.10. Summary
Section 5.11. Further Information

Chapter 6. Simple Shading Example


Section 6.1. Brick Shader Overview
Section 6.2. Vertex Shader
Section 6.3. Fragment Shader
Section 6.4. Observations
Section 6.5. Summary
Section 6.6. Further Information

Chapter 7. OpenGL Shading Language API


Section 7.1. Creating Shader Objects
Section 7.2. Compiling Shader Objects
Section 7.3. Linking and Using Shaders
Section 7.4. Cleaning Up
Section 7.5. Query Functions
Section 7.6. Specifying Vertex Attributes
Section 7.7. Specifying Uniform Variables
Section 7.8. Samplers
Section 7.9. Development Aids
Section 7.10. Implementation-Dependent API Values
Section 7.11. Application Code for Brick Shaders
Section 7.12. Summary
Section 7.13. Further Information

Chapter 8. Shader Development


Section 8.1. General Principles
Section 8.2. Performance Considerations
Section 8.3. Shader Debugging
Section 8.4. Shader Development Tools
Section 8.5. Summary
Section 8.6. Further Information

Chapter 9. Traditional Shaders


Section 9.1. Transformation
Section 9.2. Light Sources
Section 9.3. Material Properties and Lighting
Section 9.4. Two-Sided Lighting
Section 9.5. No Lighting
Section 9.6. Fog
Section 9.7. Texture Coordinate Generation
Section 9.8. User Clipping
Section 9.9. Texture Application
Section 9.10. Summary
Section 9.11. Further Information

Chapter 10. Stored Texture Shaders


Section 10.1. Accessing Texture Maps from a Shader
Section 10.2. Simple Texturing Example
Section 10.3. Multitexturing Example
Section 10.4. Environment Mapping Example
Section 10.5. Polynomial Texture Mapping with BRDF Data
Section 10.6. Summary
Section 10.7. Further Information

Chapter 11. Procedural Texture Shaders


Section 11.1. Regular Patterns
Section 11.2. Toy Ball
Section 11.3. Lattice
Section 11.4. Bump Mapping
Section 11.5. Summary
Section 11.6. Further Information

Chapter 12. Noise


Section 12.1. Defining Noise
Section 12.2. Noise Textures
Section 12.3. Trade-offs
Section 12.4. A Simple Noise Shader
Section 12.5. Turbulence
Section 12.6. Granite
Section 12.7. Wood
Section 12.8. Summary
Section 12.9. Further Information

Chapter 13. Animated Shaders


Section 13.1. On/Off
Section 13.2. Threshold
Section 13.3. Translation
Section 13.4. Key-Frame Interpolation
Section 13.5. Other Blending Effects
Section 13.6. Particle Systems
Section 13.7. Wobble
Section 13.8. Summary
Section 13.9. Further Information

Chapter 14. Antialiasing Procedural Textures


Section 14.1. Sources of Aliasing
Section 14.2. Avoiding Aliasing
Section 14.3. Increasing Resolution
Section 14.4. Antialiased Stripe Example
Section 14.5. Frequency Clamping
Section 14.6. Summary
Section 14.7. Further Information
Chapter 15. Non-Photorealistic Shaders
Section 15.1. Hatching Example
Section 15.2. Technical Illustration Example
Section 15.3. Mandelbrot Example
Section 15.4. Summary
Section 15.5. Further Information

Chapter 16. Shaders for Imaging


Section 16.1. Geometric Image Transforms
Section 16.2. Mathematical Mappings
Section 16.3. Lookup Table Operations
Section 16.4. Color Space Conversions
Section 16.5. Image Interpolation and Extrapolation
Section 16.6. Blend Modes
Section 16.7. Convolution
Section 16.8. Summary
Section 16.9. Further Information

Chapter 17. Language Comparison


Section 17.1. Chronology of Shading Languages
Section 17.2. RenderMan
Section 17.3. OpenGL Shader (ISL)
Section 17.4. HLSL
Section 17.5. Cg
Section 17.6. Summary
Section 17.7. Further Information

Appendix A. Language Grammar


Appendix B. API Function Reference
glAttachObjectARB
glBindAttribLocationARB
glCompileShaderARB
glCreateProgramObjectARB
glCreateShaderObjectARB
glDeleteObjectARB
glDetachObjectARB
glEnableVertexAttribArrayARB
glGetActiveAttribARB
glGetActiveUniformARB
glGetAttachedObjectsARB
glGetAttribLocationARB
glGetHandleARB
glGetInfoLogARB
glGetObjectParameterARB
glGetShaderSourceARB
glGetUniformARB
glGetUniformLocationARB
glGetVertexAttribARB
glGetVertexAttribPointervARB
glLinkProgramARB
glShaderSourceARB
glUniformARB
glUseProgramObjectARB
glValidateProgramARB
glVertexAttribARB
glVertexAttribPointerARB

Afterword
Glossary
Further Reading
< Day Day Up >

< Day Day Up >


Copyright

Many of the designations used by manufacturers and sellers to


distinguish their products are claimed as trademarks. Where those
designations appear in this book, and Addison-Wesley was aware of a
trademark claim, the designations have been printed with initial capital
letters or in all capitals.

The author and publisher have taken care in the preparation of this
book, but make no expressed or implied warranty of any kind and
assume no responsibility for errors or omissions. No liability is assumed
for incidental or consequential damages in connection with or arising
out of the use of the information or programs contained herein.

Hewlett-Packard Company makes no warranty as to the accuracy or


completeness of the material included in this text and hereby disclaims
any responsibility therefore.

The publisher offers discounts on this book when ordered in quantity


for bulk purchases and special sales. For more information, please
contact:

U.S. Corporate and Government Sales


(800) 382-3419
[email protected]

For sales outside of the U.S., please contact:

International Sales
(317) 581-3793
[email protected]

Visit Addison-Wesley on the Web: www.awprofessional.com

Library of Congress Cataloging-in-Publication Data

Rost, Randi J., 1960-


Open GL. shading language / Randi Rost ; with contributions by John
M. Kessenich and Barthold Lichtenbelt.
< Day Day Up >

< Day Day Up >


Praise for OpenGL Shading
Language

"The author has done an excellent job at setting the stage for shader
development, what the purpose is, how to do it, and how it all fits
together. He then develops on the advanced topics covering a great
breadth in the appropriate level of detail. Truly a necessary book to
own for any graphics developer!"

—Jeffery Galinovsky
Strategic Software Program Manager, Intel Corporation

"OpenGL Shading Language provides a timely, thorough, and


entertaining introduction to the only OpenGL ARB-approved high-level
shading language in existence. Whether an expert or a novice, there are
gems to be discovered throughout the book, and the reference pages
will be your constant companion as you dig into the depths of the
shading APIs. From algorithms to APIs, this book has you covered."

—Bob Kuehne
CEO, Blue Newt Software

"Computer graphics and rendering technologies just took a giant leap


forward with hardware vendors rapidly adopting the new OpenGL
Shading Language. This book presents a detailed treatment of these
exciting technologies in a way that is extremely helpful for visualization
and game developers."

—Andy McGovern
Founder, Virtual Geographics, Inc.

"The OpenGL Shading Language is at the epicenter of the


programmable graphics revolution, and Randi Rost has been at the
center of the development of this significant new industry standard. If
you need the inside track on how to use the OpenGL Shading
Language to unleash new visual effects, and unlock the supercomputer
hiding inside the new generation of graphics hardware, then this is the
book for you."

—Neil Trevett
Senior Vice President Market Development, 3Dlabs
< Day Day Up >

< Day Day Up >


Foreword

This book is an amazing measure of how far and how fast interactive
shading has advanced. Not too many years ago, procedural shading
was something done only in offline production rendering, creating some
of the great results we all know from the movies, but were not
anywhere close to interactive. Then a few research projects appeared,
allowing a slightly modified but largely intact type of procedural shading
to run in real-time. Finally, in a rush, widely accessible commercial
systems started to support shading. Today, we've come to the point
where a real-time shading language developed by a cross-vendor
group of OpenGL participants has achieved official designation as an
OpenGL Architecture Review Board approved extension. This book,
written by one of those most responsible for spearheading the
development and acceptance of the OpenGL shading language, is your
guide to that language and the extensions to OpenGL that let you use it.

I came to my interest in procedural shading from a strange direction. In


1990, I started graduate school at the University of North Carolina in
Chapel Hill because it seemed like a good place for someone whose
primary interest was interactive 3D graphics. There, I started working
on the Pixel-Planes project. This project had produced a new graphics
machine with several interesting features beyond its performance at
rendering large numbers of polygons per second. One feature in
particular had an enormous impact on the research directions I've
followed for the past 13 years. Pixel-Planes 5 had programmable pixel
processors—lots of them. Programming these processors was similar in
many ways to the assembly-language fragment programs that have
burst onto the graphics scene in the past few years.

Programming them was exhilarating, yet also thoroughly exasperating.

I was far from the only person to notice both the power and pain of
writing low-level code to execute per-pixel. Another group within the
Pixel-Planes team built an assembler for shading code to make it a little
easier to write, although it was still both difficult to write a good shader
and ever-so-rewarding once you had it working. The shaders
produced will be familiar to anyone who has seen demos of any of the
latest graphics products, and not surprisingly you'll find versions of
many of them in this book: wood, clouds, brick, rock, reflective wavy
water, and (of course) the Mandelbrot fractal set.

The rewards and difficulties presented by Pixel-Planes 5 shaders


guided many of the design decisions behind the next machine,
PixelFlow. PixelFlow was designed and built by a university/industry
partnership with industrial participation first by Division, then by
Hewlett-Packard. The result was the first interactive system capable of
running procedural shaders compiled from a high-level shading
< Day Day Up >

< Day Day Up >


Preface

For just about as long as there has been graphics hardware, there has
been programmable graphics hardware. Over the years, building
flexibility into graphics hardware designs has been a necessary way of
life for hardware developers. Graphics APIs continue to evolve, and
because a hardware design can take two years or more from start to
finish, the only way to guarantee a hardware product that can support
the then-current graphics APIs at its release is to build in some degree
of programmability from the very beginning.

Until recently, the realm of programming graphics hardware belonged


to just a few people, mainly researchers and graphics hardware driver
developers. Research into programmable graphics hardware has been
taking place for many years, but the point of this research has not been
to produce viable hardware and software for application developers
and end users. The graphics hardware driver developers have focused
on the immediate task of providing support for the important graphics
APIs of the time: PHIGS, PEX, Iris GL, OpenGL, Direct3D, and so
on. Until recently, none of these APIs exposed the programmability of
the underlying hardware, so application developers have been forced
into using the fixed functionality provided by traditional graphics APIs.

Hardware companies have not exposed the programmable


underpinnings of their products because there is a high cost of
educating and supporting customers to use low-level, device-specific
interfaces and because these interfaces typically change quite radically
with each new generation of graphics hardware. Application
developers who use such a device-specific interface to a piece of
graphics hardware face the daunting task of updating their software for
each new generation of hardware that comes along. And forget about
supporting the application on hardware from multiple vendors!

As we move into the 21st century, some of these fundamental tenets


about graphics hardware are being challenged. Application developers
are pushing the envelope as never before and demanding a variety of
new features in hardware in order to create more and more
sophisticated onscreen effects. As a result, new graphics hardware
designs are more programmable than ever before. Standard graphics
APIs have been challenged to keep up with the pace of hardware
innovation. For OpenGL, the result has been a spate of extensions to
the core API as hardware vendors struggle to support a range of
interesting new features that their customers are demanding.

So we are standing today at a crossroads for the graphics industry. A


paradigm shift is occurring, one that is taking us from the world of rigid,
fixed functionality graphics hardware and graphics APIs to a brave new
world where the visual processing unit, or VPU (i.e., graphics
< Day Day Up >

< Day Day Up >


Intended Audience

The primary audience for this book is application programmers that are
interested in writing shaders. This book is intended to be used as both a
tutorial and a reference book by people interested in learning to write
shaders with the OpenGL Shading Language. Some will use the book
in one fashion and some in the other. It is hoped that the organization
will be amenable to both uses. It is not expected that most people will
read the book in sequential order from back to front.

Readers do not need previous knowledge of OpenGL in order to


absorb the material in this book, but it is very helpful. A brief review of
OpenGL is included, but this book does not attempt to be a tutorial or
reference book for OpenGL. Anyone attempting to develop an
OpenGL application that uses shaders should be armed with OpenGL
programming documentation in addition to this book.

Computer graphics has a mathematical basis, therefore some


knowledge of algebra and trigonometry will help readers understand
and appreciate some of the details presented. With the advent of
programmable graphics hardware, key parts of the graphics processing
pipeline are once again under the control of software developers. In
order to develop shaders successfully in this environment, it is
imperative that developers understand the mathematical basis of
computer graphics.

< Day Day Up >

< Day Day Up >


About This Book

This book has three main parts. Chapters 1 through 8 are aimed at
teaching the reader about the OpenGL Shading Language and how to
use it. This part of the book covers details of the language and details
of the OpenGL commands that are used to create and manipulate
shaders. In order to provide the reader with a basis for writing shaders,
Chapters 9 through 16 contain a gallery of shader examples and some
explanation of the underlying algorithms. This part of the book is
intended to be used as a basis for the reader's shader development and
as a springboard to inspire new ideas. Finally, Chapter 17 contains a
comparison with other notable commercial shading languages, and
Appendices A and B contain reference material for the language and
the API entry points that support it.

The chapters are arranged to suit the needs of the reader who is least
familiar with OpenGL and shading languages. Certain chapters can be
skipped by readers who are more familiar with both topics. People
don't necessarily read technical books from front to back, and this
book is designed to have somewhat compartmentalized chapters in
order to allow such usage.

• Chapter 1 contains a review of the fundamentals of the


OpenGL API. Readers already familiar with OpenGL may skip
to Chapter 2.

• Chapter 2 provides an introduction to the OpenGL Shading


Language and the OpenGL entry points that have been added
to support it. If you want to know what the OpenGL Shading
Language is all about and you have time to read only one
chapter of this book, this is the one to read.

• Chapter 3 thoroughly describes the OpenGL Shading


Language. This material is organized to present the details of a
programming language. This section will be useful as a
reference section after readers have developed a general
understanding of the language.

• Chapter 4 discusses how the newly defined programmable


parts of the rendering pipeline interact with each other and with
OpenGL's fixed functionality. This discussion includes
descriptions of the built-in variables defined in the OpenGL
Shading Language.
< Day Day Up >

< Day Day Up >


About the Shader Examples

The shaders contained in this book are primarily short programs


designed to illustrate the capabilities of the OpenGL Shading Language.
None of the example shaders should be presumed to illustrate the
"best" way of achieving a particular effect. (Indeed, the "best" way to
implement certain effects may have yet to be discovered through the
power and flexibility of programmable graphics hardware.)
Performance improvements for each shader are possible for any given
hardware target. For most of the shaders, image quality may be
improved by taking greater care to reduce or eliminate causes of
aliasing.

The source code for these shaders is written in a way that I believe
represents a reasonable trade-off between source code clarity,
portability, and performance. Use them to learn the OpenGL Shading
Language, and improve upon them for use in your own projects.

With the exception of the images produced for the toy ball shader
(which were produced by ATI Research, Inc. on ATI hardware), all of
the images produced for this book were done on the first graphics
accelerator to provide support for the OpenGL Shading Language, the
3Dlabs Wildcat VP. This implementation has a variety of limitations, so
in a number of cases the image was generated with a shader that could
run on this hardware but contained hardware- or driver-dependent
idiosyncracies. A cleaned up version of such shaders is then presented
and discussed in this book. I have taken as much care as possible to
present shaders that are done "the right way" for the OpenGL Shading
Language rather than those with idiosyncracies due to being developed
on the very first implementation. I also have tried to be as careful as I
could be during the translation to cleaned up versions of the shaders.
The latest and greatest versions of these shaders will be available
through a link at this book's Web site at http://3dshaders.com.

The development of this book occurred while OpenGL Shading


Language implementations were still very much in their infancy. In
choosing shader examples to include and discuss, my goal was to
provide working shaders, not shaders that should work after
implementations became capable of supporting the whole breadth of
the OpenGL Shading Language specification. Longer, more complex
shader examples are prime candidates for inclusion in the second
edition of this book, as are shaders that utilize features that are not yet
available in any implementation.
< Day Day Up >

< Day Day Up >

Errata

I know that this book contains some errors, but I've done my best to
keep them to a minimum. If you find any errors, please report them to
me ([email protected]) and I will keep a running list on this book's
Web site at http://3dshaders.com.

< Day Day Up >

< Day Day Up >


Typographical Conventions

This book contains a number of typographical conventions that are


intended to enhance readability and understanding.

• SMALL CAPS are used for the first occurrence of defined


terms.

• Italics are used for emphasis, document titles, and coordinate


values such as x, y, and z.

• Bold serif is used for language keywords.


• Sans serif is used for macros and symbolic constants that


appear in the text.

• Bold sans serif is used for function names.


• Italic sans serif is used for variables, parameter names, spatial


dimensions, and matrix components.

• Fixed width is used for code examples.


< Day Day Up >

< Day Day Up >


About the Author

Randi Rost is currently the manager of 3Dlabs' Fort Collins, Colorado


graphics software team. This group is driving the definition of the
OpenGL 2.0 standard and implementing OpenGL drivers for 3Dlabs'
graphics products. Prior to joining 3Dlabs, Randi was a graphics
software architect for Hewlett-Packard's Graphics Software Lab and
the chief architect for graphics software at Kubota Graphics
Corporation.

Randi has been involved in the graphics industry for more than 25 years
and has participated in emerging graphics standards efforts for over 15
years. He has been involved with the design and evolution of OpenGL
since before version 1.0 was released in 1992. He is one of the few
people credited as a contributor for each major revision of OpenGL,
up through and including OpenGL 1.5. He was one of the chief
architects and the specification author for PEX, and he was a member
of the Graphics Performance Characterization (GPC) Committee
during the development of the Picture-Level Benchmark (PLB). He
served as 3Dlabs' representative to the Khronos Group from the time
the group started in 1999 until the OpenML 1.0 specification was
released, and he chaired the graphics subcommittee of that organization
during this time. He received the National Computer Graphics
Association (NCGA) 1993 Achievement Award for the Advancement
of Graphics Standards.

Randi has participated in or organized numerous graphics tutorials at


SIGGRAPH, Eurographics, and the Game Developer's conference
since 1990. He has given tutorials on the OpenGL Shading Language
at SIGGRAPH 2002 and SIGGRAPH 2003 and made presentations
on this topic at the Game Developer's Conference in 2002 and 2003.

Randi received his B.S. degree in computer science and math from
Minnesota State University, Mankato, in 1981 and his M.S. in
computing science from the University of California, Davis, in 1983.

On a dreary winter day, you might find Randi in a desolate region of


southern Wyoming, following a road less traveled.
< Day Day Up >

< Day Day Up >


About the Contributors

Barthold Lichtenbelt received his master's degree in electrical


engineering in 1994 from the University of Twente in the Netherlands.
From 1994 to 1998, he worked on volume rendering techniques at
Hewlett-Packard Company, first at Hewlett-Packard Laboratories in
Palo Alto, California, and later at Hewlett Packard's graphics software
lab in Fort Collins, Colorado. During that time, he coauthored the
book, Introduction to Volume Rendering, and wrote several papers on
the subject as well. He was awarded four patents in the field of volume
rendering. In 1998, Barthold joined Dynamic Pictures, which 3Dlabs
subsequently acquired. There, he worked on both Direct3D and
OpenGL drivers for professional graphics accelerators. The last several
years he has been heavily involved in efforts to extend the OpenGL
API and is the author of the three ARB extensions that support the
OpenGL Shading Language. Barthold also led the implementation of
3Dlabs' first drivers that use these extensions.

John Kessenich, a Colorado native, has worked in Fort Collins as a


software architect in a variety of fields including CAD applications,
operating system kernels, and 3D graphics. He received a patent for
using Web browsers to navigate through huge collections of source
code and another for processor architecture. John studied mathematics
and its application to computer graphics, computer languages, and
compilers at Colorado State University, receiving a bachelor's degree
in applied mathematics in 1985. Later, while working at
Hewlett-Packard, he got his master's degree in applied mathematics in
1988. John has been working on OpenGL drivers now for four years
at 3Dlabs. During this time, he took the leading role in completing the
development of the OpenGL Shading Language. John authored the
specification of the OpenGL Shading Language and is currently part of
the team that is writing an optimizing compiler for it.
< Day Day Up >

< Day Day Up >


Acknowledgments

John Kessenich of 3Dlabs was the primary author of the OpenGL


Shading Language specification document and the author of Chapter 3
of this book. Some of the material from the OpenGL Shading
Language specification document was modified and included in Chapter
3, Chapter 4, and Chapter 5, and the OpenGL Shading Language
grammar written by John for the specification is included in its entirety
in Appendix A. John worked tirelessly throughout the standardization
effort discussing, resolving, and documenting language and API issues;
updating the specification through numerous revisions; and providing
insight and education to many of the other participants in the effort.
John also did some of the early shader development, including the very
first versions of the wood, bump map, and environment mapping
shaders discussed in this book.

Barthold Lichtenbelt of 3Dlabs was the primary author and document


editor of the OpenGL extension specifications that defined the OpenGL
Shading Language API. Some material from those specifications has
been adapted and included in Chapter 7. Barthold worked tirelessly
updating the specifications; discussing, resolving, and documenting
issues; and guiding the participants of the ARB-GL2 working group to
consensus. Barthold is also the coauthor of Chapter 4 of this book.

The industry-wide initiative to define a high-level shading effort for


OpenGL was ignited by a white paper, called The OpenGL 2.0
Shading Language, written by Dave Baldwin (2002) of 3Dlabs. Dave's
ideas provided the basic framework from which the OpenGL Shading
Language has evolved.

Publication of this white paper occurred almost a year before any


publication of information on competing, commercially viable, high-level
shading languages. In this respect, Dave deserves credit as the
trailblazer for a standard high-level shading language. Dave continued
to be heavily involved in the design of the language and the API during
its formative months. His original white paper also included code for a
variety of shaders. This code served as the starting point for several of
the shaders in this book: notably the brick shaders presented in Chapter
6 and Chapter 14, the traditional shaders presented in Chapter 9, the
antialiased checkerboard shader in Chapter 14, and the Mandelbrot
shader in Chapter 15. Steve Koren of 3Dlabs was responsible for
getting the aliased brick shader and the Mandelbrot shader working on
real hardware for the first time.

Bert Freudenberg of the University of Magdeburg developed the


hatching shader described in Chapter 15. As part of this effort, Bert
also explored some of the issues involved with analytic antialiasing with
programmable graphics hardware. I have incorporated some of Bert's
< Day Day Up >

< Day Day Up >


Color Plates

Plate 1. Screen shot of the RenderMonkey IDE user interface.


The shader that is procedurally generating a Julia set on the
surface of the elephant is shown in the source code window.
Color selection tools and user interface elements for
manipulating user-defined uniform variables are also shown.

Plate 2. A full-color image of Earth that is used as a texture map


for the shader discussed in Section 10.2. (Blue Marble image by
Reto Stöckli, NASA Goddard Space Flight Center)
< Day Day Up >

< Day Day Up >

Chapter 1. Review of OpenGL


Basics

This chapter presents a brief overview of the OpenGL application


programming interface (API) in order to lay the foundation for the
material in subsequent chapters. It is not intended to be an exhaustive
overview. If you are already extremely familiar with OpenGL, you can
safely skip ahead to the next chapter. If you are familiar with another
3D graphics API, this chapter should provide enough of an overview
that you can become familiar with OpenGL to the extent that you'll be
able to begin doing some shader development using the OpenGL
Shading Language.

Unless otherwise noted, descriptions of OpenGL functionality are


based on the OpenGL 1.5 specification.

< Day Day Up >

< Day Day Up >


1.1 OpenGL History

OpenGL is an industry standard, cross-platform APPLICATION


PROGRAMMING INTERFACE (API). The specification for this
API was finalized in 1992, and the first implementations appeared in
1993. It was largely compatible with a proprietary API called Iris GL
(Graphics Library) that was designed and supported by Silicon
Graphics, Inc. In order to establish an industry standard, Silicon
Graphics collaborated with various other graphics hardware companies
to create an open standard, which was dubbed "OpenGL."

OpenGL shares many of Iris GL's design characteristics. Its intention is


to provide access to graphics hardware capabilities at the lowest
possible level that still provides hardware independence. It is designed
to be the lowest-level interface for accessing graphics hardware.
OpenGL has been implemented in a variety of operating environments,
including Macs, PCs, and UNIX-based systems. It has been supported
on a variety of hardware architectures, from those that support little in
hardware other than the frame buffer itself to those that accelerate
virtually everything in hardware.

Since the release of the initial OpenGL specification (version 1.0) in


June 1992, there have been five revisions that have added new
functionality to the API. The current version of the OpenGL
specification is 1.5. The first conformant implementations of OpenGL
1.0 began appearing in 1993. Version 1.1 was finished in 1997 and
added support for two important capabilities—vertex arrays and
texture objects. The specification for OpenGL 1.2 was released in
1998 and added support for 3D textures and an optional subset of
imaging functionality. The OpenGL 1.3 specification was completed in
2001 and added support for cube map textures, compressed textures,
multitextures, and other things. OpenGL 1.4 was completed in 2002
and added automatic mipmap generation, additional blending functions,
internal texture formats for storing depth values for use in shadow
computations, support for drawing multiple vertex arrays with a single
command, more control over point rasterization, control over stencil
wrapping behavior, and various additions to texturing capabilities. The
OpenGL 1.5 specification was approved in July 2003 and published in
October 2003. It added support for vertex buffer objects, shadow
comparison functions, occlusion queries, and nonpower of two
textures. OpenGL 2.0 is expected to be finalized in early 2004, and it
will contain programmability for both vertex processing and fragment
processing as part of the core OpenGL specification. With this version
of OpenGL, applications will gain the capability to implement their own
rendering algorithms using a high-level shading language. The addition
of programmability to OpenGL represents a fundamental shift in its
design, hence the change to version number 2.0 from 1.5. However,
< Day Day Up >

< Day Day Up >


1.2 Evolving OpenGL

A great deal of functionality is available in various OpenGL


implementations in the form of extensions. OpenGL has a well-defined
extension mechanism, and hardware vendors are free to define and
implement features that expose new hardware functionality. Because of
its fundamental design as a fixed functionality state machine, the only
way to modify OpenGL has been to define extensions to it—and only
OpenGL implementors can implement extensions. There is no way for
applications to extend the functionality of OpenGL beyond what is
provided by their OpenGL provider. To date, close to 300 extensions
have been defined. Extensions that are supported by only one vendor
are identified by a short prefix unique to that vendor (e.g., SGI for
extensions developed by Silicon Graphics, Inc.). Extensions that are
supported by more than one vendor are denoted by the prefix EXT in
the extension name. Extensions that have been thoroughly reviewed by
the ARB are designated with an ARB prefix in the extension name to
indicate that they have a special status as a recommended way of
exposing a certain piece of functionality. The next step after an ARB
extension is to be added directly to the OpenGL specification.
Published specifications for OpenGL extensions are available at the
OpenGL extension registry at
http://oss.sgi.com/projects/ogl-sample/registry.

The extensions supported by a particular OpenGL implementation can


be determined by passing the symbolic constant GL_EXTENSIONS
to the glGetString function in OpenGL. The returned string contains a
list of all the extensions supported in the implementation, and some
vendors currently support close to 100 separate OpenGL extensions. It
can be a little bit daunting for an application to try and determine
whether the needed extensions are present on a variety of
implementations, and what to do if they're not. The proliferation of
extensions has been primarily a positive factor for the development of
OpenGL, but in a sense, it has become a victim of its own success. It
allows hardware vendors to expose new features easily, but it presents
application developers with a dizzying array of non-standard options.
Like any standards body, the ARB is cautious about promoting
functionality from extension status to standard OpenGL.

Since version 1.0 of OpenGL, none of the underlying programmability


of graphics hardware has been exposed. The original designers of
OpenGL, Mark Segal and Kurt Akeley, stated that, "One reason for
this decision is that, for performance reasons, graphics hardware is
usually designed to apply certain operations in a specific order;
replacing these operations with arbitrary algorithms is usually
infeasible." This statement may have been mostly true when it was
written in 1994 (there were programmable graphics architectures even
< Day Day Up >

< Day Day Up >


1.3 Execution Model

The OpenGL API is focused on drawing graphics into frame buffer


memory, and, to a lesser extent, in reading back values stored in that
frame buffer. It is somewhat unique in that its design includes support
for drawing three-dimensional geometry (such as points, lines, and
polygons, collectively referred to as PRIMITIVES) as well as for
drawing images and bitmaps.

The execution model for OpenGL can be described as client-server.


An application program (the client) issues OpenGL commands that are
interpreted and processed by an OpenGL implementation (the server).
The application program and the OpenGL implementation may be
executing on a single computer or on two different computers. Some
OpenGL state is stored in the address space of the application (client
state), but the majority of it is stored in the address space of the
OpenGL implementation (server state).

OpenGL commands are always processed in the order in which they


are received by the server, although command completion may be
delayed due to intermediate operations that cause OpenGL commands
to be buffered. Out-of-order execution of OpenGL commands is not
permitted. This means, for example, that a primitive will not be drawn
until the previous primitive has been completely drawn. This in-order
execution also applies to queries of state and frame buffer read
operations. These commands return results that are consistent with
complete execution of all previous commands.

Data binding for OpenGL occurs when commands are issued, not
when they are executed. Data passed to an OpenGL command is
interpreted when the command is issued, and copied into OpenGL
memory if needed. Subsequent changes to this data by the application
have no effect on the data that is now stored within OpenGL.
< Day Day Up >

< Day Day Up >


1.4 The Frame Buffer

OpenGL is an API for drawing graphics, and so the fundamental


purpose for OpenGL is to transform data provided by an application
into something that is visible on the display screen. This processing is
often referred to as RENDERING. Typically, this processing is
accelerated by specially designed hardware, but some or all operations
of the OpenGL pipeline can be performed by a software
implementation running on the CPU. It is transparent to the user of the
OpenGL implementation how this division among the software and
hardware is handled. The important thing is that the results of rendering
conform to the results defined by the OpenGL specification. The
hardware that is dedicated to drawing graphics and maintaining the
contents of the display screen is often called the GRAPHICS
ACCELERATOR. Graphics accelerators typically have a region of
memory that is allocated to maintaining the contents of the display.
Every visible picture element (pixel) of the display is represented by
one or more bytes of memory on the graphics accelerator. A grayscale
display might have a byte of memory to represent the gray level at each
pixel. A color display might have a byte of memory for each of red,
green, and blue in order to represent the color value for each pixel. This
so-called DISPLAY MEMORY is scanned (refreshed) a certain
number of times per second in order to maintain a flicker-free
representation on the display. Graphics accelerators also typically have
a region of memory called OFFSCREEN MEMORY that is not
displayable and is used to store things that aren't visible.

OpenGL assumes that allocation of display memory and offscreen


memory is handled by the window system. The window system decides
which portions of memory may be accessed by OpenGL and how
these portions are structured. In each environment in which OpenGL is
supported, there is a small set of function calls that tie OpenGL into that
particular environment. In the Microsoft Windows environment, this set
of routines is called WGL (pronounced "wiggle"). In the X Window
System environment, this set of routines is called GLX. In the
Macintosh environment, this set of routines is called AGL. In each
environment, this set of calls provides support for such things as
allocating and deallocating regions of graphics memory, allocating and
deallocating data structures called GRAPHICS CONTEXTS that
maintain OpenGL state, selecting the current graphics context, selecting
the region of graphics memory in which to draw, and synchronizing
commands between OpenGL and the window system.

The region of graphics memory that is modified as a result of OpenGL


rendering is called the FRAME BUFFER. In a windowing system, the
OpenGL notion of a frame buffer corresponds to a window. Facilities
are provided in window system-specific OpenGL routines for selecting
< Day Day Up >

< Day Day Up >


1.5 State

OpenGL was designed as a state machine for updating the contents of


a frame buffer. The process of turning geometric primitives, images, and
bitmaps into pixels on the screen is controlled by a fairly large number
of state settings. These state settings are orthogonal with one
another—setting one piece of state does not affect the others.
Cumulatively, the state settings define the behavior of the OpenGL
rendering pipeline and how primitives are transformed into pixels on the
display device.

OpenGL state is collected into a data structure called a graphics


context. Window system-specific functions are provided for creating
and deleting graphics contexts. Another window system-specific call is
provided to designate a graphics context and an OpenGL frame buffer
that will be used as the targets for subsequent OpenGL commands.

There are quite a few server-side state values in OpenGL that have just
two states: on or off. To turn a mode on, you must pass the appropriate
symbolic constant to the OpenGL command glEnable. To turn a mode
off, you pass the symbolic constant to glDisable. Client-side state (such
as pointers used to define vertex arrays) can be enabled by calling
glEnableClientState and disabled by calling glDisableClientState.

OpenGL maintains a server-side stack for pushing and popping any or


all of the defined state values. This stack can be manipulated by calling
glPushAttrib and glPopAttrib. Similarly, client state can be manipulated
on a second stack by calling glPushClientAttrib and glPopClientAttrib.

glGet is a generic function that can be used to query many of the


components of a graphics context. Symbolic constants are defined for
simple state items (e.g., GL_CURRENT_COLOR,
GL_LINE_WIDTH, etc.), and these values can be passed as
arguments to glGet in order to retrieve the current value of the indicated
component of a graphics context. There are variants of glGet for
returning the state value as an integer, float, double, or boolean. More
complex state values are returned by "get" functions that are specific to
that state value, for instance, glGetClipPlane, glGetLight, glGetMaterial,
and so on. Error conditions can be detected by calling the glGetError
function.
< Day Day Up >

< Day Day Up >


Exploring the Variety of Random
Documents with Different Content
Independence, and although the enemy had as yet gained no firm
foothold in the northern states except in the city of New York, it still
seemed impossible to dislodge them from that point, while
Cornwallis, flushed with victory, boasted that he would soon conquer
all the country south of the Susquehanna. For the moment it began
to look as if Lord George Germain’s policy of tiring the Americans out
might prove successful, after all. The country was still without
anything fit to be called a general government. After three years’
discussion, the Articles of Confederation, establishing a “league of
friendship” between the thirteen states, had not yet been adopted.
The Continental Congress had continued to decline in reputation and
capacity. From this state of things, rather than from any real poverty
of the country, there had ensued a general administrative paralysis,
which went on increasing even after the war was ended, until it was
brought to a close by the adoption of the Federal Constitution. It was
not because the thirteen states were lacking in material resources or
in patriotism that the conduct of the war languished as it did. The
resources were sufficient, had there been any means of concentrating
and utilizing them. The relations of the states to each other were not
defined; and while there were thirteen powers which could plan and
criticise, there was no single power which could act efficiently. Hence
the energies of the people were frittered away.
The disease was most plainly visible in those money
Evils
matters which form the basis of all human activity. The wrought by
condition of American finance in 1780 was simply the paper
horrible. The “greenback” delusion possessed people’s currency
minds even more strongly then than in the days
following our Civil War. Pelatiah Webster, the ablest political
economist in America at that time, a thinker far in advance of his
age, was almost alone in insisting upon taxation. The popular feeling
was expressed by a delegate in Congress who asked, with
unspeakable scorn, why he should vote to tax the people, when a
Philadelphia printing-press could turn out money by the bushel.[31]
But indeed, without an amendment, Congress had no power to lay
any tax, save through requisitions upon the state governments. There
seemed to be no alternative but to go on issuing this money, which
many people glorified as the “safest possible currency,” because
“nobody could take it out of the country.” As Webster truly said, the
country had suffered more from this cause than from the arms of the
enemy. “The people of the states at that time,” said he, “had been
worried and fretted, disappointed and put out of humour, by so many
tender acts, limitations of prices, and other compulsory methods to
force value into paper money, and compel the circulation of it, and by
so many vain funding schemes and declarations and promises, all
which issued from Congress, but died under the most zealous efforts
to put them into operation, that their patience was exhausted. These
irritations and disappointments had so destroyed the courage and
confidence of the people that they appeared heartless and almost
stupid when their attention was called to any new proposal.” During
the summer of 1780 this wretched “Continental” currency fell into
contempt. As Washington said, it took a wagon-load of money to buy
a wagon-load of provisions. At the end of the year 1778, the paper
dollar was worth sixteen cents in the northern states and twelve
cents in the south. Early in 1780 its value had fallen to two cents,
and before the end of the year it took ten paper dollars to make a
cent. In October, Indian corn sold wholesale in Boston for $150 a
bushel, butter was $12 a pound, tea $90, sugar $10, beef $8, coffee
$12, and a barrel of flour cost $1,575. Samuel Adams paid $2,000 for
a hat and suit of clothes. The money soon ceased to circulate, debts
could not be collected, and there was a general prostration of credit.
To say that a thing was “not worth a Continental”
“Not worth
became the strongest possible expression of contempt. a
A barber in Philadelphia papered his shop with bills, Continental”
and a dog was led up and down the streets, smeared
with tar, with this unhappy “money” sticking all over him,—a sorry
substitute for the golden-fleeced sheep of the old Norse legend. Save
for the scanty pittance of gold which came in from the French
alliance, from the little foreign commerce that was left, and from
trade with the British army itself, the country was without any
circulating medium. In making its requisitions upon the
Taxes paid
states, Congress resorted to a measure which reminds in the form
one of the barbaric ages of barter. Instead of asking of specific
for money, it requested the states to send in their supplies
“specific supplies” of beef and pork, flour and rice, salt
and hay, tobacco and rum. The finances of what was so soon to
become one of the richest of nations were thus managed on the
principle whereby the meagre salaries of country clergymen in New
England used to be eked out. It might have been called a continental
system of “donation parties.”
VIRGINIA COLONIAL CURRENCY
Under these circumstances, it became almost
Difficulty of
impossible to feed and clothe the army. The keeping the
commissaries, without either money or credit, could do army
but little; and Washington, sorely against his will, was together
obliged to levy contributions on the country
surrounding his camp. It was done as gently as possible. The county
magistrates were called on for a specified quantity of flour and meat;
the supplies brought in were duly appraised, and certificates were
given in exchange for them by the commissaries. Such certificates
were received at their nominal value in payment of taxes. But this
measure, which simply introduced a new kind of paper money, served
only to add to the general confusion. These difficulties, enhanced by
the feeling that the war was dragged out to an interminable length,
made it impossible to keep the army properly recruited. When four
months’ pay of a private soldier would not buy a single bushel of
wheat for his family, and when he could not collect even this pittance,
while most of the time he went barefoot and half-famished, it was
not strange that he should sometimes feel mutinous. The desertions
to the British lines at this time averaged more than a hundred a
month. Ternay, the French admiral, wrote to Vergennes that the fate
of North America was as yet very uncertain, and the Revolution by no
means so far advanced as people in
Europe supposed. The accumulated
evils of the time had greatly
increased the number of persons
who, to save the remnant of their
fortunes, were ready to see peace
purchased at any price. In August,
before he had heard of the disaster
at Camden, Washington wrote to
President Huntington, reminding
him that the term of service of half
the army would expire at the end
of the year. “The shadow of an
army that will remain,” said Washington, “will have every motive
except mere patriotism to abandon the service, without the hope,
which has hitherto supported them, of a change for the better. This is
almost extinguished now, and certainly will not outlive the campaign
unless it finds something more substantial to rest upon. To me it will
appear miraculous if our affairs can maintain themselves much longer
in their present train. If either the temper or the resources of the
country will not admit of an alteration, we may expect soon to be
reduced to the humiliating condition of seeing the cause of America
in America upheld by foreign arms.”
To appreciate the full force of this, we must
The French
remember that, except in South Carolina, there had alliance
been no fighting worthy of mention during the year.
The southern campaign absorbed the energies of the British to such
an extent that they did nothing whatever in the north but make an
unsuccessful attempt at invading New Jersey in June. While this fact
shows how severely the strength of England was taxed by the
coalition that had been formed against her, it shows even more
forcibly how the vitality of America had been sapped by causes that
lay deeper down than the mere presence of war. It was, indeed,
becoming painfully apparent that little was to be hoped save through
the aid of France. The alliance had thus far achieved but little that
was immediately obvious to the
American people, but it had really
been of enormous indirect benefit
to us. Both in itself and in the
European complications to which it
had led, the action of France had
very seriously crippled the efficient
military power of England. It locked
up and neutralized much British
energy that would otherwise have
been directed against the
Americans. The French government
had also furnished Congress with
large sums of money. But as for
any direct share in military
enterprises on American soil or in
American waters, France had as yet
done almost nothing. An evil star
FRANKLIN BEFORE LOUIS XVI. had presided over both the joint
expeditions for the recovery of
Newport and Savannah, and no French army had yet been landed on
our shores to cast in its lot with Washington’s brave Continentals in a
great and decisive campaign.
It had long been clear that France could in no way more
effectively further the interests which she shared with the United
States than by sending a strong force of trained soldiers to act under
Washington’s command. Nothing could be more obvious than the
inference that such a general, once provided with an adequate force,
might drive the British from New York, and thus deal a blow which
would go far toward ending the war. This had long
Lafayette’s
been Washington’s most cherished scheme. In visit to
February, 1779, Lafayette had returned to France to France
visit his family, and to urge that aid of this sort might
be granted. To chide him for his naughtiness in running away to
America in defiance of the royal mandate, the king ordered him to be
confined for a week at his father-in-law’s house in Paris. Then he
received him quite graciously at court, while the queen begged him
to “tell us good news of our dearly beloved Americans.” The good
Lafayette, to whom, in the dreadful years that were to come, this dull
king and his bright, unhappy queen were to look for compassionate
protection, now ventured to give them some sensible words of
advice. “The money that you spend on one of your old court balls,”
he said, “would go far toward sending a serviceable army to America,
and dealing England a blow where she would most feel it.” For
several months he persisted in urging Vergennes to send over at least
12,000 men, with a good general, and to put them distinctly under
Washington’s command, so that there might be no disastrous
wrangling about precedence, and no repetition of such
misunderstandings as had ruined the Newport campaign. When
Estaing arrived at Paris, early in 1780, after his defeat at Savannah,
he gave similar advice. The idea commended itself to Vergennes, and
when, in April, 1780, Lafayette returned to the United States, he was
authorized to inform Washington that France would soon send the
desired reinforcement.
On the 10th of July, Admiral Ternay, with seven ships-of-the-line
and three frigates, arrived at Newport, bringing with him a force of
6,000 men, commanded by a good general, Count Rochambeau. This
was the first instalment of an army of which the remainder was to be
sent as soon as adequate means of transport could be furnished. On
the important question of military etiquette, Lafayette’s advice had
been strictly heeded. Rochambeau was told to put himself under
Washington’s command, and to consider his troops as part of the
American army, while American officers were to take precedence of
French officers of equal rank. This French army was excellent in
discipline and equipment, and among its officers were some, such as
the Duke de Lauzun-Biron and the Marquis de Chastellux, who had
won high distinction. Rochambeau wrote to Vergennes that on his
arrival he found the people of Rhode Island sad and discouraged.
Everybody thought the country was going to the dogs. But when it
was understood that this was but the advance guard of a
considerable army and that France was this time in deadly earnest,
their spirits rose, and
Arrival of
the streets of part of the
Newport were noisy French
with hurrahs and auxiliary
brilliant with force under
Rochambea
fireworks. u
The hearts of the
people, however, were still further to
be sickened with hope deferred.
Several British ships-of-the-line,
arriving at New York, gave the
enemy such a preponderance upon
the water that Clinton resolved to
take the offensive, and started down
the Sound with 6,000 men to attack
the French at Newport. Washington
foiled this scheme by a sudden
movement against New York, which
LANDING OF FRENCH TROOPS
obliged the British commander to
fall back hastily for its defence; but the French fleet was nevertheless
blockaded in Narragansett Bay by a powerful British squadron, and
Rochambeau felt it necessary to keep his troops in Rhode Island to
aid the admiral in case of such contingencies as might arise. The
second instalment of the French army, on which their hopes had been
built, never came, for a British fleet of thirty-two sail held it
blockaded in the harbour of Brest.
The maritime supremacy of England thus continued
General
to stand in the way of any great enterprise; and for a despondenc
whole year the gallant army of Rochambeau was kept y
idle in Rhode Island, impatient and chafing under the
restraint. The splendid work it was destined to perform under
Washington’s leadership lay hidden in the darkness of the future, and
for the moment the gloom which had overspread the country was
only deepened. Three years had passed since the victory of Saratoga,
but the vast consequences which were already flowing from that
event had not yet disclosed their meaning. Looking only at the
surface of things, it might well be asked—and many did ask—whether
that great victory had really done anything more than to prolong a
struggle which was essentially vain and hopeless. Such themes
formed the burden of discourse at gentlemen’s dinner-tables and in
the back parlours of country inns, where stout yeomen reviewed the
situation of affairs through clouds of tobacco smoke; and never,
perhaps, were the Tories more jubilant or the Whigs more crestfallen
than at the close of this doleful summer.
It was just at this moment that the country was startled by the
sudden disclosure of a scheme of blackest treason. For the proper
explanation of this affair, a whole chapter will be required.
CHAPTER XIV
BENEDICT ARNOLD

To understand the proximate causes of Arnold’s


Arnold put
treason, we must start from the summer of 1778, in command
when Philadelphia was evacuated by the British. On of
that occasion, as General Arnold was incapacitated for Philadelphia
active service by the wound he had received at June 18,
1778
Saratoga, Washington placed him in command of
Philadelphia. This step brought Arnold into direct contact with
Congress, toward which he bore a fierce grudge for the slights it had
put upon him; and, moreover, the command was in itself a difficult
one. The authority vested in the commandant was not clearly
demarcated from that which belonged to the state government, so
that occasions for dispute were sure to be forthcoming. While the
British had held the city many of the inhabitants had given them
active aid and encouragement, and there was now more or less
property to be confiscated. By a resolve of Congress, all public stores
belonging to the enemy were to be appropriated for the use of the
army, and the commander-in-chief was directed to suspend the sale
or transfer of goods until the general question of ownership should
have been determined by a joint committee of Congress and of the
Executive Council of Pennsylvania. It became Arnold’s duty to carry
out this order, which not only wrought serious disturbance to
business, but made the city a hornet’s nest of bickerings and
complaints. The qualities needed for dealing successfully with such
an affair as this were very different from the qualities which had
distinguished Arnold in the field. The utmost delicacy of tact was
required, and Arnold was blunt and self-willed, and deficient in tact.
He was accordingly soon at loggerheads with the state government,
and lost, besides, much of the personal popularity with which he
started. Stories were whispered about to his discredit. It was charged
against Arnold that the extravagance of his style of living was an
offence against republican simplicity, and a scandal in view of the
distressed condition of the country; that in order to obtain the means
of meeting his heavy expenses he resorted to peculation and
extortion; and that he showed too much favour to the Tories. These
charges were doubtless not without some foundation. This era of
paper money and failing credit was an era of ostentatious
expenditure, not altogether unlike that which, in later days, preceded
the financial break-down of 1873. People in the towns lived
extravagantly, and in no other town was this more conspicuous than
in Philadelphia; while perhaps no one in Philadelphia kept a finer
stable of horses or gave more costly dinners than General Arnold. He
ran in debt, and engaged in commercial speculations to remedy the
evil; and, in view of the light afterward thrown upon his character, it
is not unlikely that he may have sometimes availed himself of his
high position to aid these speculations.
The charge of favouring the Tories may find its
Miss
explanation in a circumstance which possibly throws a Margaret
side-light upon his lavish use of money. Miss Margaret Shippen
Shippen, daughter of a gentleman of moderate Tory
sympathies, who some years afterward became chief justice of
Pennsylvania, was at that time the reigning belle of Philadelphia; and
no sooner had the new commandant arrived at his post than he was
taken captive by her piquant face and charming manner. The lady
was scarcely twenty years old, while Arnold was a widower of thirty-
five, with three sons; but his handsome face, his gallant bearing, and
his splendid career outweighed these disadvantages, and in the
autumn of 1778 he was betrothed to Miss Shippen, and thus entered
into close relations with a prominent Tory family. In the moderate
section of the Tory party, to which the Shippens belonged, there were
many people who, while strongly opposed to the Declaration of
Independence, would nevertheless have deemed it dishonourable to
lend active aid to the enemy. In 1778, such people Views of the
thought that Congress did wrong in making an alliance moderate
with France instead of accepting the liberal proposals Tories
of Lord North. The Declaration of Independence, they
argued, would never have been made had it been supposed that the
constitutional liberties of the American people could any otherwise be
securely protected. Even Samuel Adams admitted this. In the war
which had been undertaken in defence of these liberties, the affair of
Saratoga had driven the British government to pledge itself to
concede them once and forever. Then why not be magnanimous in
the hour of triumph? Why not consider the victory of Saratoga as
final, instead of subjecting the resources of the country to a terrible
strain in the doubtful attempt to secure a result which, only three
years before, even Washington himself had regarded as undesirable?
Was it not unwise and unpatriotic to reject the overtures of our
kinsmen, and cast in our lot with that Catholic and despotic power
which had ever been our deadliest foe?
OLD LONDON COFFEE HOUSE, PHILADELPHIA
Such were the arguments to which Arnold must
Arnold’s
have listened again and again, during the summer and drift toward
autumn of 1778. How far he may have been Toryism
predisposed toward such views it would be impossible
to say. He always declared himself disgusted with the French alliance,
[32] and in this there is nothing improbable. But that, under the
circumstances, he should gradually have drifted into the Tory position
was, in a man of his temperament, almost inevitable. His nature was
warm, impulsive, and easily impressible, while he was deficient in
breadth of intelligence in rigorous moral conviction; and his opinions
on public matters took their hue largely from his personal feelings. It
was not surprising that such a man, in giving splendid
entertainments, should invite to them the Tory friends of the lady
whose favour he was courting. His course excited the wrath of the
Whigs. General Reed wrote indignantly to General Greene that Arnold
had actually given a party at which “not only common Tory ladies, but
the wives and daughters of persons proscribed by the state, and now
with the enemy at New York,” were present in considerable numbers.
When twitted with such things, Arnold used to reply that it was the
part of a true soldier to fight his enemies in the open field, but not to
proscribe or persecute their wives and daughters in private life. But
such an explanation naturally satisfied no one. His quarrels with the
Executive Council, sharpened by such incidents as these, grew more
and more violent, until when, in December, his most active enemy,
Joseph Reed, became president of the Council, he suddenly made up
his mind to resign his post and leave the army altogether. He would
quit the turmoil of public affairs, obtain a grant of land
He makes
in western New York, settle it with his old soldiers, with up his mind
whom he had always been a favourite, and lead to leave the
henceforth a life of Arcadian simplicity. In this mood he army
wrote to Schuyler, in words which to-day seem strange
and sad, that his ambition was not so much to “shine in history” as to
be “a good citizen;” and about the 1st of January, 1779, he set out
for Albany to consult with the New York legislature about the desired
land.
Arnold’s scheme was approved by John Jay, who was then
president of the Continental Congress, as well as by several other
men of influence, and in all likelihood it would have succeeded; but
as he stopped for a day at Morristown, to visit Washington, a letter
overtook him, with the information that as soon as his back had been
turned upon Philadelphia he had been publicly attacked by President
Reed and the Council. Formal charges were brought
Charges are
against him: 1, of having improperly granted a pass for brought
a ship to come into port; 2, of having once used some against him
public wagons for the transportation of private Jan., 1779
property; 3, of having usurped the privilege of the
Council in allowing people to enter the enemy’s lines; 4, of having
illegally bought up a lawsuit over a prize vessel; 5, of having
“imposed menial offices upon the sons of freemen” serving in the
militia; and 6, of having made purchases for his private benefit at the
time when, by his own order, all shops were shut. These charges
were promulgated in a most extraordinary fashion. Not only were
they laid before Congress, but copies of them were sent to the
governors of all the states, accompanied by a circular letter from
President Reed requesting the governors to communicate them to
their respective legislatures. Arnold was naturally enraged at such an
elaborate attempt to prepossess the public mind against him, but his
first concern was for the possible effect it might have upon Miss
Shippen. He instantly returned to Philadelphia, and demanded an
investigation. He had obtained Washington’s
He is
permission to resign his command, but deferred acting acquitted by
upon it till the inquiry should have ended. The charges a committee
were investigated by a committee of Congress, and of Congress
about the middle of March this committee brought in a in March
report stating that all the accusations were groundless,
save the two which related to the use of the wagons and the
irregular granting of a pass; and since in these instances there was
no evidence of wrong intent, the committee recommended an
unqualified verdict of acquittal. Arnold thereupon, considering himself
vindicated, resigned his command. But Reed now represented to
Congress that further testimony was forthcoming, and urged that the
case should be reconsidered. Accordingly, instead of acting upon the
report of its committee, Congress referred the matter anew to a joint
committee of Congress and the Assembly and Council of
Pennsylvania. This joint committee shirked the matter
The case is
by recommending that the case be referred to a court- referred to a
martial, and this recommendation was adopted by court-
Congress on the 3d of April. The vials of Arnold’s wrath martial,
were now full to overflowing; but he had no cause to April 3,
1779
complain of Miss Shippen, for their marriage took place
in less than a week after this action of Congress. Washington, who
sympathized with Arnold’s impatience, appointed the court-martial for
the 1st of May, but the Council of Pennsylvania begged for more time
to collect evidence. And thus, in one way and another, the summer
and autumn were frittered away, so that the trial did not begin until
the 19th of December. All this time Arnold kept clamouring for a
speedy trial, and Washington did his best to soothe him while paying
due heed to the representations of the Council.
In the excitement of this fierce controversy the
First
Arcadian project seems to have been forgotten. Up to corresponde
this point Arnold’s anger had been chiefly directed nce with
toward the authorities of Pennsylvania; but when Clinton
Congress refused to act upon the report of its
committee exonerating him from blame, he became incensed against
the whole party which, as he said, had so ill requited his services. It
is supposed to have been about that time, in April, 1779, that he
wrote a letter to Sir Henry Clinton, in disguised handwriting and
under the signature of “Gustavus,” describing himself as an American
officer of high rank, who, through disgust at the French alliance and
other recent proceedings of Congress, might perhaps be persuaded
to go over to the British, provided he could be indemnified for any
losses he might incur by so doing. The beginning of this
correspondence—if this was really the time—coincided curiously with
the date of Arnold’s marriage, but it is in the highest degree probable
that down to the final catastrophe Mrs. Arnold knew nothing
whatever of what was going on.[33] The correspondence was kept up
at intervals, Sir Henry’s replies being written by Major John André, his
adjutant-general, over the signature of “John Anderson.” Nothing
seems to have been thought of at first beyond the personal desertion
of Arnold to the enemy; the betrayal of a fortress was a later
development of infamy. For the present, too, we may suppose that
Arnold was merely playing with fire, while he awaited the result of
the court-martial.
The summer was not a happy one. His debts went
The court-
on increasing, while his accounts with Congress martial
remained unsettled, and he found it impossible to acquits
collect large sums that were due him. At last the court- Arnold of all
martial met, and sat for five weeks. On the 26th of serious
January, 1780, the verdict was rendered, and in charges, but
directs
substance it agreed exactly with that of the committee Washington
of Congress ten months before. Arnold was fully to
acquitted of all the charges which alleged reprimand
dishonourable dealings. The pass which he had him for two
granted was irregular, and public wagons, which were very trivial
ones, Jan.
standing idle, had once been used to remove private 26, 1780
property that was in imminent danger from the enemy.
The court exonerated Arnold of all intentional wrong, even in these
venial matters, which it characterized as “imprudent;” but, as a sort
of lame concession to the Council of Pennsylvania, it directed that he
should receive a public reprimand from the commander-in-chief for
his imprudence in the use of wagons, and for hurriedly giving a pass
in which all due forms were not attended to. The decision of the
court-martial was promptly confirmed by Congress, and Washington
had no alternative but to issue the reprimand, which he couched in
words as delicate and gracious as possible.[34]
It was too late, however. The damage was done.
Arnold
Arnold had long felt persecuted and insulted. He had thirsts for
already dallied with temptation, and the poison was revenge
now working in his veins. His sense of public duty was upon
utterly distorted by the keener sense of his private Congress
injuries. We may imagine him brooding over some
memorable incidents in the careers of Monk, of the great Montrose
and the greater Marlborough, until he persuaded himself that to
change sides in a civil war was not so heinous a crime after all.
Especially the example of Monk, which had already led Charles Lee to
disgrace, seems to have riveted the attention of Arnold, although only
the most shallow scrutiny could discover any resemblance between
what the great English general had done and what Arnold purposed
to do. There was not a more scrupulously honourable soldier in his
day than George Monk. Arnold’s thoughts may have run somewhat as
follows. He would not become an ordinary deserter, a villain on a
small scale. He would not sell himself cheaply to the devil; but he
would play as signal a part in his new career as he had played in the
old one. He would overwhelm this blundering Congress, and
triumphantly carry the country back to its old allegiance. To play such
a part, however, would require the blackest treachery. Fancy George
Monk, “honest old George,” asking for the command of a fortress in
order to betray it to the enemy!
BENEDICT ARNOLD’S HOUSE AT PHILADELPHIA
When once Arnold had committed himself to this evil course, his
story becomes a sickening one, lacking no element of horror, whether
in its foul beginnings or in its wretched end. To play his new part
properly, he must obtain an important command, and the place which
obviously suggested itself was West Point.
Since Burgoyne’s overthrow, Washington had built a
Significance
chain of strong fortresses there, for he did not intend of West
that the possession of the Hudson river should ever Point
again be put in question, so far as fortifications could
go. Could this cardinal position be delivered up to Clinton, the prize
would be worth tenfold the recent triumphs at Charleston and
Camden. It would be giving the British what Burgoyne had tried in
vain to get; and now it was the hero of Saratoga who plotted to undo
his own good work at the dictates of perverted ambition and
unhallowed revenge.
To get possession of this stronghold, it was Arnold put
necessary to take advantage of the confidence with in command
which his great commander had always honoured him. of West
From Washington, in July, 1780, Arnold sought the Point, July,
command of West Point, alleging that his wounded leg 1780
still kept him unfit for service in the field; and
Washington immediately put him in charge of this all-important post,
thus giving him the strongest proof of unabated confidence and
esteem which it was in his power to give; and among all the dark
shades in Arnold’s treason, perhaps none seems darker than this
personal treachery toward the man who had always trusted and
defended him. What must the traitor’s feelings have been when he
read the affectionate letters which Schuyler wrote him at this very
time? In better days he had shown much generosity of nature. Can it
be that this is the same man who on the field of Saratoga saved the
life of the poor soldier who in honest fight had shot him and broken
his leg? Such are the strange contrasts that we sometimes see in
characters that are governed by impulse, and not by principle. Their
virtue may be real enough while it lasts, but it does not weather the
storm; and when once wrecked, the very same emotional nature by
which alone it was supported often prompts to deeds of incredible
wickedness.

JOSHUA SMITH’S HOUSE, ON TREASON HILL


After taking command of West Point, the correspondence with
André, carefully couched in such terms as to make it seem to refer to
some commercial enterprise, was briskly kept up; and hints were let
drop which convinced Sir Henry Clinton that the writer was Arnold,
and the betrayal of the highland stronghold his purpose. Troops were
accordingly embarked on the Hudson, and the flotilla was put in
command of Admiral Rodney, who had looked in at New York on his
way to the West Indies. To disguise the purpose of the embarkation,
a rumour was industriously circulated that a force was to be sent
southward to the Chesapeake. To arrange some
Secret
important details of the affair it seemed desirable that interview
the two correspondents “Gustavus” and “John between
Anderson,” should meet, and talk over matters which Arnold and
could not safely be committed to paper. On the 18th of André, Sept.
22
September, Washington, accompanied by Lafayette and
Hamilton, set out for Hartford, for an interview with Rochambeau;
and advantage was taken of his absence to arrange a meeting
between the plotters. On the 20th André was taken up the river on
the Vulture, sloop-of-war, and on the night of the 21st Arnold sent
out a boat which brought him ashore about four miles below Stony
Point. There in a thicket of fir-trees, under the veil of blackest
midnight, the scheme was matured; but as gray dawn came on
before all the details had been arranged, the boatmen became
alarmed, and refused to take André back to the ship, and he was
accordingly persuaded, though against his will, to accompany Arnold
within the American lines. The two conspirators walked up the bank a
couple of miles to the house of one Joshua Smith, a man of doubtful
allegiance, who does not seem to have understood the nature and
extent of the plot, or to have known who Arnold’s visitor was. It was
thought that they might spend the day discussing the enterprise, and
when it should have grown dark André could be rowed back to the
Vulture.
LINKS OF WEST POINT CHAIN

SCENE OF ARNOLD’S TREASON, 1780


But now a quite unforeseen accident occurred.
The plot for
Colonel Livingston, commanding the works on the surrenderin
opposite side of the river, was provoked by the sight of g West Point
a British ship standing so near; and he opened such a
lively fire upon the Vulture that she was obliged to withdraw from the
scene. As the conspirators were waiting in Smith’s house for
breakfast to be served, they heard the booming of the guns, and
André, rushing to the window, beheld with dismay the ship on whose
presence so much depended dropping out of sight down the stream.
On second thoughts, however, it was clear that she would not go far,
as her commander had orders not to return to New York without
André, and it was still thought that he might regain her. After
breakfast he went to an upper chamber with Arnold, and several
hours were spent in perfecting their plans. Immediately upon André’s
return to New York, the force under Clinton and Rodney was to
ascend the river. To obstruct the approach of a hostile flotilla, a
massive chain lay stretched across the river, guarded by water
batteries. Under pretence of repairs, one link was to be taken out for
a few days, and supplied by a rope which a slight blow would tear
away. The approach of the British was to be announced by a
concerted system of signals, and the American forces were to be so
distributed that they could be surrounded and captured in detail, until
at the proper moment Arnold, taking advantage of the apparent
defeat, was to surrender the works, with all the troops—3,000 in
number—under his command. It was not unreasonably supposed that
such a catastrophe, coming on the heels of Charleston and Camden
and general bankruptcy, would put a stop to the war and lead to
negotiations, in which Arnold, in view of such decisive service, might
hope to play a leading part.
When André set out on this perilous undertaking,
André takes
Sir Henry Clinton specially warned him not to adopt compromisi
any disguise or to carry any papers which might ng
compromise his safety. But André disregarded the documents
advice, and took from Arnold six papers, all but one of
them in the traitor’s own handwriting, containing descriptions of the
fortresses and information as to the disposition of the troops. Much
risk might have been avoided by putting this information into cipher,
or into a memorandum which would have been meaningless save to
the parties concerned. But André may perhaps have doubted Arnold’s
fidelity, and feared lest under a false pretence of treason he might be
drawing the British away into a snare. The documents which he took,
being in Arnold’s handwriting and unmistakable in their purport, were
such as to put him in Clinton’s power, and compel him, for the sake of
his own safety, to perform his part of the contract. André intended,
before getting into the boat, to tie up these papers in a bundle
loaded with a stone, to be dropped into the water in case of a sudden
challenge; but in the mean time he put them where they could not so
easily be got rid of, between his stockings and the soles of his feet.
Arnold furnished the requisite passes for Smith and André to go
either by boat or by land, and, having thus apparently provided for all
contingencies, took leave before noon, and returned in his barge to
his headquarters, ten miles up the stream. As evening approached,
Smith, who seems to have been a man of unsteady nerves, refused
to take André out to the Vulture. He had been alarmed and is
by the firing in the morning, and feared there would be reluctantly
more risk in trying to reach the ship than in travelling persuaded
down to the British lines by land, and he promised to to return to
ride all night with André if he would go that way. The New York by
young officer reluctantly consented, and partially land, 22
Sept.

disguised himself in some of Smith’s clothes. At


sundown the two crossed the river at King’s Ferry, and pursued their
journey on horseback toward White Plains.
FACSIMILE OF ARNOLD’S PASS TO ANDRÉ
The roads east of the Hudson, between the British
The roads
and the American lines, were at this time infested by infested by
robbers, who committed their depredations under robbers
pretence of keeping up a partisan warfare. There were
two sets of these scapegraces,—the “Cowboys,” or cattle-thieves, and
the “Skinners,” who took everything they could find. These epithets,
however, referred to the political complexion they chose to assume,
rather than to any difference in their evil practices. The Skinners
professed to be Whigs, and the Cowboys called themselves Tories;
but in point of fact the two parties were alike political enemies to any
farmer or wayfarer whose unprotected situation offered a prospect of
booty; and though murder was not often committed, nobody’s
property was safe. It was a striking instance of the demoralization
wrought in a highly civilized part of the country through its having so
long continued to be the actual seat of war. Rumours that the
Cowboys were out in force made Smith afraid to continue the journey
by night, and the impatient André was thus obliged to stop at a
farmhouse with his timid companion. Rising before dawn, they kept
on until they reached the Croton river, which marked the upper
boundary of the neutral ground between the British and the American
lines. Smith’s instructions had been, in case of adopting the land
route, not to leave his charge before reaching White Plains; but he
now became uneasy to return, and André, who was beginning to
consider himself out of danger, was perhaps not unwilling to part with
a comrade who annoyed him by his loquacious and inquisitive
disposition. So Smith made his way back to headquarters, and
informed Arnold that he had escorted “Mr. Anderson” within a few
miles of the British lines, which he must doubtless by this time have
reached in safety.
FACSIMILE OF ONE OF THE PAPERS FOUND IN ANDRÉ’S
STOCKINGS
Meanwhile, André, left to himself, struck into the
Arrest of
road which led through Tarrytown, expecting to meet André, Sept.
no worse enemies than Cowboys, who would either 23
respect a British officer, or, if bent on plunder, might be
satisfied by his money and watch. But it happened that morning that
a party of seven young men had come out to intercept some
Cowboys who were expected up the road; and about nine o’clock, as
André was approaching the creek above Tarrytown, a short distance
from the far-famed Sleepy Hollow, he was suddenly confronted by
three of this party, who sprang from the bushes and, with levelled
muskets, ordered him to halt. These men had let several persons,
with whose faces they were familiar, pass unquestioned; and if Smith,
who was known to almost every one in that neighbourhood, had
been with André, they too would doubtless have been allowed to
pass. André was stopped because he was a stranger. One of these
men happened to have on the coat of a Hessian soldier. Held by the
belief that they must be Cowboys, or members of what was
sometimes euphemistically termed the “lower party,” André expressed
a hope that such was the case; and on being assured that it was so,
his caution deserted him, and, with that sudden sense of relief which
is apt to come after unwonted and prolonged constraint, he avowed
himself a British officer, travelling on business of great importance. To
his dismay, he now learned his mistake. John Paulding, the man in
the Hessian coat, informed him that they were Americans, and
ordered him to dismount. When he now showed them Arnold’s pass
they disregarded it, and insisted upon searching him, until presently
the six papers were discovered where he had hidden them. “By God,
he is a spy!” exclaimed Paulding, as he looked over the papers.
Threats and promises were of no avail. The young men, who were
not to be bought or cajoled, took their prisoner twelve miles up the
river, and delivered him into the hands of Colonel John Jameson, a
Virginian officer, who commanded a cavalry outpost at North Castle.
When Jameson looked over the papers, they seemed to him very
extraordinary documents to be travelling toward New York in the
stockings of a stranger who could give no satisfactory account of
himself. But so far from his suspecting Arnold of any
Colonel
complicity in the matter, he could think of nothing Jameson’s
better than to send the prisoner straightway to Arnold perplexity
himself, together with a brief letter in which he related
what had happened. To the honest Jameson it seemed that this must
be some foul ruse of the enemy, some device for stirring up suspicion
in the camp,—something, at any rate, which could not too quickly be
brought to his general’s notice. But the documents themselves he
prudently sent by an express-rider to Washington, accompanying
them with a similar letter of explanation. André, in charge of a
military guard, had already proceeded some distance toward West
Point when Jameson’s second in command, Major Benjamin
Tallmadge, came in from some errand on which he had been
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like