Commits

Jason McKesson committed 411edf8

Code verified on Windows with Catalyst 12.1 drivers.
A couple of errors were fixed.

  • Participants
  • Parent commits 6a3f1e6

Comments (0)

Files changed (7)

Documents/Illumination/Tutorial 13.xml

                 we transform the camera-space position to clip-space as normal.</para>
             <para>The output <varname>mapping</varname> is a value that is used by the fragment
                 shader, as we will see below.</para>
-            <para>Since this vertex shader takes no inputs, you might think that you could get away
-                with binding a vertex array object that had no enabled attributes. Alas, this does
-                not work; we must have a dummy attribute enabled and a dummy buffer object to pull
-                data from. We do this in the initialization function of this tutorial.</para>
-            <note>
-                <para>The OpenGL 3.3 core specification is quite clear that it should be possible to
-                    render with no enabled attributes. Sadly, certain implementations of OpenGL
-                    (*cough*AMD*cough*) incorrectly forbid it, so our tutorial has to work around
-                    them.</para>
-            </note>
+            <para>Since this vertex shader takes no inputs, our vertex array object does not need to
+                contain anything either. That is, we never call
+                    <function>glEnableVertexAttribArray</function> on the VAO. Since no attribute
+                arrays are enabled, we also have no need for a buffer object to store vertex array
+                data. So we never call <function>glVertexAttribPointer</function>. We simply
+                generate an empty VAO with <function>glGenVertexArrays</function> and use it without
+                modification.</para>
         </section>
         <section>
             <title>Racketeering Rasterization</title>
             <para>Try doing these things with the given programs.</para>
             <itemizedlist>
                 <listitem>
+                    <para>The first version of our impostors was a sphere approximation. It was not
+                        useful for relatively large spheres, but it could be useful for small ones.
+                        However, that approximation did not compute the depth of the fragment
+                        correctly. Make a version of it that does.</para>
+                </listitem>
+                <listitem>
                     <para>Change the geometry impostor tutorial to take another vertex input: the
                         material to use. The vertex shader should pass it along to the geometry
                         shader, and the geometry shader should hand it to the fragment shader. You
             <para>There are other impostor-based solutions. Most particle systems (a large and
                 vibrant topic that you should investigate) use flat-cards to draw pictures that move
                 through space. These images can animate, changing from one image to another based on
-                time, and large groups of these particle can be used to simulate various phenomena
+                time, and large groups of these particles can be used to simulate various phenomena
                 like smoke, fire, and the like.</para>
-            <para>All of these subjects are worthy of your time.</para>
+            <para>All of these subjects are worthy of your time. Of course, moving pictures through
+                space requires being able to draw pictures. That means textures, which
+                coincidentally is the topic for our next section.</para>
         </section>
         <section>
             <title>GLSL Features of Note</title>

Documents/Tutorial Documents.xpr

             <file name="chunked.css"/>
             <file name="standard.css"/>
         </folder>
+        <folder name="Schemas">
+            <file name="meshFormat.rnc"/>
+            <file name="sceneFormat.rnc"/>
+        </folder>
         <file name="Building%20the%20Tutorials.xml"/>
         <file name="cssDoc.txt"/>
-        <file name="meshFormat.rnc"/>
         <file name="Outline.xml"/>
         <file name="preface.xml"/>
         <file name="Tutorials.xml"/>

Documents/preface.xml

             presented in the tutorial. It will also contain suggestions for playing with the source
             code itself; these are intended to further your understanding of these concepts. If the
             tutorial introduced new OpenGL functions or functions for the OpenGL shading language,
-            they will be reviewed here as well. Each tutorial ends with a glossary of defined
-            terms.</para>
+            they will be reviewed here as well.</para>
+        <para>This is a book for beginning graphics programmers. Graphics is a huge topic, and this
+            book will not cover every possible effect, feature, or technique. This book will also
+            not cover every technique in full detail. Sometimes techniques will be revisited in
+            later materials, but there simply isn't enough space to say everything about everything.
+            Therefore, when certain techniques are introduced, there will be a section at the end
+            providing some cursory examination of more advanced techniques. This will help you
+            further your own research into graphics programming, as you will know what to search for
+            online or in other books.</para>
+        <para>Each tutorial ends with a glossary of all of the terms defined in that
+            tutorial.</para>
         <note condition="web">
             <title>Browser Note</title>
             <para>This website and these tutorials make extensive use of SVG images. Basic SVG

Tut 12 Dynamic Range/Gamma Correction.cpp

 	GLuint lightBlock = glGetUniformBlockIndex(data.theProgram, "Light");
 	GLuint projectionBlock = glGetUniformBlockIndex(data.theProgram, "Projection");
 
-	glUniformBlockBinding(data.theProgram, materialBlock, g_materialBlockIndex);
+	if(materialBlock != GL_INVALID_INDEX) //Can be optimized out.
+		glUniformBlockBinding(data.theProgram, materialBlock, g_materialBlockIndex);
 	glUniformBlockBinding(data.theProgram, lightBlock, g_lightBlockIndex);
 	glUniformBlockBinding(data.theProgram, projectionBlock, g_projectionBlockIndex);
 

Tut 12 Dynamic Range/HDR Lighting.cpp

 	GLuint lightBlock = glGetUniformBlockIndex(data.theProgram, "Light");
 	GLuint projectionBlock = glGetUniformBlockIndex(data.theProgram, "Projection");
 
-	glUniformBlockBinding(data.theProgram, materialBlock, g_materialBlockIndex);
+	if(materialBlock != GL_INVALID_INDEX) //Can be optimized out.
+		glUniformBlockBinding(data.theProgram, materialBlock, g_materialBlockIndex);
 	glUniformBlockBinding(data.theProgram, lightBlock, g_lightBlockIndex);
 	glUniformBlockBinding(data.theProgram, projectionBlock, g_projectionBlockIndex);
 

Tut 12 Dynamic Range/Scene Lighting.cpp

 	GLuint lightBlock = glGetUniformBlockIndex(data.theProgram, "Light");
 	GLuint projectionBlock = glGetUniformBlockIndex(data.theProgram, "Projection");
 
-	glUniformBlockBinding(data.theProgram, materialBlock, g_materialBlockIndex);
+	if(materialBlock != GL_INVALID_INDEX) //Can be optimized out.
+		glUniformBlockBinding(data.theProgram, materialBlock, g_materialBlockIndex);
 	glUniformBlockBinding(data.theProgram, lightBlock, g_lightBlockIndex);
 	glUniformBlockBinding(data.theProgram, projectionBlock, g_projectionBlockIndex);
 

Tut 13 Impostors/BasicImpostor.cpp

 	glBufferData(GL_ARRAY_BUFFER, 4 * sizeof(float), NULL, GL_STATIC_DRAW);
 
 	glGenVertexArrays(1, &g_imposterVAO);
-	glBindVertexArray(g_imposterVAO);
-	glEnableVertexAttribArray(0);
-	glVertexAttribPointer(0, 1, GL_FLOAT, GL_FALSE, 0, (void*)(0));
+//	glBindVertexArray(g_imposterVAO);
+//	glEnableVertexAttribArray(0);
+//	glVertexAttribPointer(0, 1, GL_FLOAT, GL_FALSE, 0, (void*)(0));
 
 	glBindVertexArray(0);
 	glBindBuffer(GL_ARRAY_BUFFER, 0);