Roi Atalla avatar Roi Atalla committed 0c2db0b

Example 17.2 almost fully ported, still something wrong with the lighting.

Comments (0)

Files changed (26)

.idea/workspace.xml

 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="ChangeListManager">
-    <list default="true" id="3bd3582b-975a-4915-888d-8e2c52d85938" name="Default" comment="Removed extraneous file and added Scene.java, no clue why that was ever removed.">
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/Scene.java" />
-      <change type="DELETED" beforePath="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter17\scene.xml" afterPath="" />
+    <list default="true" id="3bd3582b-975a-4915-888d-8e2c52d85938" name="Default" comment="">
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Bands.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Flashlight.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.PointsOfLight.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.concrete649_small.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.dsc_1621_small.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.rough645_small.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.seamless_rock1_small.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.wood4_rotate.dds" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/Example17_2.java" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Colored.frag" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Colored.vert" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.LongBar.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.ShortBar.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.UnitAxes.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.UnitCube.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.UnitDiorama.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.UnitPlane.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.UnitSphere.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Unlit.frag" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Unlit.vert" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.projLight.frag" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.projLight.vert" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.scene.xml" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/ra4king/opengl/util/math/Matrix4.java" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/util/math/Matrix4.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/example17.1.LitTexture.frag" afterPath="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/example17.1.LitTexture.frag" />
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
     </list>
     <ignored path="OpenGL.iws" />
     <file path="/a.xml" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1361850040520" ignored="false" />
     <file path="/a.html" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1361850041808" ignored="false" />
     <file path="/a.groovy" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1361850042481" ignored="false" />
-    <file path="/Dummy.txt" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369898175488" ignored="false" />
+    <file path="/Dummy.txt" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369898196192" ignored="false" />
     <file path="/Example12_1.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1362027020824" ignored="false" />
     <file path="/example12.1.DiffuseSpecular.frag" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1361702005810" ignored="false" />
     <file path="/LightManager.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1362461124226" ignored="false" />
     <file path="/sample.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1367460530818" ignored="false" />
-    <file path="/Scene.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369898191272" ignored="false" />
+    <file path="/Scene.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369902901380" ignored="false" />
     <file path="$PROJECT_DIR$/bin/com/ra4king/opengl/arcsynthesis/gl33/chapter8/example1/example8.1.Ship.xml" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1361777249769" ignored="false" />
     <file path="$PROJECT_DIR$/bin/com/ra4king/opengl/arcsynthesis/gl33/chapter8/example2/example8.2.Ship.xml" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1361777249770" ignored="false" />
     <file path="$PROJECT_DIR$/bin/com/ra4king/opengl/arcsynthesis/gl33/chapter9/example2/example9.2.UnitCylinder.xml" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1361777249770" ignored="false" />
     <file path="/Example12_2.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1362460014781" ignored="false" />
     <file path="/Quaternion.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1362099952877" ignored="false" />
     <file path="/Utils.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369897748666" ignored="false" />
-    <file path="/Matrix4.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369812977842" ignored="false" />
+    <file path="/Matrix4.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369904233871" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter8/example2/Example8_2.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369249811640" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter8/example1/Example8_1.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369249811640" ignored="false" />
     <file path="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter7/example1/Example7_1.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369249811643" ignored="false" />
     <file path="/UniformVec4Binder.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369643535594" ignored="false" />
     <file path="/TextureBinder.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369643566359" ignored="false" />
     <file path="/example17.1.LitTexture.vert" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369806975413" ignored="false" />
-    <file path="/example17.1.LitTexture.frag" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369890062184" ignored="false" />
+    <file path="/example17.1.LitTexture.frag" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369905788025" ignored="false" />
     <file path="/example17.1.scene.xml" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369891097369" ignored="false" />
+    <file path="/Example17_2.java" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369905213117" ignored="false" />
+    <file path="/example17.2.Colored.vert" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369905436267" ignored="false" />
+    <file path="/example17.2.Colored.frag" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369905472067" ignored="false" />
+    <file path="/example17.2.projLight.vert" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369905667042" ignored="false" />
+    <file path="/example17.2.projLight.frag" changelist="3bd3582b-975a-4915-888d-8e2c52d85938" time="1369905772871" ignored="false" />
     <option name="TRACKING_ENABLED" value="true" />
     <option name="SHOW_DIALOG" value="true" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
   </component>
   <component name="FileEditorManager">
     <leaf>
-      <file leaf-file-name="Scene.java" pinned="false" current="true" current-in-tab="true">
-        <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/Scene.java">
+      <file leaf-file-name="Example17_2.java" pinned="false" current="true" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/Example17_2.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="322" column="16" selection-start="12231" selection-end="12231" vertical-scroll-proportion="0.5032258">
+            <state line="405" column="4" selection-start="12939" selection-end="12939" vertical-scroll-proportion="0.5240113">
               <folding>
                 <element signature="imports" expanded="true" />
               </folding>
   <component name="IdeDocumentHistory">
     <option name="changedFiles">
       <list>
-        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/util/Mesh.java" />
-        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/GLProgram.java" />
-        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/example17.1.LitTexture.frag" />
-        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/example17.1.scene.xml" />
-        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/example17.1.UnitCube.xml" />
-        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter13/example1/example13.1.UnitCube.xml" />
-        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter11/example2/example11.2.UnitCube.xml" />
-        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter11/example3/example11.3.UnitCube.xml" />
-        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter12/example12.UnitCube.xml" />
         <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter13/example2/example13.2.UnitCube.xml" />
         <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter14/example1/example14.1.UnitCube.xml" />
         <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter14/example3/example14.3.UnitCube.xml" />
         <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/Example17_1.java" />
         <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/example17.1.UnitSphere.xml" />
         <option value="$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/Scene.java" />
+        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/util/math/Matrix4.java" />
+        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.scene.xml" />
+        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.UnitAxes.xml" />
+        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Colored.vert" />
+        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Colored.frag" />
+        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.projLight.vert" />
+        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.projLight.frag" />
+        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/example17.1.LitTexture.frag" />
+        <option value="$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/Example17_2.java" />
       </list>
     </option>
   </component>
               <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
             </PATH_ELEMENT>
           </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="OpenGL" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="OpenGL" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="src" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="OpenGL" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="OpenGL" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="src" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="opengl" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="OpenGL" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="OpenGL" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="src" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="opengl" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="arcsynthesis" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="gl33" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="chapter17" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="OpenGL" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="OpenGL" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="src" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="opengl" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="arcsynthesis" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="gl33" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="chapter17" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="example2" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="OpenGL" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="OpenGL" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="src" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="opengl" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="arcsynthesis" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="gl33" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="chapter17" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="example1" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="OpenGL" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="OpenGL" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="src" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="opengl" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="arcsynthesis" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="gl33" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="OpenGL" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="OpenGL" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="src" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="opengl" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="arcsynthesis" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
         </subPane>
       </pane>
     </panes>
       <recent name="com.ra4king.opengl.arcsynthesis.gl33.chapter12.example2" />
     </key>
     <key name="CopyFile.RECENT_KEYS">
+      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter17\example2" />
       <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter17\example1" />
       <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl32" />
       <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\files\natives" />
       <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\files" />
-      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter15" />
+    </key>
+    <key name="MoveFile.RECENT_KEYS">
+      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter17\example2" />
+      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter16\example3" />
+      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter16\example2" />
+      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\testdata" />
     </key>
     <key name="MoveClassesOrPackagesDialog.RECENTS_KEY">
       <recent name="rosick.jglsdk" />
       <recent name="roFsick.jglsdk" />
       <recent name="rosick.jglsdk.glimg" />
     </key>
-    <key name="MoveFile.RECENT_KEYS">
-      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter16\example3" />
-      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\arcsynthesis\gl33\chapter16\example2" />
-      <recent name="E:\Roi Atalla\Documents\Programming Files\Java Files\Personal Projects\OpenGL\src\com\ra4king\opengl\testdata" />
-    </key>
   </component>
-  <component name="RunManager" selected="Application.Example17_1">
-    <configuration default="false" name="Example3_2" type="Application" factoryName="Application" temporary="true">
-      <option name="MAIN_CLASS_NAME" value="com.ra4king.opengl.arcsynthesis.gl32.chapter3.example2.Example3_2" />
-      <option name="VM_PARAMETERS" value="-Djava.library.path=libs/lwjgl/natives" />
-      <option name="PROGRAM_PARAMETERS" value="" />
-      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
-      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
-      <option name="ALTERNATIVE_JRE_PATH" value="" />
-      <option name="ENABLE_SWING_INSPECTOR" value="false" />
-      <option name="ENV_VARIABLES" />
-      <option name="PASS_PARENT_ENVS" value="true" />
-      <module name="OpenGL" />
-      <envs />
-      <RunnerSettings RunnerId="Run" />
-      <ConfigurationWrapper RunnerId="Run" />
-      <method />
-    </configuration>
+  <component name="RunManager" selected="Application.Example17_2">
     <configuration default="false" name="Example3_3" type="Application" factoryName="Application" temporary="true">
       <option name="MAIN_CLASS_NAME" value="com.ra4king.opengl.arcsynthesis.gl32.chapter3.example3.Example3_3" />
       <option name="VM_PARAMETERS" value="-Djava.library.path=libs/lwjgl/natives" />
       <ConfigurationWrapper RunnerId="Run" />
       <method />
     </configuration>
+    <configuration default="false" name="Example17_2" type="Application" factoryName="Application" temporary="true">
+      <option name="MAIN_CLASS_NAME" value="com.ra4king.opengl.arcsynthesis.gl33.chapter17.example2.Example17_2" />
+      <option name="VM_PARAMETERS" value="-Djava.library.path=libs/lwjgl/natives" />
+      <option name="PROGRAM_PARAMETERS" value="" />
+      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+      <option name="ALTERNATIVE_JRE_PATH" value="" />
+      <option name="ENABLE_SWING_INSPECTOR" value="false" />
+      <option name="ENV_VARIABLES" />
+      <option name="PASS_PARENT_ENVS" value="true" />
+      <module name="OpenGL" />
+      <envs />
+      <RunnerSettings RunnerId="Debug">
+        <option name="DEBUG_PORT" value="" />
+        <option name="TRANSPORT" value="0" />
+        <option name="LOCAL" value="true" />
+      </RunnerSettings>
+      <RunnerSettings RunnerId="Run" />
+      <ConfigurationWrapper RunnerId="Debug" />
+      <ConfigurationWrapper RunnerId="Run" />
+      <method />
+    </configuration>
     <configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
       <module name="" />
       <option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m" />
       <method />
     </configuration>
     <list size="5">
-      <item index="0" class="java.lang.String" itemvalue="Application.Example3_2" />
-      <item index="1" class="java.lang.String" itemvalue="Application.Example3_3" />
-      <item index="2" class="java.lang.String" itemvalue="Application.Example16_3" />
-      <item index="3" class="java.lang.String" itemvalue="Application.Example17_1" />
-      <item index="4" class="java.lang.String" itemvalue="Application.Example14_3" />
+      <item index="0" class="java.lang.String" itemvalue="Application.Example3_3" />
+      <item index="1" class="java.lang.String" itemvalue="Application.Example16_3" />
+      <item index="2" class="java.lang.String" itemvalue="Application.Example17_1" />
+      <item index="3" class="java.lang.String" itemvalue="Application.Example14_3" />
+      <item index="4" class="java.lang.String" itemvalue="Application.Example17_2" />
     </list>
     <recent_temporary>
       <list size="5">
-        <item index="0" class="java.lang.String" itemvalue="Application.Example17_1" />
-        <item index="1" class="java.lang.String" itemvalue="Application.Example14_3" />
-        <item index="2" class="java.lang.String" itemvalue="Application.Example16_3" />
-        <item index="3" class="java.lang.String" itemvalue="Application.Example3_3" />
-        <item index="4" class="java.lang.String" itemvalue="Application.Example3_2" />
+        <item index="0" class="java.lang.String" itemvalue="Application.Example17_2" />
+        <item index="1" class="java.lang.String" itemvalue="Application.Example17_1" />
+        <item index="2" class="java.lang.String" itemvalue="Application.Example14_3" />
+        <item index="3" class="java.lang.String" itemvalue="Application.Example16_3" />
+        <item index="4" class="java.lang.String" itemvalue="Application.Example3_3" />
       </list>
     </recent_temporary>
     <configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false">
       <created>1369898069520</created>
       <updated>1369898069520</updated>
     </task>
-    <option name="localTasksCounter" value="40" />
+    <task id="LOCAL-00040" summary="Removed extraneous file and added Scene.java, no clue why that was ever removed.">
+      <created>1369898198478</created>
+      <updated>1369898198478</updated>
+    </task>
+    <option name="localTasksCounter" value="41" />
     <servers />
   </component>
-  <component name="TodoView" selected-index="4">
+  <component name="TodoView" selected-index="3">
     <todo-panel id="selected-file">
       <are-packages-shown value="false" />
       <are-modules-shown value="false" />
       <window_info id="JetGradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32977587" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
       <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.58528787" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
-      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.21748401" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.21748401" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.29317698" sideWeight="0.51387405" order="9" side_tool="true" content_ui="tabs" />
       <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.18366013" sideWeight="0.14915694" order="2" side_tool="true" content_ui="tabs" />
       <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.29104477" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
       <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.23240939" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
-      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.14605543" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.14605543" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.18366013" sideWeight="0.17250325" order="1" side_tool="true" content_ui="tabs" />
       <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32977587" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
       <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.36819637" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
-      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.20170757" sideWeight="0.85394454" order="0" side_tool="true" content_ui="combo" x="2394" y="136" width="397" height="768" />
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.20170757" sideWeight="0.782516" order="0" side_tool="true" content_ui="combo" x="2394" y="136" width="397" height="768" />
       <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32089552" sideWeight="0.4823906" order="2" side_tool="false" content_ui="tabs" />
       <window_info id="Documentation" active="true" anchor="right" auto_hide="false" internal_type="SLIDING" type="FLOATING" visible="true" weight="0.32977587" sideWeight="0.80490404" order="4" side_tool="false" content_ui="combo" x="2005" y="108" width="1736" height="896" />
       <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
     <option name="FILTER_TARGETS" value="false" />
   </component>
   <component name="editorHistoryManager">
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter13/example1/example13.1.UnitCube.xml">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="104" column="15" selection-start="1632" selection-end="1632" vertical-scroll-proportion="0.7518797">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter14/example1/example14.1.UnitCube.xml">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="101" column="13" selection-start="1605" selection-end="1605" vertical-scroll-proportion="0.68421054">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter14/example3/example14.3.UnitCube.xml">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="113" column="0" selection-start="1719" selection-end="1719" vertical-scroll-proportion="0.9548872">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter14/example3/Example14_3.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="72" column="4" selection-start="2466" selection-end="2466" vertical-scroll-proportion="0.7218045">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/util/math/Matrix3.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="39" column="0" selection-start="579" selection-end="579" vertical-scroll-proportion="0.0">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/util/math/Matrix4.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="119" column="0" selection-start="2691" selection-end="2691" vertical-scroll-proportion="0.0">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/GLProgram.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="112" column="0" selection-start="2318" selection-end="2318" vertical-scroll-proportion="0.33333334">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/util/MousePoles.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="497" column="0" selection-start="12835" selection-end="12835" vertical-scroll-proportion="0.289548">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="jar://$PROJECT_DIR$/libs/lwjgl/lwjgl.jar!/org/lwjgl/input/Mouse.class">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="119" column="26" selection-start="4360" selection-end="4360" vertical-scroll-proportion="0.84626645">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/util/math/Vector2.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="19" column="0" selection-start="306" selection-end="306" vertical-scroll-proportion="0.289548">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/util/Utils.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="54" column="4" selection-start="1605" selection-end="1605" vertical-scroll-proportion="0.39689267">
-          <folding />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/example17.1.UnitSphere.xml">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="415" column="7" selection-start="20282" selection-end="20282" vertical-scroll-proportion="0.95090014">
-          <folding />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/Example17_1.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="234" column="8" selection-start="7103" selection-end="7103" vertical-scroll-proportion="0.7741408">
+        <state line="69" column="4" selection-start="2162" selection-end="2162" vertical-scroll-proportion="0.7697368">
           <folding>
             <element signature="imports" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/util/MousePoles.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="329" column="15" selection-start="8088" selection-end="8088" vertical-scroll-proportion="0.33333334">
+          <folding />
+        </state>
+      </provider>
+    </entry>
     <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/example17.1.scene.xml">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="42" column="21" selection-start="1525" selection-end="1525" vertical-scroll-proportion="1.0310966">
+        <state line="42" column="21" selection-start="1525" selection-end="1525" vertical-scroll-proportion="0.69078946">
           <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/util/scene/Scene.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="322" column="16" selection-start="12231" selection-end="12231" vertical-scroll-proportion="0.5032258">
+        <state line="613" column="8" selection-start="20425" selection-end="20425" vertical-scroll-proportion="0.62938595">
+          <folding>
+            <element signature="imports" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/util/math/Matrix4.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="74" column="4" selection-start="1714" selection-end="1714" vertical-scroll-proportion="0.625">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.ShortBar.xml">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="29" column="16" selection-start="593" selection-end="593" vertical-scroll-proportion="0.47697368">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.UnitAxes.xml">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="21" column="7" selection-start="443" selection-end="443" vertical-scroll-proportion="0.34539473">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/rosick/jglsdk/glimg/DdsLoader.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="22" column="8" selection-start="732" selection-end="732" vertical-scroll-proportion="0.29459903">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Unlit.vert">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="17" column="0" selection-start="260" selection-end="260" vertical-scroll-proportion="0.41734862">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Colored.vert">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="21" column="0" selection-start="348" selection-end="348" vertical-scroll-proportion="0.5155483">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Colored.frag">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="10" column="0" selection-start="110" selection-end="110" vertical-scroll-proportion="0.24549918">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.projLight.vert">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="31" column="0" selection-start="756" selection-end="756" vertical-scroll-proportion="0.7610475">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.projLight.frag">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="80" column="4" selection-start="2080" selection-end="2080" vertical-scroll-proportion="0.7299509">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/example17.1.LitTexture.frag">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="70" column="4" selection-start="1712" selection-end="1712" vertical-scroll-proportion="0.83469725">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.scene.xml">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="29" column="9" selection-start="1200" selection-end="1200" vertical-scroll-proportion="0.5646481">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/Example17_2.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="405" column="4" selection-start="12939" selection-end="12939" vertical-scroll-proportion="0.5240113">
           <folding>
             <element signature="imports" expanded="true" />
           </folding>

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/example17.1.LitTexture.frag

 
 uniform int numberOfLights;
 
-float CalcAttenuation(in vec3 cameraSpacePosition, in vec3 cameraSpaceLightPos, out vec3 lightDirection)
+float calcAttenuation(in vec3 cameraSpacePosition, in vec3 cameraSpaceLightPos, out vec3 lightDirection)
 {
 	vec3 lightDifference =  cameraSpaceLightPos - cameraSpacePosition;
 	float lightDistanceSqr = dot(lightDifference, lightDifference);
 	return 1.0 / (1.0 + Lgt.lightAttenuation * lightDistanceSqr);
 }
 
-vec4 ComputeLighting(in vec4 diffuseColor, in PerLight lightData)
+vec4 computeLighting(in vec4 diffuseColor, in PerLight lightData)
 {
 	vec3 lightDir;
 	vec4 lightIntensity;
 	}
 	else
 	{
-		float atten = CalcAttenuation(cameraSpacePosition, lightData.cameraSpaceLightPos.xyz, lightDir);
+		float atten = calcAttenuation(cameraSpacePosition, lightData.cameraSpaceLightPos.xyz, lightDir);
 		lightIntensity = atten * lightData.lightIntensity;
 	}
 	
 	vec4 accumLighting = diffuseColor * Lgt.ambientIntensity;
 	for(int light = 0; light < numberOfLights; light++)
 	{
-		accumLighting += ComputeLighting(diffuseColor, Lgt.lights[light]);
+		accumLighting += computeLighting(diffuseColor, Lgt.lights[light]);
 	}
 	
 	outputColor = accumLighting / Lgt.maxIntensity;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/Example17_2.java

+package com.ra4king.opengl.arcsynthesis.gl33.chapter17.example2;
+
+import static org.lwjgl.opengl.GL11.*;
+import static org.lwjgl.opengl.GL12.*;
+import static org.lwjgl.opengl.GL13.*;
+import static org.lwjgl.opengl.GL15.*;
+import static org.lwjgl.opengl.GL20.*;
+import static org.lwjgl.opengl.GL30.*;
+import static org.lwjgl.opengl.GL31.*;
+import static org.lwjgl.opengl.GL32.*;
+import static org.lwjgl.opengl.GL33.*;
+
+import java.io.IOException;
+import java.nio.FloatBuffer;
+import java.util.ArrayList;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.input.Keyboard;
+import org.xmlpull.v1.XmlPullParserException;
+
+import com.ra4king.opengl.GLProgram;
+import com.ra4king.opengl.util.Mesh;
+import com.ra4king.opengl.util.MousePoles.MouseButton;
+import com.ra4king.opengl.util.MousePoles.ViewData;
+import com.ra4king.opengl.util.MousePoles.ViewPole;
+import com.ra4king.opengl.util.MousePoles.ViewScale;
+import com.ra4king.opengl.util.ShaderProgram;
+import com.ra4king.opengl.util.Timer;
+import com.ra4king.opengl.util.Timer.Type;
+import com.ra4king.opengl.util.Utils;
+import com.ra4king.opengl.util.math.Matrix4;
+import com.ra4king.opengl.util.math.MatrixStack;
+import com.ra4king.opengl.util.math.Quaternion;
+import com.ra4king.opengl.util.math.Vector3;
+import com.ra4king.opengl.util.math.Vector4;
+import com.ra4king.opengl.util.scene.Scene;
+import com.ra4king.opengl.util.scene.Scene.SceneNode;
+import com.ra4king.opengl.util.scene.binders.UniformIntBinder;
+import com.ra4king.opengl.util.scene.binders.UniformMat4Binder;
+import com.ra4king.opengl.util.scene.binders.UniformVec3Binder;
+
+import rosick.jglsdk.glimg.DdsLoader;
+import rosick.jglsdk.glimg.ImageSet;
+import rosick.jglsdk.glimg.TextureGenerator;
+
+/**
+ * @author ra4king
+ */
+public class Example17_2 extends GLProgram {
+	public static void main(String[] args) {
+		new Example17_2().run(true);
+	}
+	
+	private Scene scene;
+	private ArrayList<SceneNode> nodes;
+	
+	private Timer timer = new Timer(Type.LOOP, 10);
+	
+	private static final int MAX_NUMBER_OF_LIGHTS = 4;
+	
+	private UniformIntBinder lightNumBinder;
+	private UniformMat4Binder lightProjMatBinder;
+	private UniformVec3Binder camLightPosBinder;
+	
+	private Quaternion spinBarOrient;
+	
+	private ShaderProgram unlit;
+	private int unlitModelToCameraMatrixUniform;
+	private int unlitObjectColorUniform;
+	
+	private ShaderProgram colored;
+	private int coloredModelToCameraMatrixUniform;
+	
+	private Mesh sphereMesh;
+	private Mesh axesMesh;
+	
+	private ViewPole viewPole;
+	private ViewPole lightViewPole;
+	
+	private final String[][] texDefs = {
+			{ "Flashlight.dds", "Flashlight" },
+			{ "PointsOfLight.dds", "Multiple Point Lights" },
+			{ "Bands.dds", "Light Bands" },
+	};
+	
+	private final int NUM_LIGHT_TEXTURES = texDefs.length;
+	
+	private int[] lightTextures = new int[NUM_LIGHT_TEXTURES];
+	private int currTextureIndex;
+	
+	private int projectionUniformBuffer;
+	private int lightUniformBuffer;
+	
+	private final int NUM_SAMPLERS = 2;
+	private int[] samplers = new int[NUM_SAMPLERS];
+	private int currSampler;
+	
+	private final float[] lightFOVS = { 10, 20, 45, 75, 90, 120, 150, 170 };
+	private int currFOVIndex = 3;
+	
+	private boolean drawCameraPos, showOtherLights = true;
+	
+	private final int projectionBlockIndex = 0;
+	private final int lightBlockIndex = 1;
+	private final int lightProjectionTexUnit = 3;
+	
+	public Example17_2() {
+		super("Example 17.2 - Projected Light", 500, 500, true);
+	}
+	
+	@Override
+	public void init() {
+		glClearColor(0.8f, 0.8f, 0.8f, 1);
+		glClearDepth(1);
+		
+		ViewData initialView = new ViewData(new Vector3(0, 0, 10), new Quaternion(0.16043f, -0.376867f, -0.0664516f, 0.909845f), 25, 0);
+		ViewScale initialViewScale = new ViewScale(5, 70, 2, 0.5f, 2, 0.5f, 90f / 250f);
+		
+		ViewData initLightView = new ViewData(new Vector3(0, 0, 20), new Quaternion(), 5, 0);
+		ViewScale initLightViewScale = new ViewScale(0.05f, 10, 0.1f, 0.05f, 4, 1, 90f / 250f);
+		
+		viewPole = new ViewPole(initialView, initialViewScale, MouseButton.LEFT_BUTTON);
+		lightViewPole = new ViewPole(initLightView, initLightViewScale, MouseButton.RIGHT_BUTTON, true);
+		
+		glEnable(GL_CULL_FACE);
+		glCullFace(GL_BACK);
+		glFrontFace(GL_CW);
+		
+		glEnable(GL_DEPTH_TEST);
+		glDepthMask(true);
+		glDepthFunc(GL_LEQUAL);
+		glDepthRange(0, 1);
+		glEnable(GL_DEPTH_CLAMP);
+		glEnable(GL_FRAMEBUFFER_SRGB);
+		
+		projectionUniformBuffer = glGenBuffers();
+		glBindBuffer(GL_UNIFORM_BUFFER, projectionUniformBuffer);
+		glBufferData(GL_UNIFORM_BUFFER, 16 * 4, GL_STREAM_DRAW);
+		
+		glBindBufferRange(GL_UNIFORM_BUFFER, projectionBlockIndex, projectionUniformBuffer, 0, 16 * 4);
+		
+		glBindBuffer(GL_UNIFORM_BUFFER, 0);
+		
+		createSamplers();
+		loadTextures();
+		
+		try {
+			loadAndSetupScene();
+		} catch(Exception exc) {
+			exc.printStackTrace();
+			destroy();
+		}
+		
+		lightUniformBuffer = glGenBuffers();
+		glBindBuffer(GL_UNIFORM_BUFFER, lightUniformBuffer);
+		glBufferData(GL_UNIFORM_BUFFER, LightBlock.SIZE, GL_STREAM_DRAW);
+		
+		glBindBufferRange(GL_UNIFORM_BUFFER, lightBlockIndex, lightUniformBuffer, 0, LightBlock.SIZE);
+		
+		glBindBuffer(GL_UNIFORM_BUFFER, 0);
+	}
+	
+	private void createSamplers() {
+		for(int a = 0; a < samplers.length; a++) {
+			samplers[a] = glGenSamplers();
+			glSamplerParameteri(samplers[a], GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+			glSamplerParameteri(samplers[a], GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+		}
+		
+		glSamplerParameteri(samplers[0], GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+		glSamplerParameteri(samplers[0], GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+		
+		glSamplerParameteri(samplers[1], GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
+		glSamplerParameteri(samplers[1], GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
+		
+		glSamplerParameter(samplers[1], GL_TEXTURE_BORDER_COLOR, new Vector4(0, 0, 0, 1).toBuffer());
+	}
+	
+	private void loadTextures() {
+		for(int tex = 0; tex < NUM_LIGHT_TEXTURES; tex++) {
+			try {
+				ImageSet imageSet = DdsLoader.load(getClass().getResourceAsStream("example17.2." + texDefs[tex][0]));
+				lightTextures[tex] = TextureGenerator.createTexture(imageSet, 0);
+			} catch(Exception exc) {
+				exc.printStackTrace();
+				destroy();
+			}
+		}
+	}
+	
+	private void loadAndSetupScene() throws IOException, XmlPullParserException {
+		scene = new Scene(getClass().getResource("example17.2.scene.xml"), getClass(), "example17.2.");
+		
+		nodes = new ArrayList<>();
+		nodes.add(scene.findNode("cube"));
+		nodes.add(scene.findNode("rightBar"));
+		nodes.add(scene.findNode("leaningBar"));
+		nodes.add(scene.findNode("spinBar"));
+		nodes.add(scene.findNode("diorama"));
+		nodes.add(scene.findNode("floor"));
+		
+		lightNumBinder = new UniformIntBinder();
+		lightProjMatBinder = new UniformMat4Binder();
+		camLightPosBinder = new UniformVec3Binder();
+		
+		for(SceneNode node : nodes) {
+			lightNumBinder.associateWithProgram(node.getProgram(), "numberOfLights");
+			lightProjMatBinder.associateWithProgram(node.getProgram(), "cameraToLightProjMatrix");
+			camLightPosBinder.associateWithProgram(node.getProgram(), "cameraSpaceProjLightPos");
+		}
+		
+		spinBarOrient = nodes.get(3).getOrient();
+		
+		sphereMesh = scene.findMesh("m_sphere");
+		unlit = scene.findProgram("p_unlit");
+		unlitModelToCameraMatrixUniform = glGetUniformLocation(unlit.getProgram(), "modelToCameraMatrix");
+		unlitObjectColorUniform = glGetUniformLocation(unlit.getProgram(), "objectColor");
+		
+		axesMesh = scene.findMesh("m_axes");
+		colored = scene.findProgram("p_colored");
+		coloredModelToCameraMatrixUniform = glGetUniformLocation(colored.getProgram(), "modelToCameraMatrix");
+	}
+	
+	@Override
+	public void resized() {}
+	
+	@Override
+	public void update(long deltaTime) {
+		Utils.updateMousePoles(viewPole, lightViewPole);
+		
+		timer.update(deltaTime);
+		
+		viewPole.charPress(deltaTime);
+		lightViewPole.charPress(deltaTime);
+	}
+	
+	@Override
+	public void keyPressed(int key, char c) {
+		switch(key) {
+			case Keyboard.KEY_SPACE:
+				lightViewPole.reset();
+				break;
+			case Keyboard.KEY_T:
+				drawCameraPos = !drawCameraPos;
+				break;
+			case Keyboard.KEY_G:
+				showOtherLights = !showOtherLights;
+				break;
+			case Keyboard.KEY_H:
+				currSampler = (currSampler + 1) % NUM_SAMPLERS;
+				break;
+			case Keyboard.KEY_P:
+				timer.togglePause();
+				break;
+			case Keyboard.KEY_Y:
+				currFOVIndex = Math.min(currFOVIndex + 1, lightFOVS.length - 1);
+				System.out.println("Curr FOV: " + lightFOVS[currFOVIndex]);
+				break;
+			case Keyboard.KEY_N:
+				currFOVIndex = Math.max(currFOVIndex - 1, 0);
+				System.out.println("Curr FOV: " + lightFOVS[currFOVIndex]);
+				break;
+			case Keyboard.KEY_RETURN:
+				try {
+					loadAndSetupScene();
+				} catch(Exception exc) {
+					exc.printStackTrace();
+					destroy();
+				}
+				break;
+		}
+		
+		int posibleIndex = c - '1';
+		if(posibleIndex >= 0 && posibleIndex < NUM_LIGHT_TEXTURES) {
+			currTextureIndex = posibleIndex;
+			System.out.println(texDefs[currTextureIndex][1]);
+		}
+	}
+	
+	@Override
+	public void render() {
+		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+		
+		Matrix4 cameraMatrix = viewPole.calcMatrix();
+		Matrix4 lightView = lightViewPole.calcMatrix();
+		
+		MatrixStack modelMatrix = new MatrixStack();
+		modelMatrix.setTop(cameraMatrix);
+		
+		buildLights(cameraMatrix);
+		
+		nodes.get(0).setOrient(Utils.angleAxisDeg(360 * timer.getAlpha(), new Vector3(0, 1, 0)));
+		nodes.get(3).setOrient(spinBarOrient.copy().mult(Utils.angleAxisDeg(360 * timer.getAlpha(), new Vector3(0, 0, 1))));
+		
+		{
+			glBindBuffer(GL_UNIFORM_BUFFER, projectionUniformBuffer);
+			glBufferData(GL_UNIFORM_BUFFER, new Matrix4().clearToPerspectiveDeg(60, getWidth(), getHeight(), 1, 1000).toBuffer(), GL_STREAM_DRAW);
+			glBindBuffer(GL_UNIFORM_BUFFER, 0);
+		}
+		
+		glActiveTexture(GL_TEXTURE0 + lightProjectionTexUnit);
+		glBindTexture(GL_TEXTURE_2D, lightTextures[currTextureIndex]);
+		glBindSampler(lightProjectionTexUnit, samplers[currSampler]);
+		
+		{
+			Matrix4 lightProjMatrix = new Matrix4().clearToIdentity();
+			lightProjMatrix.translate(0.5f, 0.5f, 0);
+			lightProjMatrix.scale(0.5f, 0.5f, 1);
+			lightProjMatrix.mult(new Matrix4().clearToPerspectiveDeg(lightFOVS[currFOVIndex], 1, 1, 1, 100));
+			lightProjMatrix.mult(lightView);
+			lightProjMatrix.mult(cameraMatrix.copy().inverse());
+			
+			lightProjMatBinder.setValue(lightProjMatrix);
+			
+			Vector4 worldLightPos = lightView.copy().inverse().getColumn(3);
+			Vector3 lightPos = new Vector3(cameraMatrix.mult(worldLightPos));
+			
+			camLightPosBinder.setValue(lightPos);
+		}
+		
+		glViewport(0, 0, getWidth(), getHeight());
+		scene.render(modelMatrix.getTop());
+		
+		{
+			modelMatrix.pushMatrix();
+			
+			modelMatrix.getTop().mult(lightView.copy().inverse());
+			modelMatrix.getTop().scale(15);
+			modelMatrix.getTop().scale(1, 1, -1);
+			
+			colored.begin();
+			glUniformMatrix4(coloredModelToCameraMatrixUniform, false, modelMatrix.getTop().toBuffer());
+			axesMesh.render();
+			colored.end();
+			
+			modelMatrix.popMatrix();
+		}
+		
+		if(drawCameraPos) {
+			modelMatrix.pushMatrix();
+			modelMatrix.getTop().clearToIdentity();
+			modelMatrix.getTop().translate(0, 0, -viewPole.getView().radius);
+			modelMatrix.getTop().scale(0.5f);
+			
+			unlit.begin();
+			
+			glDisable(GL_DEPTH_TEST);
+			glDepthMask(false);
+			
+			glUniformMatrix4(unlitModelToCameraMatrixUniform, false, modelMatrix.getTop().toBuffer());
+			glUniform4f(unlitObjectColorUniform, 0.25f, 0.25f, 0.25f, 1);
+			sphereMesh.render("flat");
+			
+			glDepthMask(true);
+			glEnable(GL_DEPTH_TEST);
+			
+			glUniform4f(unlitObjectColorUniform, 1, 1, 1, 1);
+			sphereMesh.render("flat");
+			
+			unlit.end();
+			
+			modelMatrix.popMatrix();
+		}
+		
+		glActiveTexture(GL_TEXTURE0 + lightProjectionTexUnit);
+		glBindTexture(GL_TEXTURE_2D, 0);
+		glBindSampler(lightProjectionTexUnit, 0);
+	}
+	
+	private void buildLights(Matrix4 cameraMatrix) {
+		LightBlock lightData = new LightBlock(new Vector4(0.2f, 0.2f, 0.2f, 1), 1f / 900f, 2);
+		lightData.lights[0] = new PerLight(cameraMatrix.mult(new Vector4(-0.2f, 0.5f, 0.5f, 0).normalize()), new Vector4(0.2f, 0.2f, 0.2f, 1));
+		lightData.lights[1] = new PerLight(cameraMatrix.mult(new Vector4(5, 6, 0.5f, 1)), new Vector4(3.5f, 6.5f, 3, 1).mult(0.5f));
+		
+		if(showOtherLights)
+			lightNumBinder.setValue(2);
+		else
+			lightNumBinder.setValue(0);
+		
+		glBindBuffer(GL_UNIFORM_BUFFER, lightUniformBuffer);
+		glBufferData(GL_UNIFORM_BUFFER, lightData.toBuffer(), GL_STREAM_DRAW);
+		glBindBuffer(GL_UNIFORM_BUFFER, 0);
+	}
+	
+	private static class PerLight {
+		private Vector4 cameraSpaceLightPos;
+		private Vector4 lightIntensity;
+		
+		public static final int SIZE = 2 * 4 * 4;
+		
+		public PerLight(Vector4 cameraSpaceLightPos, Vector4 lightIntensity) {
+			this.cameraSpaceLightPos = cameraSpaceLightPos;
+			this.lightIntensity = lightIntensity;
+		}
+		
+		private static final FloatBuffer buffer = BufferUtils.createFloatBuffer(SIZE / 4);
+		
+		public FloatBuffer toBuffer() {
+			buffer.clear();
+			buffer.put(cameraSpaceLightPos.toBuffer());
+			buffer.put(lightIntensity.toBuffer());
+			buffer.flip();
+			return buffer;
+		}
+	}
+	
+	private static class LightBlock {
+		private Vector4 ambientIntensity;
+		private float lightAttenuation;
+		private float maxIntensity;
+		private float[] padding = new float[2];
+		
+		private PerLight[] lights = new PerLight[MAX_NUMBER_OF_LIGHTS];
+		
+		public static final int SIZE = 2 * 4 * 4 + MAX_NUMBER_OF_LIGHTS * PerLight.SIZE;
+		
+		public LightBlock(Vector4 ambientIntensity, float lightAttenuation, float maxIntensity) {
+			this.ambientIntensity = ambientIntensity;
+			this.lightAttenuation = lightAttenuation;
+			this.maxIntensity = maxIntensity;
+		}
+		
+		private static final FloatBuffer buffer = BufferUtils.createFloatBuffer(SIZE / 4);
+		
+		public FloatBuffer toBuffer() {
+			buffer.clear();
+			buffer.put(ambientIntensity.toBuffer());
+			buffer.put(lightAttenuation);
+			buffer.put(maxIntensity);
+			buffer.put(padding);
+			
+			for(PerLight light : lights)
+				if(light != null)
+					buffer.put(light.toBuffer());
+			
+			buffer.flip();
+			
+			return buffer;
+		}
+	}
+}
Add a comment to this file

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Bands.dds

Binary file added.

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Colored.frag

+#version 330
+
+smooth in vec4 objectColor;
+
+out vec4 outputColor;
+
+void main()
+{
+	outputColor = objectColor;
+}

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Colored.vert

+#version 330
+
+layout(std140) uniform;
+
+layout(location = 0) in vec3 position;
+layout(location = 1) in vec4 color;
+
+smooth out vec4 objectColor;
+
+uniform Projection
+{
+	mat4 cameraToClipMatrix;
+};
+
+uniform mat4 modelToCameraMatrix;
+
+void main()
+{
+	gl_Position = cameraToClipMatrix * modelToCameraMatrix * vec4(position, 1.0);
+	objectColor = color;
+}
Add a comment to this file

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.Flashlight.dds

Binary file added.

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.LongBar.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../Documents/meshFormat.rnc" type="compact"?>
+
+<mesh xmlns="http://www.arcsynthesis.com/gltut/mesh">
+	<attribute index="0" type="float" size="3">
+		0.5 0.5 4.5
+		0.5 -0.5 4.5
+		-0.5 -0.5 4.5
+		-0.5 0.5 4.5
+		0.5 0.5 4.5
+		-0.5 0.5 4.5
+		-0.5 0.5 -4.5
+		0.5 0.5 -4.5
+		0.5 0.5 4.5
+		0.5 0.5 -4.5
+		0.5 -0.5 -4.5
+		0.5 -0.5 4.5
+		0.5 0.5 -4.5
+		-0.5 0.5 -4.5
+		-0.5 -0.5 -4.5
+		0.5 -0.5 -4.5
+		0.5 -0.5 4.5
+		0.5 -0.5 -4.5
+		-0.5 -0.5 -4.5
+		-0.5 -0.5 4.5
+		-0.5 0.5 4.5
+		-0.5 -0.5 4.5
+		-0.5 -0.5 -4.5
+		-0.5 0.5 -4.5
+	</attribute>
+	<attribute index="2" type="float" size="3">
+		0 0 1
+		0 0 1
+		0 0 1
+		0 0 1
+		0 1 0
+		0 1 0
+		0 1 0
+		0 1 0
+		1 0 0
+		1 0 0
+		1 0 0
+		1 0 0
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		0 -1 0
+		0 -1 0
+		0 -1 0
+		0 -1 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+	</attribute>
+	<attribute index="5" type="float" size="2">
+		1 1
+		1 0
+		0 0
+		0 1
+		9 1
+		9 0
+		0 0
+		0 1
+		0 1
+		9 1
+		9 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		1 9
+		1 0
+		0 0
+		0 9
+		9 1
+		9 0
+		0 0
+		0 1
+	</attribute>
+	<vao name="lit">
+		<source attrib="0" />
+		<source attrib="2" />
+	</vao>
+	<vao name="lit-tex">
+		<source attrib="0" />
+		<source attrib="2" />
+		<source attrib="5" />
+	</vao>
+	<vao name="tex">
+		<source attrib="0" />
+		<source attrib="5" />
+	</vao>
+	<vao name="flat">
+		<source attrib="0" />
+	</vao>
+	<indices cmd="triangles" type="ushort">
+		0 1 2
+		2 3 0
+		4 5 6
+		6 7 4
+		8 9 10
+		10 11 8
+		12 13 14
+		14 15 12
+		16 17 18
+		18 19 16
+		20 21 22
+		22 23 20
+	</indices>
+</mesh>
Add a comment to this file

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.PointsOfLight.dds

Binary file added.

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.ShortBar.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../Documents/meshFormat.rnc" type="compact"?>
+
+<mesh xmlns="http://www.arcsynthesis.com/gltut/mesh">
+	<attribute index="0" type="float" size="3">
+		0.5 0.5 1.5
+		0.5 -0.5 1.5
+		-0.5 -0.5 1.5
+		-0.5 0.5 1.5
+		0.5 0.5 1.5
+		-0.5 0.5 1.5
+		-0.5 0.5 -1.5
+		0.5 0.5 -1.5
+		0.5 0.5 1.5
+		0.5 0.5 -1.5
+		0.5 -0.5 -1.5
+		0.5 -0.5 1.5
+		0.5 0.5 -1.5
+		-0.5 0.5 -1.5
+		-0.5 -0.5 -1.5
+		0.5 -0.5 -1.5
+		0.5 -0.5 1.5
+		0.5 -0.5 -1.5
+		-0.5 -0.5 -1.5
+		-0.5 -0.5 1.5
+		-0.5 0.5 1.5
+		-0.5 -0.5 1.5
+		-0.5 -0.5 -1.5
+		-0.5 0.5 -1.5
+	</attribute>
+	<attribute index="2" type="float" size="3">
+		0 0 1
+		0 0 1
+		0 0 1
+		0 0 1
+		0 1 0
+		0 1 0
+		0 1 0
+		0 1 0
+		1 0 0
+		1 0 0
+		1 0 0
+		1 0 0
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		0 -1 0
+		0 -1 0
+		0 -1 0
+		0 -1 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+	</attribute>
+	<attribute index="5" type="float" size="2">
+		1 1
+		1 0
+		0 0
+		0 1
+		3 1
+		3 0
+		0 0
+		0 1
+		0 1
+		3 1
+		3 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		1 3
+		1 0
+		0 0
+		0 3
+		3 1
+		3 0
+		0 0
+		0 1
+	</attribute>
+	<vao name="lit">
+		<source attrib="0" />
+		<source attrib="2" />
+	</vao>
+	<vao name="lit-tex">
+		<source attrib="0" />
+		<source attrib="2" />
+		<source attrib="5" />
+	</vao>
+	<vao name="tex">
+		<source attrib="0" />
+		<source attrib="5" />
+	</vao>
+	<vao name="flat">
+		<source attrib="0" />
+	</vao>
+	<indices cmd="triangles" type="ushort">
+		0 1 2
+		2 3 0
+		4 5 6
+		6 7 4
+		8 9 10
+		10 11 8
+		12 13 14
+		14 15 12
+		16 17 18
+		18 19 16
+		20 21 22
+		22 23 20
+	</indices>
+</mesh>

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.UnitAxes.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../Documents/meshFormat.rnc" type="compact"?>
+
+<mesh xmlns="http://www.arcsynthesis.com/gltut/mesh">
+	<attribute index="0" type="float" size="3">
+		0 0 0
+		0.5 0 0
+		0 0 0
+		0 0.5 0
+		0 0 0
+		0 0 0.5
+	</attribute>
+	<attribute index="1" type="float" size="4">
+		1 0 0 1
+		1 0 0 1
+		0 1 0 1
+		0 1 0 1
+		0 0 1 1
+		0 0 1 1
+	</attribute>
+	<arrays cmd="lines" start="0" count="6" />
+</mesh>

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.UnitCube.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../Documents/meshFormat.rnc" type="compact"?>
+
+<mesh xmlns="http://www.arcsynthesis.com/gltut/mesh">
+	<attribute index="0" type="float" size="3">
+		0.5 0.5 0.5
+		0.5 -0.5 0.5
+		-0.5 -0.5 0.5
+		-0.5 0.5 0.5
+		0.5 0.5 0.5
+		-0.5 0.5 0.5
+		-0.5 0.5 -0.5
+		0.5 0.5 -0.5
+		0.5 0.5 0.5
+		0.5 0.5 -0.5
+		0.5 -0.5 -0.5
+		0.5 -0.5 0.5
+		0.5 0.5 -0.5
+		-0.5 0.5 -0.5
+		-0.5 -0.5 -0.5
+		0.5 -0.5 -0.5
+		0.5 -0.5 0.5
+		0.5 -0.5 -0.5
+		-0.5 -0.5 -0.5
+		-0.5 -0.5 0.5
+		-0.5 0.5 0.5
+		-0.5 -0.5 0.5
+		-0.5 -0.5 -0.5
+		-0.5 0.5 -0.5
+	</attribute>
+	<attribute index="1" type="float" size="4">
+		0.25 1 0.25 1
+		0.25 1 0.25 1
+		0.25 1 0.25 1
+		0.25 1 0.25 1
+		0.5 0.5 1 1
+		0.5 0.5 1 1
+		0.5 0.5 1 1
+		0.5 0.5 1 1
+		1 0.5 0.5 1
+		1 0.5 0.5 1
+		1 0.5 0.5 1
+		1 0.5 0.5 1
+		1 1 0.5 1
+		1 1 0.5 1
+		1 1 0.5 1
+		1 1 0.5 1
+		0.5 1 1 1
+		0.5 1 1 1
+		0.5 1 1 1
+		0.5 1 1 1
+		1 0.5 1 1
+		1 0.5 1 1
+		1 0.5 1 1
+		1 0.5 1 1
+	</attribute>
+	<attribute index="2" type="float" size="3">
+		0 0 1
+		0 0 1
+		0 0 1
+		0 0 1
+		0 1 0
+		0 1 0
+		0 1 0
+		0 1 0
+		1 0 0
+		1 0 0
+		1 0 0
+		1 0 0
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		0 -1 0
+		0 -1 0
+		0 -1 0
+		0 -1 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+	</attribute>
+	<attribute index="5" type="float" size="2">
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+	</attribute>
+	<vao name="lit">
+		<source attrib="0" />
+		<source attrib="2" />
+	</vao>
+	<vao name="lit-color">
+		<source attrib="0" />
+		<source attrib="1" />
+		<source attrib="2" />
+	</vao>
+	<vao name="color">
+		<source attrib="0" />
+		<source attrib="1" />
+	</vao>
+	<vao name="lit-tex">
+		<source attrib="0" />
+		<source attrib="2" />
+		<source attrib="5" />
+	</vao>
+	<vao name="lit-color-tex">
+		<source attrib="0" />
+		<source attrib="1" />
+		<source attrib="2" />
+		<source attrib="5" />
+	</vao>
+	<vao name="color-tex">
+		<source attrib="0" />
+		<source attrib="1" />
+		<source attrib="5" />
+	</vao>
+	<vao name="tex">
+		<source attrib="0" />
+		<source attrib="5" />
+	</vao>
+	<vao name="flat">
+		<source attrib="0" />
+	</vao>
+	<indices cmd="triangles" type="ushort">
+		0 1 2
+		2 3 0
+		4 5 6
+		6 7 4
+		8 9 10
+		10 11 8
+		12 13 14
+		14 15 12
+		16 17 18
+		18 19 16
+		20 21 22
+		22 23 20
+	</indices>
+</mesh>

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.UnitDiorama.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../Documents/meshFormat.rnc" type="compact"?>
+
+<mesh xmlns="http://www.arcsynthesis.com/gltut/mesh">
+	<attribute index="0" type="float" size="3">
+		-0.5 -0.5 0.5
+		-0.5 0.5 0.5
+		-0.5 0.5 -0.5
+		-0.5 -0.5 -0.5
+		-0.5 -0.5 -0.5
+		-0.5 0.5 -0.5
+		0.5 0.5 -0.5
+		0.5 -0.5 -0.5
+		0.5 -0.5 -0.5
+		0.5 0.5 -0.5
+		0.5 0.5 0.5
+		0.5 -0.5 0.5
+		-0.5 -0.5 0.5
+		-0.5 0.5 0.5
+		-0.5 0.5 -0.5
+		-0.5 -0.5 -0.5
+		-0.5 -0.5 -0.5
+		-0.5 0.5 -0.5
+		0.5 0.5 -0.5
+		0.5 -0.5 -0.5
+		0.5 -0.5 -0.5
+		0.5 0.5 -0.5
+		0.5 0.5 0.5
+		0.5 -0.5 0.5
+	</attribute>
+	<attribute index="2" type="float" size="3">
+		1 0 0
+		1 0 0
+		1 0 0
+		1 0 0
+		0 0 1
+		0 0 1
+		0 0 1
+		0 0 1
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		-1 0 0
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		0 0 -1
+		1 0 0
+		1 0 0
+		1 0 0
+		1 0 0
+	</attribute>
+	<attribute index="5" type="float" size="2">
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+		0 0
+		0 1
+		1 1
+		1 0
+	</attribute>
+	<vao name="lit">
+		<source attrib="0" />
+		<source attrib="2" />
+	</vao>
+	<vao name="lit-tex">
+		<source attrib="0" />
+		<source attrib="2" />
+		<source attrib="5" />
+	</vao>
+	<vao name="tex">
+		<source attrib="0" />
+		<source attrib="5" />
+	</vao>
+	<vao name="flat">
+		<source attrib="0" />
+	</vao>
+	<indices cmd="triangles" type="ushort">
+		0 1 2
+		2 3 0
+		4 5 6
+		6 7 4
+		8 9 10
+		10 11 8
+		12 15 14
+		14 13 12
+		16 19 18
+		18 17 16
+		20 23 22
+		22 21 20
+	</indices>
+</mesh>

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.UnitPlane.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../Documents/meshFormat.rnc" type="compact"?>
+
+<mesh xmlns="http://www.arcsynthesis.com/gltut/mesh">
+	<attribute index="0" type="float" size="3">
+		0.5 0 -0.5
+		0.5 0 0.5
+		-0.5 0 0.5
+		-0.5 0 -0.5
+		0.5 0 -0.5
+		0.5 0 0.5
+		-0.5 0 0.5
+		-0.5 0 -0.5
+	</attribute>
+	<attribute index="1" type="float" size="4">
+		1 1 1 1
+		1 1 1 1
+		1 1 1 1
+		1 1 1 1
+		1 1 1 1
+		1 1 1 1
+		1 1 1 1
+		1 1 1 1
+	</attribute>
+	<attribute index="2" type="float" size="3">
+		0 1 0
+		0 1 0
+		0 1 0
+		0 1 0
+		0 -1 0
+		0 -1 0
+		0 -1 0
+		0 -1 0
+	</attribute>
+	<attribute index="5" type="float" size="2">
+		1 0
+		1 1
+		0 1
+		0 0
+		1 0
+		1 1
+		0 1
+		0 0
+	</attribute>
+	<vao name="flat">
+		<source attrib="0" />
+	</vao>
+	<vao name="color">
+		<source attrib="0" />
+		<source attrib="1" />
+	</vao>
+	<vao name="lit">
+		<source attrib="0" />
+		<source attrib="2" />
+	</vao>
+	<vao name="lit-color">
+		<source attrib="0" />
+		<source attrib="1" />
+		<source attrib="2" />
+	</vao>
+	<vao name="lit-tex">
+		<source attrib="0" />
+		<source attrib="2" />
+		<source attrib="5" />
+	</vao>
+	<vao name="lit-color-tex">
+		<source attrib="0" />
+		<source attrib="1" />
+		<source attrib="2" />
+		<source attrib="5" />
+	</vao>
+	<indices cmd="triangles" type="ushort">
+		0 1 2
+		2 3 0
+		4 6 5
+		6 4 7
+	</indices>
+</mesh>

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example2/example17.2.UnitSphere.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../Documents/meshFormat.rnc" type="compact"?>
+
+<mesh xmlns="http://www.arcsynthesis.com/gltut/mesh">
+	<attribute index="0" type="float" size="3">
+		0 0.5 0
+		0.17101007166283 0.46984631039295 0
+		0.15622547417872 0.46984631039295 0.069556062480293
+		0.11442807294522 0.46984631039295 0.12708524986075
+		0.052845018353093 0.46984631039295 0.16264024300704
+		-0.017875419994207 0.46984631039295 0.17007326059719
+		-0.085505035831417 0.46984631039295 0.14809906636301
+		-0.13835005418451 0.46984631039295 0.10051719811689
+		-0.16727309129832 0.46984631039295 0.035554993146286
+		-0.16727309129832 0.46984631039295 -0.035554993146286
+		-0.13835005418451 0.46984631039295 -0.10051719811689
+		-0.085505035831417 0.46984631039295 -0.14809906636301
+		-0.017875419994207 0.46984631039295 -0.17007326059719
+		0.052845018353093 0.46984631039295 -0.16264024300704
+		0.11442807294522 0.46984631039295 -0.12708524986075
+		0.15622547417872 0.46984631039295 -0.069556062480293
+		0.32139380484327 0.38302222155949 0
+		0.29360785052904 0.38302222155949 0.13072263728731
+		0.21505443151476 0.38302222155949 0.23884214300977
+		0.099316147583396 0.38302222155949 0.30566367239308
+		-0.033594800524011 0.38302222155949 0.31963317595235
+		-0.16069690242163 0.38302222155949 0.27833519961321
+		-0.26001305000503 0.38302222155949 0.18891053866504
+		-0.31437057909815 0.38302222155949 0.066821529383317
+		-0.31437057909815 0.38302222155949 -0.066821529383317
+		-0.26001305000503 0.38302222155949 -0.18891053866504
+		-0.16069690242163 0.38302222155949 -0.27833519961321
+		-0.033594800524011 0.38302222155949 -0.31963317595235
+		0.099316147583396 0.38302222155949 -0.30566367239308
+		0.21505443151476 0.38302222155949 -0.23884214300977
+		0.29360785052904 0.38302222155949 -0.13072263728731
+		0.43301270189222 0.25 0
+		0.39557678691519 0.25 0.17612213277682
+		0.28974205177823 0.25 0.32179114877719
+		0.13380828366491 0.25 0.41181955177317
+		-0.045262152304168 0.25 0.43064061300439