Computer graphics programming in OpenGL with C 2nd Edition V Scott Gordon all chapter instant download
Computer graphics programming in OpenGL with C 2nd Edition V Scott Gordon all chapter instant download
com
https://ebookmeta.com/product/computer-graphics-programming-
in-opengl-with-c-2nd-edition-v-scott-gordon/
OR CLICK HERE
DOWLOAD NOW
https://ebookmeta.com/product/computer-graphics-programming-in-opengl-
with-java-3rd-edition-v-scott-gordon/
ebookmeta.com
https://ebookmeta.com/product/opengl-foundations-taking-your-first-
steps-in-graphics-programming-kameron-hussain/
ebookmeta.com
https://ebookmeta.com/product/introduction-to-computer-graphics-using-
opengl-and-java-3rd-edition-karsten-lehn/
ebookmeta.com
https://ebookmeta.com/product/the-code-breaker-jennifer-doudna-gene-
editing-and-the-future-of-the-human-race-1st-edition-walter-isaacson/
ebookmeta.com
Metaheuristics for Finding Multiple Solutions 1st Edition
Mike Preuss Michael G Epitropakis Xiaodong Li Jonathan E
Fieldsend
https://ebookmeta.com/product/metaheuristics-for-finding-multiple-
solutions-1st-edition-mike-preuss-michael-g-epitropakis-xiaodong-li-
jonathan-e-fieldsend/
ebookmeta.com
Pro JSF and HTML5 2nd Edition Hazem Saleh Allan Lykke
Christensen Zubin Wadia
https://ebookmeta.com/product/pro-jsf-and-html5-2nd-edition-hazem-
saleh-allan-lykke-christensen-zubin-wadia/
ebookmeta.com
https://ebookmeta.com/product/marxist-politics-1st-edition-md-ayub-
mallick/
ebookmeta.com
https://ebookmeta.com/product/nistisima-the-secret-to-delicious-vegan-
cooking-from-the-mediterranean-and-beyond-1st-edition-georgina-hayden/
ebookmeta.com
The Bloomsbury Handbook to Sylvia Plath 1st Edition Anita
Helle
https://ebookmeta.com/product/the-bloomsbury-handbook-to-sylvia-
plath-1st-edition-anita-helle/
ebookmeta.com
Computer Graphics
Programming in OpenGL
with C++
Second Edition
By purchasing or using this book and its companion files (the “Work”), you
agree that this license grants permission to use the contents contained herein,
including the companion files, but does not give you the right of ownership to any
of the textual content in the book / files or ownership to any of the information
or products contained in it. This license does not permit uploading of the Work
onto the Internet or on a network (of any kind) without the written consent of the
Publisher. Duplication or dissemination of any text, code, simulations, images,
etc. contained herein is limited to and subject to licensing terms for the respective
products, and permission must be obtained from the Publisher or the owner of the
content, etc., in order to reproduce or network any portion of the textual material
(in any media) that is contained in the Work.
The sole remedy in the event of a claim of any kind is expressly limited to
replacement of the book and/or companion files, and only at the discretion of the
Publisher. The use of “implied warranty” and certain “exclusions” vary from state
to state and might not apply to the purchaser of this product.
The companion files are available for downloading by writing to the publisher at
info@merclearning.com.
This publication, portions of it, or any accompanying software may not be reproduced in any way,
stored in a retrieval system of any type, or transmitted by any means, media, electronic display or
mechanical display, including, but not limited to, photocopy, recording, Internet postings, or scan
ning, without prior permission in writing from the publisher.
The publisher recognizes and respects all marks used by companies, manufacturers, and
developers as a means to distinguish their products. All brand names and product names mentioned
in this book are trademarks or service marks of their respective companies. Any omission or misuse
(of any kind) of service marks or trademarks, etc. is not an attempt to infringe on the property
of others.
Our titles are available for adoption, license, or bulk purchase by institutions, corporations, etc.
For additional information, please contact the Customer Service Dept. at 800-232-0223 (toll free).
Digital versions of our titles are available at: www.academiccourseware.com and other e-vendors. All
companion files are available by writing to the publisher at info@merclearning.com.
The sole obligation of Mercury Learning and Information to the purchaser is to replace
the book and/or disc, based on defective materials or faulty workmanship, but not based on the
operation or functionality of the product.
2.1.5 Rasterization 19
2.1.6 Fragment Shader 20
2.1.7 Pixel Operations 21
2.2 Detecting OpenGL and GLSL Errors 22
2.3 Reading GLSL Source Code from Files 26
2.4 Building Objects from Vertices 27
2.5 Animating a Scene 28
2.6 Organizing the C++ Code Files 31
Index 503
One of the things that we hope is unique about this book is that we have strived to
make it accessible to someone new to 3D graphics programming. While there is by no
means a lack of information available on the topic—quite the contrary—many students
are initially overwhelmed. This text is our attempt to write the book we wish we had had
when we were starting out, with step-by-step explanations of the basics, progressing in
an organized manner up through advanced topics. We considered titling the book “shader
programming made easy”; however, we don’t think that there really is any way of making
shader programming “easy.” We hope that we have come close.
This book teaches OpenGL programming in C++. There are several advantages to
learning graphics programming in C++:
• OpenGL’s native language is C, so a C++ program can make direct OpenGL
function calls.
• OpenGL applications written in C++ typically exhibit very high performance.
• C++ offers modern programming constructs (classes, polymorphism, etc.) not
available in C.
• C++ is a popular language choice for using OpenGL, and a large number of
instructional resources for OpenGL are available in C++.
It is worth mentioning that there do exist other language bindings for OpenGL.
Popular alternatives exist for Java, C#, Python, and many others. This textbook focuses
only on C++.
Another thing that makes this book unique is that it has a “sister” textbook: Computer
Graphics Programming in OpenGL with Java 2/E. The two books are organized in lock-
step, with the same chapter and section numbers and topics, figures, exercises, and theo-
retical descriptions. Wherever possible, the code is organized similarly. Of course, the
use of C++ versus Java leads to considerable programming differences (although all of
the shader code is identical). Still, we believe that we have provided virtually identical
learning paths, even allowing a student to choose either option within a single classroom.
Yet another variant of OpenGL is called “WebGL.” Based on OpenGL ES, WebGL is
designed to support the use of OpenGL in web browsers. WebGL allows an application to
use JavaScript1 to invoke OpenGL ES operations, which makes it easy to embed OpenGL
graphics into standard HTML (web) documents. Most modern web browsers support
WebGL, including Apple Safari, Google Chrome, Microsoft Edge, Microsoft Internet
Explorer, Mozilla Firefox, and Opera. Since web programming is outside the scope of this
book, we will not cover any WebGL specifics. Note however that because WebGL is based
on OpenGL ES, which in turn is based on standard OpenGL, much of what is covered in
this book can be transferred directly to learning about these OpenGL variants.
The very topic of 3D graphics lends itself to impressive, even beautiful images.
Indeed, many popular textbooks on the topic are filled with breathtaking scenes, and it
is enticing to leaf through their galleries. While we acknowledge the motivational utility
of such examples, our aim is to teach, not to impress. The images in this book are simply
1
JavaScript is a scripting language that can be used to embed code in webpages. It has strong
similarities to Java, but also many important differences.
the outputs of the example programs, and since this is an introductory text, the resulting
scenes are unlikely to impress an expert. However, the techniques presented do constitute
the foundational elements for producing today’s stunning 3D effects.
Ray tracing in particular has become “hot” recently, so we are especially excited that
it is now included in our book. It is also a huge topic, so even though our coverage is just
a basic introduction, Chapter 16 is now the longest chapter in the book. Chapter 16 also
includes an introduction to compute shaders, which were introduced in OpenGL 4.3, and
an introduction to additive and subtractive color blending, which expands on a topic that
was introduced in Section 14.2.
For years, our own students have repeatedly expressed an interest in simulating
water. However, water takes so many forms that writing an introductory section on the
topic is challenging. Ultimately, we decided to present water in a way that would comple-
ment related topics in the book such as terrain, sky, etc., and so in Chapter 15 we focus on
utilizing our noise maps from Chapter 14 to generate water surfaces such as are seen in
lakes and oceans.
As a result of these additions, this 2nd edition is larger than the previous edition.
Besides the new material, there are important revisions throughout the book. For
example, we fixed bugs in our Torus class in Chapter 6 and made significant improve-
ments to our noise map functions in Chapter 14. We expanded our Utils.cpp utility class
to handle the loading of compute shaders. We also helped identify a bug in SOIL2 (now
fixed) that affected Macintosh users attempting to load cubemaps.
There are dozens of small changes in every chapter that the reader might not even
notice: fixing typos, cleaning up code inconsistencies, updating the installation instruc-
tions, making slight wording changes, sprucing up figures, updating references, etc.
Completely eliminating typos is virtually impossible in a book that covers an ever-
changing technology-rich topic, but we really have tried hard.
Intended Audience
This book is targeted at students of computer science. This could mean undergraduates
pursuing a BS degree, but it could also mean anyone who studies computer science. As
such, we are assuming that the reader has at least a solid background in object-oriented
programming, at the level of someone who is, say, a computer science major at the junior
or senior level.
There are also some specific things that we use in this book that we don’t cover,
because we assume the reader already has sufficient background. In particular, these are:
• C++ and its most commonly used libraries, such as the Standard Template
Library;
• familiarity with using an Integrated Development Environment (IDE), such as
Visual Studio;
• basic data structures and algorithms, such as linked lists, stacks, and queues, etc.
• recursion;
• event-driven programming concepts;
• basic matrix algebra and trigonometry; and
• awareness of color models, such as RGB, RGBA, etc.
It is hoped that the potential audience for this new book is further bolstered by the
existence of its “sister” textbook, Computer Graphics Programming in OpenGL with
Java. In particular, we envision a learning environment where students are free to utilize
either C++ or Java in the same classroom, selecting one or the other book. The two texts
cover the material sufficiently in lockstep that we have been able to conduct a graphics
programming course successfully in this manner.