[index]
Anton's OpenGL 4 Tutorials - Book Information
I try to collect all known typos and errors in the book and any known code
problems here. I regularly update the online edition of the e-book as well as
the source code.
Errata and Known Typos
I wait until a list of outstanding issues here gets reasonably large and then
update the on-line volume. You may get a notification that you can update the
e-book.
- Reminder to call glUseProgram() before any calls to glUniform... in Matrices and Vectors
chapter.
- "vertex attribute object" → "vertex array object" in several places.
- optimise early section reworded in chap2
- intialising → initialising - chap2 (3x)
- movment → movement - chap2 (3x)
- "log" variable names to "shader_log" and "program_log"
- Cube maps section "Sky Box" wording changed.
- Cube maps - "is called times" → is called 6 times
- Several small typos "a a" in Quaternions
Source Code
All of the demo code can be found online at
https://github.com/capnramses/antons_opengl_tutorials_book.
31 August 2015
The latest version of the GLFW links against some new external libraries. If
you are linking against the static build you'll need to update your Makefiles
accordingly.
Dynamic libraries on 64-bit GNU/Linux with C99:
DYN_LIBS = -lGL -lX11 -lXxf86vm -lXrandr -lpthread -lXi -lXinerama -lXcursor \
-ldl -lrt -lm
Frameworks on OS X:
FRAMEWORKS = -framework Cocoa -framework OpenGL -framework IOKit \
-framework CoreVideo
7 August 2015
I got a Mac Mini and personally tested all the demos on OS X Yosemite.
I updated the Makefiles to make Apple builds easier - you no longer have to
uncomment the version hint section, it's defined in the Makefile.
I found and
fixed one or two bugs that only the Apple implementation picked up - the
Kernel demo used an undefined shader variable, for some reason shader
validation requires that a valid VAO is bound (!!), one or two shaders had
keywords in the wrong order, and the texture shadows demo had some shader
uniform location variables mixed up (that accidentally had correct values on
other implementations!). The geometry shader demo was using a deprecated
vertex count variable instead of gl_in.length().
Note that one or two demos are designed for GLSL 420, which isn't supported by
Apple - I added some commented-out code blocks to make it easy to see how to
retrograde these so that they run on OS X with 410.
28 January 2015
Added explicit glReadBuffers (GL_NONE) to 38_texture_shadows to
protect against invalid framebuffer error on Apple. Note that this isn't
actually valid in GL4 (seems to be from ES2/3).
26 November 2014
Updated all the shaders' version tags to #version 410 to properly
support layout (location=x) keywords for attributes. The Hello
Triangle demo is also updated to run OpenGL 4.1 instead of 4.0. I have not
tested the Visual Studio demos yet.
I also noticed that the texture coordinates for 15_phong_textures were
wrong, so generated a new mesh, and a new ambient occlusion map. I left the
.blend file in that folder.
26 August 2014
Updated the code for Extension Checking and the Debug Callback to use switches
to get error strings rather than arrays, which were slightly wrong (thanks
Kenneth!).
31 July 2014
I moved the demo source code to GitHub https://github.com/capnramses/antons_opengl_tutorials_book.
Hopefully this will eliminate problems due to unreliable downloads from my web
server.
I have a few updates to make and small issues to fix, so expect this to change a
bit over the next week.
4 July 2014
Found some shader calls to deprecated texture2D() and replaced with
texture(). Also removed texture binding keywords from the
#version 400 shaders (required 420). Left a few shaders at 420 for
comparison - note at top of shader files in question.
3 July 2014
My hosted server is occasionally aborting downloads too early - it might
take a few attempts to get the files. Sorry about that - I'll move the code
over to a reliable host after the holidays!
Uploaded quite a few Makefiles for Apple OSX. I haven't been able to
test all of the demos on Apple yet (I don't have a Macbook myself), but most of
them should work! There is no Apple build of the Freetype library. I'll get
there eventually!
Found and fixed a bug in 02_shaders - thanks Andrea!
2 July 2014
The original code download was getting download errors (finishing too early)
from my web host, Godaddy. Their support people said that it was too large
(107MB), and getting time-outs, which I think is probably rubbish. I got rid of
the protected download settings, which I suspect Godaddy was mis-managing. In
any case, to get around this for now I have made the download smaller,
and moved the Blender mesh files and Visual Studio project files into separate
downloads:
After the summer holidays I'll look at moving all the code to a more stable
host (potentially on Github or a professional source-code host). I'll also be
revising my main OpenGL website so that the book is the main source of content
for tutorials, and the site has articles for new and interesting things that
I work on - I have Compute Shaders and some low-level optimisation techniques
on my "after summer" list, powered by all the coffees that get :D. By all means
send requests.
30 June 2014
I updated the source code download and revised and tested all
of the project files. You should now find:
- Linux Makefiles for 64-bit GCC for all projects
- Windows Makefiles for 32-bit MinGW GCC for all projects
- 32-bit Visual Studio 2012 Solution for all projects
- Linux Makefiles for 32-bit GCC for some projects
I intend to add a set of OS X Makefiles, but I need to borrow an Apple machine
first to make sure that they work properly. For now, this is the general format
that you should expect for an OS X Makefile. Note the use of Apple frameworks
for the OS libraries, as well as for OpenGL itself:
BIN = hellot
CC = gcc
FLAGS = -Wall -pedantic -mmacosx-version-min=10.5 -arch x86_64 \
-fmessage-length=78 -UGLFW_CDECL -fprofile-arcs -ftest-coverage
INC = -I ../common/include -I/sw/include -I/usr/local/include
LIB_PATH = ../common/osx_64/
LOC_LIB = $(LIB_PATH)libGLEW.a $(LIB_PATH)libglfw3.a
FRAMEWORKS = -framework Cocoa -framework OpenGL -framework IOKit
SRC = main.c
all:
@echo ~~~~~~~~~~~~~~~~~~~~~~Building OS/X 64-bit~~~~~~~~~~~~~~~~~~~~~~~~~
${CC} ${FLAGS} ${FRAMEWORKS} -o ${BIN} ${SRC} ${INC} ${LOC_LIB}
Fixes and Updates Made to e-book
4 May 2016 (Edition 6 → Edition 7)
-
typo - Hello Triangle - Drawing - "to update things non-graphical events" → "to update non-graphical events"
-
errata - Extended Init - Frame Rate Counter - "70Hz" is no longer true - all
modern flat-panel displays use 60Hz. the next paragraph needs a clarification,
and I should really suggest adding millisecond timers and mention GPU timer
queries.
-
errata/typos - Extended Init - talking about texture dimensions: 16384x16384
etc. The numbers are wrong here - must have had much larger dims originally.
The bit about not fitting into memory .: does not hold. The biggest size there
(16k) is 1GB, everything else is just big.
-
errata - Vertex Buffer Objects - "bottleneck is the bus" → "bottleneck created by queuing commands to send to
gpu" (bus is actually very large)
-
errata - Phong - explain why I did the dot_p = max (0.0, dot_p),
add it to the Blinn code sample, and add it to the Common Mistakes list.
18 January 2016 (Edition 5 → Edition 6)
Shaders chapter:
- Re-drew the first diagram for clarity
- Clarified the paragraphs too - removed the overly-specific advice
- A complete shader programme controls comprises → -controls
- shader slots → processors on the GPU
- table says slots - cores
- "For example:..." → just delete this paragraph, it's misleading
- attribute or uniform variables → variable
- shader slots will be empty → GPU cores will be idle
Alpha Blending:
- would completely replaces → replace
13 January 2016 (Edition 4 → Edition 5)
- Extended Init; Anti-Aliasing: "the edges our meshes and triangles" --> "of"
- Kindle Location: 1377 ; Description: "The are all" should be "They are all "
- Kindle Location: 1206 ; Description: "It you want " should be "If you want "
- Kindle Location: 252 ; Description: "ask GLFW is the " should be "ask GLFW if the "
- Various repeated-word typos e.g. "and and"
31 August 2015 (Edition 3 → Edition 4)
- Typo in preface → "Kernighan".
- Updated Intel/Linux/OS X info in preface
- Fixed Texture Mapping Mip-Map an an-isotropy wording "largest/smallest"
→ "closest fitting"
- Updated Geometry Shaders built-in variables gl_VerticesIn to
gl_in.length().
Fixed - 26 November 2014 (Edition 2 → Edition 3)
- Formatting - TOC tag for online viewer
- Extended Initialisation - Improved _update_fps_counter() code for
strict C compilation.
- Extended Initialisation - char msg[256]; under "Printing
Parameters from the GL Context" is unused → removed.
- OpenGL Extensions and the Debug Callback - Code for error messages was not
totally correct - changed from arrays of strings to switch statements.
Fixed - 26 November 2014 (Edition 1 → Edition 2)
I re-worded several sections in the "Discussion" chapter to clarify the guide
to building larger programmes, and reduce the functions listed from my utility
file.
Fixed - 1 August 2014 (Edition 0 → Edition 1)
- Source Code - maths_funcs.h → matrix constructor comment says "row
major", is actually column major
- Source Code - sprite sheets → sprite_index unused
- Source Code - UBO demo - commented line 456 means code differs from article
- seems like a mistake, because this affects camera code. view matrix
unused?
- Preface - Hogsköla → Högskola
- Downloading Source Code - Change download information to GitHub address
- Hello Triangle - "The main libraries that you need is" → "library that
you need is"
- Hello Triangle - "that latest version of GL" → "the latest version of
GL"
- Hello Triangle - linking on Linux → libraries have different names
-lOpenGL32 becomes -lGL
- Hello Triangle - linking libs image has -lglu32 in it
- Hello Triangle - MinGW not explained → should maybe say a windows
version of gcc
- Hello Triangle - will replace with comparison of linking on different
systems
- Hello Triangle - "Both are be written" → "Both are written"
-
Extended Init - "are nicely filtered, the edges our our meshes and triangles"
→ "are nicely filtered, the edges of our meshes and triangles"
- Vertex Buffers - "We will copy this chunk of memory onto the graphics
cards" → card
- Vertex Buffers - "output variable called, which I called" → "output
variable, which I called"
- Shaders - "contains the operators in C" → "has the same operators as
C"
- Shaders - clip space → should say what this is briefly when first used
(first described later in text).
- Phong - "specular power" variable used - should be "specular exponent"
- Phong - affect/effect backwards a few times
- Phong - "shader is data" → "shader has data"
- Phong - 1 or 2 more broken phrasings due to editing
- Textures - "OpenGL does not properly set default" → "defaults"
- Textures - "Next check the..." → missing a bullet
- Normal Maps - "except that we converting" → "convert"
- Normal Maps - "for quick approach" → "a quick solution"
- Cube Maps - "Then glTexImage2D() is called times → "is called 6
times"
- Cube Maps - "use the texture() function, but older..." → "we use the
texture() function here"
- UBOs - Why is the view matrix not used in the shader snippet?
- Tessellation - Needs example snippet of C code to show what patch numbers
are / how they relate to a triangle.
- Bitmap Fonts - "First texture, coordinate," → remove commas
- Bitmap Fonts - "too big for the vertex buffer" → "too big"
- Bitmap Fonts - glPointSize() → deprecated, remove?
- Fonts from Files - A code snippet is missing line breaks
- Fonts from Files - "we us a" → "we use a"
- Particles - "is which lets" → "which lets"
- Skinning Pt.1 - "The are used" → "These are used"
- Skinning Pt.1 - "Will that the" → delete
- Skinning Pt.1 - "and my copy" → -my
-
Skinning Pt.3 - "TODO explain SLERP fix here." → "This is a problem with
SLERP, as
explained in the Quaternions article. We correct this by checking if the dot
product of the 2 versors is negative before calling SLERP. If so we negate one
versor".
-
Skinning Pt.3 - Finalising the animation, animation matrix maths is incorrect
→ correct in
demo code, needs update.
- Shadows - "Hello World example" → "Hello Triangle example"
- Building Larger Programmes - Code comment in first snippet about GL
versions can be deleted