Jason McKesson avatar Jason McKesson committed a656089

Tut14: Text done.

Comments (0)

Files changed (22)

Documents/Getting Started.xml

         useful to discuss how to get started using OpenGL in your own projects. This discussion will
         assume that you know how to set up a build project in your build system of choice.</para>
     <para>There are two ways to go about it: you can use the framework provided in the download, or
-        you can use whatever tools you wish.</para>
+        you can use whatever tools you wish. I don't advocate using the tutorial framework for any
+        serious application; it was intended to be used for only these tutorials, so it may not
+        serve your needs outside of this particular purpose.</para>
     <section>
         <?dbhtml filename="Started Tutorial Framework.html" ?>
         <title>Tutorial Framework</title>
         </section>
     </section>
     <section>
-        <?dbhtml filename="Started Nature of OpenGL.html" ?>
-        <title>The Nature of OpenGL</title>
-        <para/>
-    </section>
-    <section>
         <?dbhtml filename="Started Necessary Tools.html" ?>
         <title>Necessary Tools</title>
-        <para>In order to use OpenGL, you will need to do two things. You must create a window and
-            attach an OpenGL context to it, and you must load the OpenGL functions for that
-            context.</para>
+        <para>In order to use OpenGL without the framework, you will need to do two things. You must
+            create a window and attach an OpenGL context to it, and you must load the OpenGL
+            functions for that context. There are a number of other tools you may want (vector math,
+            model loading, image loading, etc), but these tools are ones you need if you aren't
+            going to do them manually.</para>
         <section>
             <title>Window and OpenGL Creation</title>
             <para>Windows, displayable surfaces in GUI operating environments, are very
                 updates. It is a C library, so if you are allergic to C-isms, you may wish to avoid
                 it. Work is being done on SDL 1.3, which will apparently have support for mobile
                 platforms. SDL uses the zLib license.</para>
-            <para>SFML is a newer library, which has a C++ API. While SDL is one big library, SFML
-                is more of a choose-your-own package. The base package contains just input and the
-                ability to create a window, while there are other packages that build upon this.
-                Also SFML makes it possible to integrate SFML windows with other GUI toolkits (see
-                below); this makes it easier to build non-gaming applications that use actual GUI
-                tools. SFML uses the zLib license.</para>
+            <para>SFML is a newer library, which has a C++ API. While SDL is one big library (and
+                requires dependencies like DirectX on Windows), SFML is more of a choose-your-own
+                package. The base package contains just input and the ability to create a window,
+                while there are other packages that build upon this. Also SFML makes it possible to
+                integrate SFML windows with other GUI toolkits (see below); this makes it easier to
+                build non-gaming applications that use actual GUI tools. SFML uses the zLib
+                license.</para>
             <para>Allegro is a game-centric multimedia library. Version 5 has native support for
                 OpenGL in its graphics subsystem. It uses a C interface. It also has a number of
                 advanced 2D rendering functions. Allegro uses the <quote>giftware license,</quote>
                     windowing system. Most of them have support for using OpenGL in one or more of
                     their windows.</para>
             </formalpara>
+            <para>Which window creation tools you use are entirely up to you; the possible needs
+                that you might have are well beyond the scope of this book.</para>
         </section>
         <section>
             <title>Function Loading</title>
                 2.6 environment; it is unknown if it works with later Python versions. GL3W is
                 public domain software.</para>
         </section>
+        <section>
+            <title>Initialization</title>
+            <para>Once you have selected your tools of choice, the next step is to make them work.
+                After downloading and compiling them, you will need to register them with your C/C++
+                build tool of choice. On Linux-platforms, you typically have some global registry
+                for these things, but on Windows, things go where you put them.</para>
+            <para/>
+        </section>
     </section>
 </appendix>
Add a comment to this file

Documents/Texturing/Basic Texture.png

Added
New image

Documents/Texturing/GaussianLookup.mathml

+<?xml version="1.0" encoding="UTF-8"?>
+<math xmlns="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <mrow>
+		<mi>F(d)</mi>
+		<mo>=</mo>
+		<msup>
+			<mi>&#x2147;</mi>
+			<mrow>
+				<mo>-</mo>
+				<msup>
+					<mfenced open="(" close=")" separators=",">
+						<mfrac>
+							<mrow>
+								<mi>d</mi>
+							</mrow>
+							<mrow>
+								<mi>m</mi>
+							</mrow>
+						</mfrac>
+					</mfenced>
+					<mn>2</mn>
+				</msup>
+			</mrow>
+		</msup>
+    </mrow>
+</math>
Add a comment to this file

Documents/Texturing/GaussianLookup.svg

Added
New image
+<?xml version="1.0" encoding="utf-8"?>
+<svg:svg xmlns="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" height="20.531892pt" width="61.347277pt" xmlns:svgmath="http://www.grigoriev.ru/svgmath" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 -17.942048 61.347277 20.531892"><svg:metadata><svgmath:metrics top="20.5318917174" axis="6.57421875" baseline="2.58984375" bottom="0.0234375"/></svg:metadata><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="10.333008" font-family="Times New Roman" fill="black">F(d)</svg:text><svg:g transform="translate(23.999352, -3.984375)"><svg:text font-size="12.000000" text-anchor="middle" y="3.984375" x="3.383789" font-family="Times New Roman" fill="black">=</svg:text></svg:g><svg:g transform="translate(34.100266, 0.000000)"><svg:text font-size="12.000000" text-anchor="middle" y="0.000000" x="2.663086" font-family="Times New Roman" font-style="italic" fill="black">e</svg:text><svg:g transform="translate(5.326172, -10.474973)"><svg:text font-size="8.520000" text-anchor="middle" y="2.828906" x="2.402490" font-family="Times New Roman" fill="black">−</svg:text><svg:g transform="translate(4.804980, 0.000000)"><svg:text font-size="12.289951" transform="scale(0.693249, 1)" text-anchor="middle" y="2.934466" x="2.046325" font-family="Times New Roman" fill="black">(</svg:text><svg:g transform="translate(3.253242, 0.000000)"><svg:g transform="translate(1.140625, -0.959712)"><svg:text font-size="8.000000" text-anchor="middle" y="0.000000" x="2.000000" font-family="Times New Roman" font-style="italic" fill="black">d</svg:text></svg:g><svg:g transform="translate(0.416016, 4.401118)"><svg:text font-size="8.000000" text-anchor="middle" y="0.000000" x="2.888672" font-family="Times New Roman" font-style="italic" fill="black">m</svg:text></svg:g><svg:line stroke-width="0.416016" x1="0.000000" x2="6.609375" stroke="black" stroke-linecap="butt" stroke-dasharray="none" y1="0.000000" y2="0.000000" fill="none"/></svg:g><svg:g transform="translate(10.278633, 0.000000)"><svg:text font-size="12.289951" transform="scale(0.693249, 1)" text-anchor="middle" y="2.934466" x="2.046325" font-family="Times New Roman" fill="black">)</svg:text></svg:g><svg:g transform="translate(13.115859, -2.060825)"><svg:text font-size="8.000000" text-anchor="middle" y="0.000000" x="2.000000" font-family="Times New Roman" fill="black">2</svg:text></svg:g></svg:g></svg:g></svg:g></svg:svg>

Documents/Texturing/GenPerspectiveInterpolation.lua

+require "SvgWriter"
+require "vmath"
+require "Viewport"
+require "SubImage"
+require "GridAxis"
+require "_utils"
+
+vec2 = vmath.vec2;
+
+-- Sizing
+local numSubImages = 2;
+local subImageWidth, subImageHeight = 400, 400;
+local subImageSpacing = 100;
+local belowImageSpaceing = 50;
+
+local imageWidth = (subImageWidth * numSubImages) + (subImageSpacing * (numSubImages - 1));
+local imageHeight = subImageHeight + belowImageSpaceing;
+
+local subImageSize = vmath.vec2{subImageWidth, subImageHeight};
+local pointSize = 10
+local circleRadius = subImageWidth / 8
+
+local subImagePositions = {}
+
+for i = 1, numSubImages, 1 do
+	subImagePositions[i] = vmath.vec2{(subImageWidth + subImageSpacing) * (i-1), 0};
+end
+
+local worldWidth = 4;
+local halfWorldWidth = worldWidth / 2;
+local leftWorldOffset = vmath.vec2(0, halfWorldWidth * 0.75)
+local leftWorldVertRange = vmath.vec2(-halfWorldWidth - leftWorldOffset[2], halfWorldWidth -leftWorldOffset[2])
+
+local function TransformPointToLeftWnd(tPoint)
+	if(vmath.vtype(tPoint) == "table") then
+		local ret = {}
+		for i, realPoint in ipairs(tPoint) do
+			ret[i] = TransformPointToLeftWnd(realPoint)
+		end
+		return ret;
+	end
+
+	local final = vmath.vec2(tPoint);
+	final = final + leftWorldOffset;
+	final = final + (halfWorldWidth);
+	final = final * (subImageSize / worldWidth);
+	final = final + subImagePositions[1]
+	return final;
+end
+
+local function TransformPointToRightWnd(tPoint)
+	if(vmath.vtype(tPoint) == "table") then
+		local ret = {}
+		for i, realPoint in ipairs(tPoint) do
+			ret[i] = TransformPointToRightWnd(realPoint)
+		end
+		return ret;
+	end
+
+	local final = vmath.vec2(tPoint);
+	final.y = -final.y
+	final = final + (halfWorldWidth);
+	final = final * (subImageSize / worldWidth);
+	final = final + subImagePositions[2]
+	return final;
+end
+
+local zNear, zFar = -1.0, -3.0;
+local zCenter = (zFar + zNear) / 2;
+local zScale = math.abs(zFar - zNear) / 2;
+
+local function TransformToNDC(tPoint)
+	if(vmath.vtype(tPoint) == "table") then
+		local ret = {}
+		for i, realPoint in ipairs(tPoint) do
+			ret[i] = TransformToNDC(realPoint)
+		end
+		return ret;
+	end
+	
+	local final = vmath.vec2(tPoint);
+	--[[
+	final.y = (final.y - zCenter);
+	final.y = final.y / zScale;
+	final.y = -final.y;
+	
+	final.x = final.x / -(tPoint.y)
+	]]
+	local near, far = -zNear, -zFar;
+	final.y = (final.y * ((far + near)/(near-far))) + ((2 * near * far)/(near-far))
+	final = final / -(tPoint.y)
+	return final;
+end
+
+local function TransformFromNDC(tPoint)
+	if(vmath.vtype(tPoint) == "table") then
+		local ret = {}
+		for i, realPoint in ipairs(tPoint) do
+			ret[i] = TransformFromNDC(realPoint)
+		end
+		return ret;
+	end
+	
+	local ndc = vmath.vec2(tPoint);
+	local near, far = -zNear, -zFar;
+	
+	local alpha = (near + far) / (near - far);
+	local beta = ((2 * near * far)/(near-far));
+	
+	local camY = -beta / (ndc.y + alpha);
+	local camX = ndc.x * -camY;
+	
+	return vmath.vec2(camX, camY);
+end
+
+
+-- Styles
+local styleLib = SvgWriter.StyleLibrary();
+
+styleLib:AddStyle(nil, "black",
+	SvgWriter.Style():stroke("black"):stroke_width("1px"));
+	
+styleLib:AddStyle(nil, "stroke_none",
+	SvgWriter.Style():stroke("none"));
+	
+styleLib:AddStyle(nil, "object_lines",
+	SvgWriter.Style():stroke("#00C000"):stroke_width("1px"):fill("none"));
+	
+styleLib:AddStyle(nil, "object_circles",
+	SvgWriter.Style():fill("#00C000"):stroke("black"):stroke_width("0.5px"));
+	
+styleLib:AddStyle(nil, "middle_lines",
+	SvgWriter.Style():stroke("#800000"):stroke_width("2px"):fill("none"));
+	
+styleLib:AddStyle(nil, "middle_circles",
+	SvgWriter.Style():fill("#800000"):stroke("black"):stroke_width("0.5px"));
+	
+styleLib:AddStyle(nil, "radial_eye",
+	SvgWriter.Style():stroke("black"):stroke_dasharray{3, 3});
+	
+styleLib:AddStyle(nil, "wide_black",
+	SvgWriter.Style():stroke("black"):stroke_width("3px"));
+
+styleLib:AddStyle(nil, "fill_black",
+	SvgWriter.Style():fill("black"));
+	
+styleLib:AddStyle(nil, "fill_frustum",
+	SvgWriter.Style():fill("#E0E0E0"));
+	
+styleLib:AddStyle(nil, "fill_none",
+	SvgWriter.Style():fill("none"));
+	
+styleLib:AddStyle(nil, "text",
+	SvgWriter.Style():font_size("30px"):font_family("monospace") );
+	
+styleLib:AddStyle(nil, "axis_label",
+	SvgWriter.Style():stroke("none"):fill("black"):font_size("30px"):font_family("monospace") );
+	
+styleLib:AddStyle(nil, "image_label",
+	SvgWriter.Style():stroke("none"):fill("black"):font_size("40px"):font_family("serif"):text_anchor("middle") );
+	
+styleLib:AddStyle(nil, "line_label",
+	SvgWriter.Style():stroke("none"):fill("black"):font_size("16pt"):font_family("monospace"):text_anchor("start") );
+	
+styleLib:AddStyle(nil, "pointed",
+	SvgWriter.Style():marker(SvgWriter.uriLocalElement("point")));
+
+styleLib:AddStyle(nil, "arrow_ended",
+	SvgWriter.Style():marker_end(SvgWriter.uriLocalElement("arrow")));
+styleLib:AddStyle(nil, "arrows",
+	SvgWriter.Style():marker_mid(SvgWriter.uriLocalElement("arrow")):marker_end(SvgWriter.uriLocalElement("arrow")));
+styleLib:AddStyle(nil, "double_arrowheaded",
+	SvgWriter.Style():marker_start(SvgWriter.uriLocalElement("arrow")):marker_end(SvgWriter.uriLocalElement("arrow")));
+
+-- Paths and other data.
+
+local arrowWidth, arrowLength = 12, 16;
+
+local arrowheadPath = SvgWriter.Path();
+arrowheadPath:M{arrowLength, arrowWidth / 2}:L{0, 0}:L{0, arrowWidth}:Z();
+
+local leftAxisLocs =
+{
+	vec2(0, 0),
+	vec2(0, leftWorldVertRange[1]),
+	vec2(0, leftWorldVertRange[2]),
+	vec2(-worldWidth/2, 0),
+	vec2(worldWidth/2, 0),
+}
+
+local numAxisHashes = 8
+local leftAxisHashes = {}
+local startPt = leftAxisLocs[2];
+local dir = leftAxisLocs[3] - leftAxisLocs[2]
+local hashSize = worldWidth / 25;
+for i = 1, numAxisHashes - 1 do
+	local leftPt = startPt + (dir * (i / numAxisHashes));
+	local rightPt = vec2(leftPt);
+	if(math.mod(i, 2) == 0) then
+		leftPt.x = leftPt.x + hashSize * 0.75
+		rightPt.x = rightPt.x - hashSize * 0.75
+	else
+		leftPt.x = leftPt.x + hashSize/2
+		rightPt.x = rightPt.x - hashSize/2
+	end
+	leftAxisHashes[#leftAxisHashes + 1] = leftPt;
+	leftAxisHashes[#leftAxisHashes + 1] = rightPt;
+end
+
+startPt = leftAxisLocs[4];
+dir = leftAxisLocs[5] - leftAxisLocs[4]
+for i = 1, numAxisHashes - 1 do
+	local botPt = startPt + (dir * (i / numAxisHashes));
+	local topPt = vec2(botPt);
+	if(math.mod(i, 2) == 0) then
+		botPt.y = botPt.y + hashSize * 0.75
+		topPt.y = topPt.y - hashSize * 0.75
+	else
+		botPt.y = botPt.y + hashSize/2
+		topPt.y = topPt.y - hashSize/2
+	end
+	leftAxisHashes[#leftAxisHashes + 1] = botPt;
+	leftAxisHashes[#leftAxisHashes + 1] = topPt;
+end
+
+leftAxisHashes = TransformPointToLeftWnd(leftAxisHashes);
+leftAxisLocs = TransformPointToLeftWnd(leftAxisLocs);
+
+
+local rightAxisLocs =
+{
+	vec2(0, 0),
+	vec2(0, -worldWidth/2),
+	vec2(0, worldWidth/2),
+	vec2(-worldWidth/2, 0),
+	vec2(worldWidth/2, 0),
+}
+
+local rightAxisHashes = {}
+local startPt = rightAxisLocs[2];
+local dir = rightAxisLocs[3] - rightAxisLocs[2]
+hashSize = worldWidth / 25;
+for i = 1, numAxisHashes - 1 do
+	local leftPt = startPt + (dir * (i / numAxisHashes));
+	local rightPt = vec2(leftPt);
+	if(math.mod(i, 2) == 0) then
+		leftPt.x = leftPt.x + hashSize * 0.75
+		rightPt.x = rightPt.x - hashSize * 0.75
+	else
+		leftPt.x = leftPt.x + hashSize/2
+		rightPt.x = rightPt.x - hashSize/2
+	end
+	rightAxisHashes[#rightAxisHashes + 1] = leftPt;
+	rightAxisHashes[#rightAxisHashes + 1] = rightPt;
+end
+
+startPt = rightAxisLocs[4];
+dir = rightAxisLocs[5] - rightAxisLocs[4]
+for i = 1, numAxisHashes - 1 do
+	local botPt = startPt + (dir * (i / numAxisHashes));
+	local topPt = vec2(botPt);
+	if(math.mod(i, 2) == 0) then
+		botPt.y = botPt.y + hashSize * 0.75
+		topPt.y = topPt.y - hashSize * 0.75
+	else
+		botPt.y = botPt.y + hashSize/2
+		topPt.y = topPt.y - hashSize/2
+	end
+	rightAxisHashes[#rightAxisHashes + 1] = botPt;
+	rightAxisHashes[#rightAxisHashes + 1] = topPt;
+end
+
+rightAxisHashes = TransformPointToRightWnd(rightAxisHashes);
+rightAxisLocs = TransformPointToRightWnd(rightAxisLocs);
+
+
+local function TransformBoth(tPoint)
+	if(vmath.vtype(tPoint) == "table") then
+		local ret = {}
+		for i, realPoint in ipairs(tPoint) do
+			ret[i] = TransformBoth(realPoint)
+		end
+		return ret;
+	end
+
+	local testPtLeft = tPoint;
+	local testPtRight = TransformToNDC(testPtLeft);
+	local wndTestPtLeft = TransformPointToLeftWnd(testPtLeft);
+	local wndTestPtRight = TransformPointToRightWnd(testPtRight);
+	
+	return {wndTestPtLeft, wndTestPtRight, testPtLeft, testPtRight};
+end
+
+local testPts =
+{
+	vec2(1.5, -1.0),
+	vec2(0.5, -1.0),
+
+	vec2(1.5, -1.75),
+	vec2(0.5, -1.75),
+
+	vec2(1.5, -2.5),
+	vec2(0.5, -2.5),
+};
+
+testPts = TransformBoth(testPts)
+
+local numPts = #testPts;
+
+local ndcMiddle =
+{
+	(testPts[1][4] + testPts[numPts - 1][4]) / 2.0,
+	(testPts[2][4] + testPts[numPts][4]) / 2.0,
+};
+
+local camMiddleFromNdc = TransformFromNDC(ndcMiddle);
+
+ndcMiddle = TransformPointToRightWnd(ndcMiddle);
+camMiddleFromNdc = TransformPointToLeftWnd(camMiddleFromNdc);
+
+local leftBlocksPath = SvgWriter.Path();
+local rightBlocksPath = SvgWriter.Path();
+
+for i = 1, #testPts - 2, 2 do
+	leftBlocksPath:M(testPts[i + 2][1]):L(testPts[i][1]):L(testPts[i + 1][1]):L(testPts[i + 3][1]);
+	rightBlocksPath:M(testPts[i + 2][2]):L(testPts[i][2]):L(testPts[i + 1][2]):L(testPts[i + 3][2]);
+end
+
+leftBlocksPath:Z();
+rightBlocksPath:Z();
+
+local frustumPoints =
+{
+	vec2(zNear, zNear),
+	vec2(-zNear, zNear),
+	vec2(worldWidth/2, -worldWidth/2),
+	vec2(worldWidth/2, zFar),
+	vec2(-worldWidth/2, zFar),
+	vec2(-worldWidth/2, -worldWidth/2),
+}
+
+frustumPoints = TransformPointToLeftWnd(frustumPoints);
+
+local leftViewArea = SvgWriter.Path()
+
+leftViewArea:M(frustumPoints[1]);
+
+for i = 2, #frustumPoints do
+	leftViewArea:L(frustumPoints[i]);
+end
+
+leftViewArea:Z();
+
+local rightViewArea = { vec2(-1, -1), vec2(1, 1); }
+rightViewArea = TransformPointToRightWnd(rightViewArea);
+
+local leftOrigin = TransformPointToLeftWnd(vec2(0, 0));
+
+local leftAxisLocations = { vec2(halfWorldWidth, 0), vec2(0, leftWorldVertRange[1]) };
+leftAxisLocations = TransformPointToLeftWnd(leftAxisLocations);
+local rightAxisLocations = { vec2(halfWorldWidth, 0), vec2(0, halfWorldWidth) }
+rightAxisLocations = TransformPointToRightWnd(rightAxisLocations);
+
+local axisLabelPixelOffsets = { vec2(-45, -10), vec2(-50, 30) };
+
+local imageTitleLoc = {vec2(subImageWidth / 2, subImageHeight)}
+imageTitleLoc[2] = imageTitleLoc[1] + vec2(subImageWidth + subImageSpacing, 0)
+local imageTitleOffset = vec2(0, 40)
+
+
+local leftLabelOffset =
+{
+	vmath.vec2(8.0, 4.0),
+	vmath.vec2(8.0, 4.0),
+	vmath.vec2(8.0, 4.0),
+}
+
+local rightLabelOffset =
+{
+	vmath.vec2(8.0, 4.0),
+	vmath.vec2(8.0, 4.0),
+	vmath.vec2(8.0, 4.0),
+}
+
+local leftMiddleOffset = vmath.vec2(8.0, 6.0);
+local rightMiddleOffset = vmath.vec2(9.0, 10.0);
+
+local labels = {"A", "C", "B"};
+
+-- The SVG itself.
+local writer = SvgWriter.SvgWriter(ConstructSVGName(arg[0]), {imageWidth .."px", imageHeight .. "px"});
+	writer:StyleLibrary(styleLib);
+	writer:BeginDefinitions();
+		writer:BeginMarker({pointSize, pointSize}, {pointSize/2, pointSize/2}, "auto", true, nil, "point");
+			writer:Circle({pointSize/2, pointSize/2}, pointSize/2, {"fill_black", "black"});
+		writer:EndMarker();
+		writer:BeginMarker({arrowLength, arrowWidth}, {arrowLength, arrowWidth / 2}, "auto", true, nil, "arrow");
+			writer:Path(arrowheadPath, {"fill_black", "black"});
+		writer:EndMarker();
+	writer:EndDefinitions();
+	
+	--Draw the viewing volumes.
+	writer:Path(leftViewArea, {"stroke_none", "fill_frustum"});
+	writer:Rect2Pt(rightViewArea[1], rightViewArea[2], nil, {"stroke_none", "fill_frustum"});
+	
+	--Draw the eye lines.
+	writer:Line(leftOrigin, frustumPoints[3], {"radial_eye"});
+	writer:Line(leftOrigin, frustumPoints[6], {"radial_eye"});
+	
+	--Draw the coordinate axes.
+	for i, endPt in ipairs(leftAxisLocs) do
+		if(i ~= 1) then
+			writer:Line(leftAxisLocs[1], leftAxisLocs[i], {"black", "arrow_ended"})
+		end
+	end
+	
+	for i = 1, #leftAxisHashes, 2 do
+		writer:Line(leftAxisHashes[i], leftAxisHashes[i+1], {"black"})
+	end
+
+	for i, endPt in ipairs(rightAxisLocs) do
+		if(i ~= 1) then
+			writer:Line(rightAxisLocs[1], rightAxisLocs[i], {"black", "arrow_ended"})
+		end
+	end
+	
+	for i = 1, #rightAxisHashes, 2 do
+		writer:Line(rightAxisHashes[i], rightAxisHashes[i+1], {"black"})
+	end
+
+	--Draw the objects
+	writer:Path(leftBlocksPath, {"object_lines"});
+	writer:Path(rightBlocksPath, {"object_lines"});
+	
+	for i, ptPair in ipairs(testPts) do
+		writer:Circle(ptPair[1], 5, {"object_circles"});
+		writer:Circle(ptPair[2], 5, {"object_circles"});
+	end
+	
+	--Draw the middle.
+	writer:Line(camMiddleFromNdc[1], camMiddleFromNdc[2], {"middle_lines"});
+	writer:Line(ndcMiddle[1], ndcMiddle[2], {"middle_lines"});
+	writer:Circle(camMiddleFromNdc[1], 5, {"middle_circles"});
+	writer:Circle(camMiddleFromNdc[2], 5, {"middle_circles"});
+	writer:Circle(ndcMiddle[1], 5, {"middle_circles"});
+	writer:Circle(ndcMiddle[2], 5, {"middle_circles"});
+	
+	--label the axes.
+	writer:Text("+X", leftAxisLocations[1] + axisLabelPixelOffsets[1], {"axis_label"})
+	writer:Text("-Z", leftAxisLocations[2] + axisLabelPixelOffsets[2], {"axis_label"})
+	writer:Text("+X", rightAxisLocations[1] + axisLabelPixelOffsets[1], {"axis_label"})
+	writer:Text("+Z", rightAxisLocations[2] + axisLabelPixelOffsets[2], {"axis_label"})
+	
+	--label the lines
+	for i = 1, #testPts / 2 do
+		writer:Text(labels[i], testPts[(i * 2) - 1][1] + leftLabelOffset[i], {"line_label"});
+		writer:Text(labels[i], testPts[(i * 2) - 1][2] + rightLabelOffset[i], {"line_label"});
+	end
+	
+	writer:Text("D", ndcMiddle[1] + rightMiddleOffset, {"line_label"});
+	writer:Text("D", camMiddleFromNdc[1] + leftMiddleOffset, {"line_label"});
+	
+
+	--label the images
+	writer:Text("Camera Space", imageTitleLoc[1] + imageTitleOffset, {"image_label"});
+	writer:Text("Norm. Device Coord.", imageTitleLoc[2] + imageTitleOffset, {"image_label"});
+	
+--	writer:Rect(subImagePositions[1], subImageSize, nil, {"black", "fill_none"});
+--	writer:Rect(subImagePositions[2], subImageSize, nil, {"black", "fill_none"});
+--	writer:Rect2Pt(TransformPointToLeftWnd(vmath.vec2(-1, -1)), TransformPointToLeftWnd(vmath.vec2(1, 1)), nil, {"fill_none", "black"});
+	
+writer:Close();
+
+
+
Add a comment to this file

Documents/Texturing/Lookup High Resolution.png

Added
New image
Add a comment to this file

Documents/Texturing/Lookup Low Resolution.png

Added
New image
Add a comment to this file

Documents/Texturing/Lookup Mid Resolution.png

Added
New image
Add a comment to this file

Documents/Texturing/Material Flat Rings.png

Added
New image
Add a comment to this file

Documents/Texturing/Material Texture.png

Added
New image
Add a comment to this file

Documents/Texturing/PerspectiveInterpolation.png

Added
New image
Add a comment to this file

Documents/Texturing/PerspectiveInterpolation.svg

Added
New image
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" height="450px" width="900px" >
+	<style type="text/css" ><![CDATA[.axis_label
+{
+	font-size: 30px;
+	stroke: none;
+	font-family: monospace;
+	fill: black;
+}
+
+.fill_black
+{
+	fill: black;
+}
+
+.arrows
+{
+	marker-end: url(#arrow);
+	marker-mid: url(#arrow);
+}
+
+.fill_frustum
+{
+	fill: #E0E0E0;
+}
+
+.arrow_ended
+{
+	marker-end: url(#arrow);
+}
+
+.middle_lines
+{
+	stroke: #800000;
+	stroke-width: 2px;
+	fill: none;
+}
+
+.object_lines
+{
+	stroke: #00C000;
+	stroke-width: 1px;
+	fill: none;
+}
+
+.wide_black
+{
+	stroke-width: 3px;
+	stroke: black;
+}
+
+.text
+{
+	font-size: 30px;
+	font-family: monospace;
+}
+
+.radial_eye
+{
+	stroke-dasharray: 3,3;
+	stroke: black;
+}
+
+.line_label
+{
+	font-family: monospace;
+	font-size: 16pt;
+	stroke: none;
+	text-anchor: start;
+	fill: black;
+}
+
+.double_arrowheaded
+{
+	marker-end: url(#arrow);
+	marker-start: url(#arrow);
+}
+
+.stroke_none
+{
+	stroke: none;
+}
+
+.fill_none
+{
+	fill: none;
+}
+
+.image_label
+{
+	font-family: serif;
+	font-size: 40px;
+	stroke: none;
+	text-anchor: middle;
+	fill: black;
+}
+
+.middle_circles
+{
+	stroke: black;
+	stroke-width: 0.5px;
+	fill: #800000;
+}
+
+.black
+{
+	stroke-width: 1px;
+	stroke: black;
+}
+
+.pointed
+{
+	marker: url(#point);
+}
+
+.object_circles
+{
+	stroke: black;
+	stroke-width: 0.5px;
+	fill: #00C000;
+}]]></style>
+	<defs >
+		<marker markerWidth="10" markerHeight="10" refX="5" refY="5" markerUnits="userSpaceOnUse" orient="auto" id="point" >
+			<circle r="5" cy="5" cx="5" class="fill_black black" />
+		</marker>
+		<marker markerWidth="16" markerHeight="12" refX="16" refY="6" markerUnits="userSpaceOnUse" orient="auto" id="arrow" >
+			<path d="M 16 6 L 0 0 L 0 12 Z" class="fill_black black" />
+		</marker>
+	</defs>
+	<path d="M 100 250 L 300 250 L 400 150 L 400 50 L 0 50 L 0 150 Z" class="stroke_none fill_frustum" />
+	<rect y="100" x="600" height="200" width="200" class="stroke_none fill_frustum" />
+	<line x2="400" y2="150" y1="350" x1="200" class="radial_eye" />
+	<line x2="0" y2="150" y1="350" x1="200" class="radial_eye" />
+	<line x2="200" y2="0" y1="350" x1="200" class="black arrow_ended" />
+	<line x2="200" y2="400" y1="350" x1="200" class="black arrow_ended" />
+	<line x2="0" y2="350" y1="350" x1="200" class="black arrow_ended" />
+	<line x2="400" y2="350" y1="350" x1="200" class="black arrow_ended" />
+	<line x2="192" y2="50" y1="50" x1="208" class="black" />
+	<line x2="188" y2="100" y1="100" x1="212" class="black" />
+	<line x2="192" y2="150" y1="150" x1="208" class="black" />
+	<line x2="188" y2="200" y1="200" x1="212" class="black" />
+	<line x2="192" y2="250" y1="250" x1="208" class="black" />
+	<line x2="188" y2="300" y1="300" x1="212" class="black" />
+	<line x2="192" y2="350" y1="350" x1="208" class="black" />
+	<line x2="50" y2="342" y1="358" x1="50" class="black" />
+	<line x2="100" y2="338" y1="362" x1="100" class="black" />
+	<line x2="150" y2="342" y1="358" x1="150" class="black" />
+	<line x2="200" y2="338" y1="362" x1="200" class="black" />
+	<line x2="250" y2="342" y1="358" x1="250" class="black" />
+	<line x2="300" y2="338" y1="362" x1="300" class="black" />
+	<line x2="350" y2="342" y1="358" x1="350" class="black" />
+	<line x2="700" y2="400" y1="200" x1="700" class="black arrow_ended" />
+	<line x2="700" y2="0" y1="200" x1="700" class="black arrow_ended" />
+	<line x2="500" y2="200" y1="200" x1="700" class="black arrow_ended" />
+	<line x2="900" y2="200" y1="200" x1="700" class="black arrow_ended" />
+	<line x2="692" y2="350" y1="350" x1="708" class="black" />
+	<line x2="688" y2="300" y1="300" x1="712" class="black" />
+	<line x2="692" y2="250" y1="250" x1="708" class="black" />
+	<line x2="688" y2="200" y1="200" x1="712" class="black" />
+	<line x2="692" y2="150" y1="150" x1="708" class="black" />
+	<line x2="688" y2="100" y1="100" x1="712" class="black" />
+	<line x2="692" y2="50" y1="50" x1="708" class="black" />
+	<line x2="550" y2="208" y1="192" x1="550" class="black" />
+	<line x2="600" y2="212" y1="188" x1="600" class="black" />
+	<line x2="650" y2="208" y1="192" x1="650" class="black" />
+	<line x2="700" y2="212" y1="188" x1="700" class="black" />
+	<line x2="750" y2="208" y1="192" x1="750" class="black" />
+	<line x2="800" y2="212" y1="188" x1="800" class="black" />
+	<line x2="850" y2="208" y1="192" x1="850" class="black" />
+	<path d="M 350 175 L 350 250 L 250 250 L 250 175 M 350 100 L 350 175 L 250 175 L 250 100 Z" class="object_lines" />
+	<path d="M 785.71428571429 171.42857142857 L 850 300 L 750 300 L 728.57142857143 171.42857142857 M 760 120 L 785.71428571429 171.42857142857 L 728.57142857143 171.42857142857 L 720 120 Z" class="object_lines" />
+	<circle r="5" cy="250" cx="350" class="object_circles" />
+	<circle r="5" cy="300" cx="850" class="object_circles" />
+	<circle r="5" cy="250" cx="250" class="object_circles" />
+	<circle r="5" cy="300" cx="750" class="object_circles" />
+	<circle r="5" cy="175" cx="350" class="object_circles" />
+	<circle r="5" cy="171.42857142857" cx="785.71428571429" class="object_circles" />
+	<circle r="5" cy="175" cx="250" class="object_circles" />
+	<circle r="5" cy="171.42857142857" cx="728.57142857143" class="object_circles" />
+	<circle r="5" cy="100" cx="350" class="object_circles" />
+	<circle r="5" cy="120" cx="760" class="object_circles" />
+	<circle r="5" cy="100" cx="250" class="object_circles" />
+	<circle r="5" cy="120" cx="720" class="object_circles" />
+	<line x2="250" y2="207.14285714286" y1="207.14285714286" x1="350" class="middle_lines" />
+	<line x2="735" y2="210" y1="210" x1="805" class="middle_lines" />
+	<circle r="5" cy="207.14285714286" cx="350" class="middle_circles" />
+	<circle r="5" cy="207.14285714286" cx="250" class="middle_circles" />
+	<circle r="5" cy="210" cx="805" class="middle_circles" />
+	<circle r="5" cy="210" cx="735" class="middle_circles" />
+	<text y="340" x="355" class="axis_label" >+X</text>
+	<text y="30" x="150" class="axis_label" >-Z</text>
+	<text y="190" x="855" class="axis_label" >+X</text>
+	<text y="30" x="650" class="axis_label" >+Z</text>
+	<text y="254" x="358" class="line_label" >A</text>
+	<text y="304" x="858" class="line_label" >A</text>
+	<text y="179" x="358" class="line_label" >C</text>
+	<text y="175.42857142857" x="793.71428571429" class="line_label" >C</text>
+	<text y="104" x="358" class="line_label" >B</text>
+	<text y="124" x="768" class="line_label" >B</text>
+	<text y="220" x="814" class="line_label" >D</text>
+	<text y="213.14285714286" x="358" class="line_label" >D</text>
+	<text y="440" x="200" class="image_label" >Camera Space</text>
+	<text y="440" x="700" class="image_label" >Norm. Device Coord.</text>
+</svg>

Documents/Texturing/SamplerBindingDiagram.graphml

+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
+  <!--Created by yFiles for Java HEAD-Current-->
+  <key for="graphml" id="d0" yfiles.type="resources"/>
+  <key for="port" id="d1" yfiles.type="portgraphics"/>
+  <key for="port" id="d2" yfiles.type="portgeometry"/>
+  <key for="port" id="d3" yfiles.type="portuserdata"/>
+  <key attr.name="url" attr.type="string" for="node" id="d4"/>
+  <key attr.name="description" attr.type="string" for="node" id="d5"/>
+  <key for="node" id="d6" yfiles.type="nodegraphics"/>
+  <key attr.name="Description" attr.type="string" for="graph" id="d7"/>
+  <key attr.name="url" attr.type="string" for="edge" id="d8"/>
+  <key attr.name="description" attr.type="string" for="edge" id="d9"/>
+  <key for="edge" id="d10" yfiles.type="edgegraphics"/>
+  <graph edgedefault="directed" id="G">
+    <data key="d7"/>
+    <node id="n0" yfiles.foldertype="group">
+      <data key="d6">
+        <y:ProxyAutoBoundsNode>
+          <y:Realizers active="0">
+            <y:GroupNode>
+              <y:Geometry height="148.40234375" width="340.0" x="28.0" y="7.59765625"/>
+              <y:Fill color="#E3D6FF" transparent="false"/>
+              <y:BorderStyle color="#666699" type="dotted" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="node_width" backgroundColor="#E3D6FF" borderDistance="0.0" fontFamily="Serif" fontSize="24" fontStyle="plain" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="t" textColor="#000000" visible="true" width="340.0" x="0.0" y="0.0">Program Object</y:NodeLabel>
+              <y:Shape type="roundrectangle"/>
+              <y:State closed="false" innerGraphDisplayEnabled="false"/>
+              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+              <y:BorderInsets bottom="17" bottomF="17.0" left="0" leftF="0.0" right="28" rightF="28.0" top="0" topF="0.0"/>
+            </y:GroupNode>
+            <y:GroupNode>
+              <y:Geometry height="80.0" width="100.0" x="-50.0" y="-30.0"/>
+              <y:Fill color="#CAECFF84" transparent="false"/>
+              <y:BorderStyle color="#666699" type="dotted" width="1.0"/>
+              <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#99CCFF" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="22.37646484375" modelName="internal" modelPosition="t" textColor="#000000" visible="true" width="100.0" x="0.0" y="0.0">Folder 2</y:NodeLabel>
+              <y:Shape type="roundrectangle"/>
+              <y:State closed="true" innerGraphDisplayEnabled="false"/>
+              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+              <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+            </y:GroupNode>
+          </y:Realizers>
+        </y:ProxyAutoBoundsNode>
+      </data>
+      <graph edgedefault="directed" id="n0:">
+        <node id="n0::n0">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="282.0" x="43.0" y="56.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="2.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="20" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="28.501953125" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="248.375" x="16.8125" y="2.7490234375">uniform sampler1D texName1</y:NodeLabel>
+              <y:Shape type="roundrectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n0::n1">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="282.0" x="43.0" y="90.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="2.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="20" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="28.501953125" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="248.375" x="16.8125" y="2.7490234375">uniform sampler2D texName2</y:NodeLabel>
+              <y:Shape type="roundrectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+      </graph>
+    </node>
+    <node id="n1" yfiles.foldertype="group">
+      <data key="d6">
+        <y:ProxyAutoBoundsNode>
+          <y:Realizers active="0">
+            <y:GroupNode>
+              <y:Geometry height="116.203125" width="618.0000000000001" x="124.99999999999993" y="289.0"/>
+              <y:Fill color="#FFFFCC" transparent="false"/>
+              <y:BorderStyle color="#666699" type="dotted" width="1.0"/>
+              <y:NodeLabel alignment="left" autoSizePolicy="node_width" backgroundColor="#FFFFCC" borderDistance="0.0" fontFamily="Serif" fontSize="32" fontStyle="plain" hasLineColor="false" height="43.203125" modelName="internal" modelPosition="bl" textColor="#000000" visible="true" width="618.0000000000001" x="0.0" y="73.0">Texture Image Units</y:NodeLabel>
+              <y:Shape type="roundrectangle"/>
+              <y:State closed="false" innerGraphDisplayEnabled="false"/>
+              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+              <y:BorderInsets bottom="0" bottomF="0.0" left="64" leftF="64.00000000000001" right="50" rightF="50.0" top="9" topF="9.0"/>
+            </y:GroupNode>
+            <y:GroupNode>
+              <y:Geometry height="80.0" width="100.0" x="209.0" y="319.0"/>
+              <y:Fill color="#CAECFF84" transparent="false"/>
+              <y:BorderStyle color="#666699" type="dotted" width="1.0"/>
+              <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#99CCFF" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="22.37646484375" modelName="internal" modelPosition="t" textColor="#000000" visible="true" width="100.0" x="0.0" y="0.0">Folder 1</y:NodeLabel>
+              <y:Shape type="roundrectangle"/>
+              <y:State closed="true" innerGraphDisplayEnabled="false"/>
+              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+              <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+            </y:GroupNode>
+          </y:Realizers>
+        </y:ProxyAutoBoundsNode>
+      </data>
+      <graph edgedefault="directed" id="n1:">
+        <node id="n1::n0">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="79.0" x="203.99999999999994" y="313.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#FF0000" visible="true" width="16.0" x="31.5" y="0.298828125">0</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n1::n1">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="79.0" x="282.99999999999994" y="313.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#FF0000" visible="true" width="16.0" x="31.5" y="0.298828125">1</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n1::n2">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="79.0" x="361.99999999999994" y="313.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#FF0000" visible="true" width="16.0" x="31.5" y="0.298828125">2</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n1::n3">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="79.0" x="440.99999999999994" y="313.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#FF0000" visible="true" width="16.0" x="31.5" y="0.298828125">3</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n1::n4">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="79.0" x="520.0" y="313.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#FF0000" visible="true" width="16.0" x="31.5" y="0.298828125">4</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n1::n5">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="79.0" x="599.0" y="313.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#FF0000" visible="true" width="22.0" x="28.5" y="0.298828125">...</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+      </graph>
+    </node>
+    <node id="n2">
+      <data key="d4"/>
+      <data key="d6">
+        <y:ShapeNode>
+          <y:Geometry height="60.09139784946228" width="183.0" x="578.0" y="26.506258400537718"/>
+          <y:Fill color="#CCFFCC" transparent="false"/>
+          <y:BorderStyle color="#000000" type="line" width="1.0"/>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="148.59765625" x="17.201171875" y="13.344527049731141">Texture Object</y:NodeLabel>
+          <y:Shape type="hexagon"/>
+        </y:ShapeNode>
+      </data>
+    </node>
+    <node id="n3">
+      <data key="d5"/>
+      <data key="d6">
+        <y:ShapeNode>
+          <y:Geometry height="60.09139784946228" width="183.0" x="578.0" y="198.55167873601044"/>
+          <y:Fill color="#FFFF99" transparent="false"/>
+          <y:BorderStyle color="#000000" type="line" width="1.0"/>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="153.953125" x="14.5234375" y="13.344527049731141">Sampler Object</y:NodeLabel>
+          <y:Shape type="rectangle"/>
+        </y:ShapeNode>
+      </data>
+    </node>
+    <edge id="e0" source="n2" target="n1::n1">
+      <data key="d10">
+        <y:PolyLineEdge>
+          <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0">
+            <y:Point x="669.5" y="172.0"/>
+            <y:Point x="322.49999999999994" y="172.0"/>
+          </y:Path>
+          <y:LineStyle color="#000000" type="line" width="1.0"/>
+          <y:Arrows source="none" target="standard"/>
+          <y:EdgeLabel alignment="center" distance="2.0" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="62.8046875" modelName="six_pos" modelPosition="head" preferredPlacement="target" ratio="0.5" textColor="#000000" visible="true" width="177.25" x="-262.125" y="20.62574005126953">glActiveTexture()
+glBindTexture()</y:EdgeLabel>
+          <y:BendStyle smoothed="false"/>
+        </y:PolyLineEdge>
+      </data>
+    </edge>
+    <edge id="e1" source="n1::n1" target="n0::n0">
+      <data key="d10">
+        <y:PolyLineEdge>
+          <y:Path sx="-16.0" sy="-7.0" tx="0.0" ty="0.0">
+            <y:Point x="306.49999999999994" y="219.0"/>
+            <y:Point x="9.333333333333332" y="219.0"/>
+            <y:Point x="9.333333333333332" y="73.298828125"/>
+          </y:Path>
+          <y:LineStyle color="#FF0000" type="dashed" width="1.0"/>
+          <y:Arrows source="none" target="standard"/>
+          <y:EdgeLabel alignment="center" distance="2.0" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="six_pos" modelPosition="head" preferredPlacement="anywhere" ratio="0.5" textColor="#FF0000" visible="true" width="181.97265625" x="-239.56966145833337" y="-129.423828125">glUniform1i(..., 1)</y:EdgeLabel>
+          <y:BendStyle smoothed="false"/>
+        </y:PolyLineEdge>
+      </data>
+    </edge>
+    <edge id="e2" source="n3" target="n1::n1">
+      <data key="d10">
+        <y:PolyLineEdge>
+          <y:Path sx="0.0" sy="0.0" tx="18.70759271450521" ty="-15.797783629580863">
+            <y:Point x="341.20759271450515" y="228.59737766074159"/>
+          </y:Path>
+          <y:LineStyle color="#008000" type="line" width="1.0"/>
+          <y:Arrows source="none" target="standard"/>
+          <y:EdgeLabel alignment="center" distance="2.0" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="six_pos" modelPosition="tail" preferredPlacement="anywhere" ratio="0.5" textColor="#008000" visible="true" width="165.30859375" x="-205.61300051774742" y="1.9999960689447107">glBindSampler()</y:EdgeLabel>
+          <y:BendStyle smoothed="false"/>
+        </y:PolyLineEdge>
+      </data>
+    </edge>
+  </graph>
+  <data key="d0">
+    <y:Resources/>
+  </data>
+</graphml>
Add a comment to this file

Documents/Texturing/SamplerBindingDiagram.svg

Added
New image
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill-opacity="1" color-rendering="auto" color-interpolation="auto" stroke="black" text-rendering="auto" stroke-linecap="square" width="782" stroke-miterlimit="10" stroke-opacity="1" shape-rendering="auto" fill="black" stroke-dasharray="none" font-weight="normal" stroke-width="1" height="429" font-family="'Dialog'" font-style="normal" stroke-linejoin="miter" font-size="12" stroke-dashoffset="0" image-rendering="auto">
+  <!--Generated by ySVG-->
+  <defs id="genericDefs"/>
+  <g>
+    <defs id="defs1">
+      <clipPath clipPathUnits="userSpaceOnUse" id="clipPath1">
+        <path d="M0 0 L782 0 L782 429 L0 429 L0 0 Z"/>
+      </clipPath>
+      <clipPath clipPathUnits="userSpaceOnUse" id="clipPath2">
+        <path d="M-6 -8 L776 -8 L776 421 L-6 421 L-6 -8 Z"/>
+      </clipPath>
+      <clipPath clipPathUnits="userSpaceOnUse" id="clipPath3">
+        <path d="M-6 -8.5977 L776 -8.5977 L776 420.4023 L-6 420.4023 L-6 -8.5977 Z"/>
+      </clipPath>
+      <clipPath clipPathUnits="userSpaceOnUse" id="clipPath4">
+        <path d="M-7 -8 L775 -8 L775 421 L-7 421 L-7 -8 Z"/>
+      </clipPath>
+    </defs>
+    <g fill="rgb(227,214,255)" transform="matrix(1,0,0,1,6,8)" stroke="rgb(227,214,255)">
+      <rect x="28" y="7.5977" clip-path="url(#clipPath2)" width="340" rx="4" ry="4" height="148.4023" stroke="none"/>
+    </g>
+    <g fill="rgb(227,214,255)" transform="matrix(1,0,0,1,6,8)" stroke="rgb(227,214,255)">
+      <rect x="28" width="340" height="33.4023" y="7.5977" clip-path="url(#clipPath2)" stroke="none"/>
+    </g>
+    <g font-family="serif" font-size="24" transform="matrix(1,0,0,1,6,8)">
+      <text x="121.6875" xml:space="preserve" y="33.7266" clip-path="url(#clipPath2)" stroke="none">Program Object</text>
+    </g>
+    <g fill="rgb(227,214,255)" transform="matrix(1,0,0,1,6,8) translate(0,0.5977)" stroke="rgb(227,214,255)">
+      <image x="31" y="10" clip-path="url(#clipPath3)" width="16" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAbUlEQVR42mOMi4v7&#13;&#10;z0AmaG9vZ2ABMRYuXEiy5h07djBISUlBDACBZ8+ekWTA8uXLGTw8PBiYGCgEw8AA&#13;&#10;FnQBaWlpvBqePn1KmQtAUYfXBSAb0BWR5AVS08RwiUZQxgClbbIMAGVJUKiDMgY5&#13;&#10;AAAckR2JbOwokAAAAABJRU5ErkJggg==" height="16" preserveAspectRatio="none"/>
+    </g>
+    <g stroke-linecap="round" transform="matrix(1,0,0,1,6,8)" stroke-dashoffset="2" fill="rgb(102,102,153)" stroke-dasharray="0,4" stroke="rgb(102,102,153)" stroke-miterlimit="1.45">
+      <rect x="28" y="7.5977" clip-path="url(#clipPath2)" fill="none" width="340" rx="4" ry="4" height="148.4023"/>
+    </g>
+    <g fill="rgb(102,102,153)" transform="matrix(1,0,0,1,6,8) translate(0,0.5977)" stroke="rgb(102,102,153)">
+      <image x="31" y="10" clip-path="url(#clipPath3)" width="16" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAbUlEQVR42mOMi4v7&#13;&#10;z0AmaG9vZ2ABMRYuXEiy5h07djBISUlBDACBZ8+ekWTA8uXLGTw8PBiYGCgEw8AA&#13;&#10;FnQBaWlpvBqePn1KmQtAUYfXBSAb0BWR5AVS08RwiUZQxgClbbIMAGVJUKiDMgY5&#13;&#10;AAAckR2JbOwokAAAAABJRU5ErkJggg==" height="16" preserveAspectRatio="none"/>
+    </g>
+    <g font-family="serif" font-size="20" transform="matrix(1,0,0,1,6,8)">
+      <text x="61.8125" xml:space="preserve" y="80.8564" clip-path="url(#clipPath2)" stroke="none">uniform sampler1D texName1</text>
+    </g>
+    <g stroke-width="2" stroke-miterlimit="1.45" transform="matrix(1,0,0,1,6,8)" stroke-linecap="butt">
+      <rect x="43" y="56" clip-path="url(#clipPath2)" fill="none" width="282" rx="4" ry="4" height="34"/>
+    </g>
+    <g font-family="serif" font-size="20" transform="matrix(1,0,0,1,6,8)">
+      <text x="61.8125" xml:space="preserve" y="114.8564" clip-path="url(#clipPath2)" stroke="none">uniform sampler2D texName2</text>
+    </g>
+    <g stroke-width="2" stroke-miterlimit="1.45" transform="matrix(1,0,0,1,6,8)" stroke-linecap="butt">
+      <rect x="43" y="90" clip-path="url(#clipPath2)" fill="none" width="282" rx="4" ry="4" height="34"/>
+    </g>
+    <g fill="rgb(255,255,204)" transform="matrix(1,0,0,1,6,8)" stroke="rgb(255,255,204)">
+      <rect x="125" y="289" clip-path="url(#clipPath2)" width="618" rx="4" ry="4" height="116.2031" stroke="none"/>
+      <rect x="125" width="618" height="43.2031" y="362" clip-path="url(#clipPath2)" stroke="none"/>
+    </g>
+    <g font-family="serif" font-size="32" transform="matrix(1,0,0,1,6,8)">
+      <text x="127" xml:space="preserve" y="396.1719" clip-path="url(#clipPath2)" stroke="none">Texture Image Units</text>
+    </g>
+    <g fill="rgb(255,255,204)" transform="matrix(1,0,0,1,6,8) translate(1,0)" stroke="rgb(255,255,204)">
+      <image x="127" y="292" clip-path="url(#clipPath4)" width="16" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAbUlEQVR42mOMi4v7&#13;&#10;z0AmaG9vZ2ABMRYuXEiy5h07djBISUlBDACBZ8+ekWTA8uXLGTw8PBiYGCgEw8AA&#13;&#10;FnQBaWlpvBqePn1KmQtAUYfXBSAb0BWR5AVS08RwiUZQxgClbbIMAGVJUKiDMgY5&#13;&#10;AAAckR2JbOwokAAAAABJRU5ErkJggg==" height="16" preserveAspectRatio="none"/>
+    </g>
+    <g stroke-linecap="round" transform="matrix(1,0,0,1,6,8)" stroke-dashoffset="2" fill="rgb(102,102,153)" stroke-dasharray="0,4" stroke="rgb(102,102,153)" stroke-miterlimit="1.45">
+      <rect x="125" y="289" clip-path="url(#clipPath2)" fill="none" width="618" rx="4" ry="4" height="116.2031"/>
+    </g>
+    <g fill="rgb(102,102,153)" transform="matrix(1,0,0,1,6,8) translate(1,0)" stroke="rgb(102,102,153)">
+      <image x="127" y="292" clip-path="url(#clipPath4)" width="16" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAbUlEQVR42mOMi4v7&#13;&#10;z0AmaG9vZ2ABMRYuXEiy5h07djBISUlBDACBZ8+ekWTA8uXLGTw8PBiYGCgEw8AA&#13;&#10;FnQBaWlpvBqePn1KmQtAUYfXBSAb0BWR5AVS08RwiUZQxgClbbIMAGVJUKiDMgY5&#13;&#10;AAAckR2JbOwokAAAAABJRU5ErkJggg==" height="16" preserveAspectRatio="none"/>
+    </g>
+    <g fill="red" font-size="24" font-family="serif" transform="matrix(1,0,0,1,6,8)" stroke="red">
+      <text x="237.5" xml:space="preserve" y="339.4277" clip-path="url(#clipPath2)" stroke="none">0</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <rect fill="none" x="204" width="79" height="34" y="313" clip-path="url(#clipPath2)"/>
+    </g>
+    <g fill="red" font-size="24" font-family="serif" transform="matrix(1,0,0,1,6,8)" stroke="red">
+      <text x="316.5" xml:space="preserve" y="339.4277" clip-path="url(#clipPath2)" stroke="none">1</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <rect fill="none" x="283" width="79" height="34" y="313" clip-path="url(#clipPath2)"/>
+    </g>
+    <g fill="red" font-size="24" font-family="serif" transform="matrix(1,0,0,1,6,8)" stroke="red">
+      <text x="395.5" xml:space="preserve" y="339.4277" clip-path="url(#clipPath2)" stroke="none">2</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <rect fill="none" x="362" width="79" height="34" y="313" clip-path="url(#clipPath2)"/>
+    </g>
+    <g fill="red" font-size="24" font-family="serif" transform="matrix(1,0,0,1,6,8)" stroke="red">
+      <text x="474.5" xml:space="preserve" y="339.4277" clip-path="url(#clipPath2)" stroke="none">3</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <rect fill="none" x="441" width="79" height="34" y="313" clip-path="url(#clipPath2)"/>
+    </g>
+    <g fill="red" font-size="24" font-family="serif" transform="matrix(1,0,0,1,6,8)" stroke="red">
+      <text x="553.5" xml:space="preserve" y="339.4277" clip-path="url(#clipPath2)" stroke="none">4</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <rect fill="none" x="520" width="79" height="34" y="313" clip-path="url(#clipPath2)"/>
+    </g>
+    <g fill="red" font-size="24" font-family="serif" transform="matrix(1,0,0,1,6,8)" stroke="red">
+      <text x="629.5" xml:space="preserve" y="339.4277" clip-path="url(#clipPath2)" stroke="none">...</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <rect fill="none" x="599" width="79" height="34" y="313" clip-path="url(#clipPath2)"/>
+    </g>
+    <g fill="rgb(204,255,204)" transform="matrix(1,0,0,1,6,8)" stroke="rgb(204,255,204)">
+      <path d="M578 56.552 L596.3 26.5063 L742.7 26.5063 L761 56.552 L742.7 86.5977 L596.3 86.5977 Z" clip-path="url(#clipPath2)" fill-rule="evenodd" stroke="none"/>
+    </g>
+    <g font-family="serif" font-size="24" transform="matrix(1,0,0,1,6,8)">
+      <text x="597.2012" xml:space="preserve" y="65.9797" clip-path="url(#clipPath2)" stroke="none">Texture Object</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <path fill="none" d="M578 56.552 L596.3 26.5063 L742.7 26.5063 L761 56.552 L742.7 86.5977 L596.3 86.5977 Z" fill-rule="evenodd" clip-path="url(#clipPath2)"/>
+    </g>
+    <g fill="rgb(255,255,153)" transform="matrix(1,0,0,1,6,8)" stroke="rgb(255,255,153)">
+      <rect x="578" width="183" height="60.0914" y="198.5517" clip-path="url(#clipPath2)" stroke="none"/>
+    </g>
+    <g font-family="serif" font-size="24" transform="matrix(1,0,0,1,6,8)">
+      <text x="594.5234" xml:space="preserve" y="238.0251" clip-path="url(#clipPath2)" stroke="none">Sampler Object</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <rect fill="none" x="578" width="183" height="60.0914" y="198.5517" clip-path="url(#clipPath2)"/>
+      <path fill="none" stroke-dasharray="6,2" d="M306.5 313.0215 L306.5 219 L9.3333 219 L9.3333 73.2988 L34.9789 73.255" clip-path="url(#clipPath2)" stroke="red"/>
+      <path fill="red" stroke-dasharray="6,2" d="M42.9788 73.2413 L30.9703 68.2618 L33.9789 73.2567 L30.9874 78.2618 Z" clip-path="url(#clipPath2)" stroke="none"/>
+    </g>
+    <g font-size="24" stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" fill="red" font-family="serif" stroke-dasharray="6,2" stroke="red" stroke-miterlimit="1.45">
+      <text x="68.9303" xml:space="preserve" y="209.7266" clip-path="url(#clipPath2)" stroke="none">glUniform1i(..., 1)</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <path fill="none" d="M669.5 86.5696 L669.5 172 L322.5 172 L322.5 305" clip-path="url(#clipPath2)"/>
+      <path d="M322.5 313 L327.5 301 L322.5 304 L317.5 301 Z" clip-path="url(#clipPath2)" stroke="none"/>
+      <text x="409.375" font-size="24" y="133.3242" clip-path="url(#clipPath2)" font-family="serif" stroke="none" xml:space="preserve">glActiveTexture()</text>
+      <text x="418.0234" font-size="24" y="162.7266" clip-path="url(#clipPath2)" font-family="serif" stroke="none" xml:space="preserve">glBindTexture()</text>
+      <path fill="none" d="M578 228.5974 L341.2076 228.5974 L341.2076 304.9901" clip-path="url(#clipPath2)" stroke="green"/>
+      <path fill="green" d="M341.2076 312.9901 L346.2076 300.9901 L341.2076 303.9901 L336.2076 300.9901 Z" clip-path="url(#clipPath2)" stroke="none"/>
+    </g>
+    <g font-size="24" stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" fill="green" font-family="serif" stroke="green" stroke-miterlimit="1.45">
+      <text x="374.387" xml:space="preserve" y="256.7263" clip-path="url(#clipPath2)" stroke="none">glBindSampler()</text>
+    </g>
+  </g>
+</svg>

Documents/Texturing/TextureBindingDiagram.graphml

+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
+  <!--Created by yFiles for Java HEAD-Current-->
+  <key for="graphml" id="d0" yfiles.type="resources"/>
+  <key for="port" id="d1" yfiles.type="portgraphics"/>
+  <key for="port" id="d2" yfiles.type="portgeometry"/>
+  <key for="port" id="d3" yfiles.type="portuserdata"/>
+  <key attr.name="url" attr.type="string" for="node" id="d4"/>
+  <key attr.name="description" attr.type="string" for="node" id="d5"/>
+  <key for="node" id="d6" yfiles.type="nodegraphics"/>
+  <key attr.name="Description" attr.type="string" for="graph" id="d7"/>
+  <key attr.name="url" attr.type="string" for="edge" id="d8"/>
+  <key attr.name="description" attr.type="string" for="edge" id="d9"/>
+  <key for="edge" id="d10" yfiles.type="edgegraphics"/>
+  <graph edgedefault="directed" id="G">
+    <data key="d7"/>
+    <node id="n0" yfiles.foldertype="group">
+      <data key="d6">
+        <y:ProxyAutoBoundsNode>
+          <y:Realizers active="0">
+            <y:GroupNode>
+              <y:Geometry height="148.40234375" width="340.0" x="28.0" y="7.59765625"/>
+              <y:Fill color="#E3D6FF" transparent="false"/>
+              <y:BorderStyle color="#666699" type="dotted" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="node_width" backgroundColor="#E3D6FF" borderDistance="0.0" fontFamily="Serif" fontSize="24" fontStyle="plain" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="t" textColor="#000000" visible="true" width="340.0" x="0.0" y="0.0">Program Object</y:NodeLabel>
+              <y:Shape type="roundrectangle"/>
+              <y:State closed="false" innerGraphDisplayEnabled="false"/>
+              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+              <y:BorderInsets bottom="17" bottomF="17.0" left="0" leftF="0.0" right="28" rightF="28.0" top="0" topF="0.0"/>
+            </y:GroupNode>
+            <y:GroupNode>
+              <y:Geometry height="80.0" width="100.0" x="-50.0" y="-30.0"/>
+              <y:Fill color="#CAECFF84" transparent="false"/>
+              <y:BorderStyle color="#666699" type="dotted" width="1.0"/>
+              <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#99CCFF" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="22.37646484375" modelName="internal" modelPosition="t" textColor="#000000" visible="true" width="100.0" x="0.0" y="0.0">Folder 2</y:NodeLabel>
+              <y:Shape type="roundrectangle"/>
+              <y:State closed="true" innerGraphDisplayEnabled="false"/>
+              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+              <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+            </y:GroupNode>
+          </y:Realizers>
+        </y:ProxyAutoBoundsNode>
+      </data>
+      <graph edgedefault="directed" id="n0:">
+        <node id="n0::n0">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="282.0" x="43.0" y="56.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="2.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="20" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="28.501953125" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="248.375" x="16.8125" y="2.7490234375">uniform sampler1D texName1</y:NodeLabel>
+              <y:Shape type="roundrectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n0::n1">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="282.0" x="43.0" y="90.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="2.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="20" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="28.501953125" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="248.375" x="16.8125" y="2.7490234375">uniform sampler2D texName2</y:NodeLabel>
+              <y:Shape type="roundrectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+      </graph>
+    </node>
+    <node id="n1" yfiles.foldertype="group">
+      <data key="d6">
+        <y:ProxyAutoBoundsNode>
+          <y:Realizers active="0">
+            <y:GroupNode>
+              <y:Geometry height="116.203125" width="618.0000000000001" x="124.99999999999993" y="289.0"/>
+              <y:Fill color="#FFFFCC" transparent="false"/>
+              <y:BorderStyle color="#666699" type="dotted" width="1.0"/>
+              <y:NodeLabel alignment="left" autoSizePolicy="node_width" backgroundColor="#FFFFCC" borderDistance="0.0" fontFamily="Serif" fontSize="32" fontStyle="plain" hasLineColor="false" height="43.203125" modelName="internal" modelPosition="bl" textColor="#000000" visible="true" width="618.0000000000001" x="0.0" y="73.0">Texture Image Units</y:NodeLabel>
+              <y:Shape type="roundrectangle"/>
+              <y:State closed="false" innerGraphDisplayEnabled="false"/>
+              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+              <y:BorderInsets bottom="0" bottomF="0.0" left="64" leftF="64.00000000000001" right="50" rightF="50.0" top="9" topF="9.0"/>
+            </y:GroupNode>
+            <y:GroupNode>
+              <y:Geometry height="80.0" width="100.0" x="209.0" y="319.0"/>
+              <y:Fill color="#CAECFF84" transparent="false"/>
+              <y:BorderStyle color="#666699" type="dotted" width="1.0"/>
+              <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#99CCFF" borderDistance="0.0" fontFamily="Dialog" fontSize="15" fontStyle="plain" hasLineColor="false" height="22.37646484375" modelName="internal" modelPosition="t" textColor="#000000" visible="true" width="100.0" x="0.0" y="0.0">Folder 1</y:NodeLabel>
+              <y:Shape type="roundrectangle"/>
+              <y:State closed="true" innerGraphDisplayEnabled="false"/>
+              <y:Insets bottom="15" bottomF="15.0" left="15" leftF="15.0" right="15" rightF="15.0" top="15" topF="15.0"/>
+              <y:BorderInsets bottom="0" bottomF="0.0" left="0" leftF="0.0" right="0" rightF="0.0" top="0" topF="0.0"/>
+            </y:GroupNode>
+          </y:Realizers>
+        </y:ProxyAutoBoundsNode>
+      </data>
+      <graph edgedefault="directed" id="n1:">
+        <node id="n1::n0">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="79.0" x="203.99999999999994" y="313.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#FF0000" visible="true" width="16.0" x="31.5" y="0.298828125">0</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n1::n1">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="79.0" x="282.99999999999994" y="313.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#FF0000" visible="true" width="16.0" x="31.5" y="0.298828125">1</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n1::n2">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="79.0" x="361.99999999999994" y="313.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#FF0000" visible="true" width="16.0" x="31.5" y="0.298828125">2</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n1::n3">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="79.0" x="440.99999999999994" y="313.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#FF0000" visible="true" width="16.0" x="31.5" y="0.298828125">3</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n1::n4">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="79.0" x="520.0" y="313.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#FF0000" visible="true" width="16.0" x="31.5" y="0.298828125">4</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+        <node id="n1::n5">
+          <data key="d6">
+            <y:ShapeNode>
+              <y:Geometry height="34.0" width="79.0" x="599.0" y="313.0"/>
+              <y:Fill hasColor="false" transparent="false"/>
+              <y:BorderStyle color="#000000" type="line" width="1.0"/>
+              <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#FF0000" visible="true" width="22.0" x="28.5" y="0.298828125">...</y:NodeLabel>
+              <y:Shape type="rectangle"/>
+            </y:ShapeNode>
+          </data>
+        </node>
+      </graph>
+    </node>
+    <node id="n2">
+      <data key="d4"/>
+      <data key="d6">
+        <y:ShapeNode>
+          <y:Geometry height="79.0" width="183.0" x="578.0" y="7.59765625"/>
+          <y:Fill color="#CCFFCC" transparent="false"/>
+          <y:BorderStyle color="#000000" type="line" width="1.0"/>
+          <y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="148.59765625" x="17.201171875" y="22.798828125">Texture Object</y:NodeLabel>
+          <y:Shape type="hexagon"/>
+        </y:ShapeNode>
+      </data>
+    </node>
+    <edge id="e0" source="n2" target="n1::n1">
+      <data key="d10">
+        <y:PolyLineEdge>
+          <y:Path sx="0.0" sy="0.0" tx="0.0" ty="0.0">
+            <y:Point x="669.5" y="172.0"/>
+            <y:Point x="322.49999999999994" y="172.0"/>
+          </y:Path>
+          <y:LineStyle color="#000000" type="line" width="1.0"/>
+          <y:Arrows source="none" target="standard"/>
+          <y:EdgeLabel alignment="center" distance="2.0" fontFamily="Times New Roman" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="57.15625" modelName="six_pos" modelPosition="head" preferredPlacement="target" ratio="0.5" textColor="#000000" visible="true" width="177.25" x="-262.125" y="26.25670623779297">glActiveTexture()
+glBindTexture()</y:EdgeLabel>
+          <y:BendStyle smoothed="false"/>
+        </y:PolyLineEdge>
+      </data>
+    </edge>
+    <edge id="e1" source="n1::n1" target="n0::n0">
+      <data key="d10">
+        <y:PolyLineEdge>
+          <y:Path sx="-16.0" sy="-7.0" tx="0.0" ty="0.0">
+            <y:Point x="306.49999999999994" y="219.0"/>
+            <y:Point x="9.333333333333332" y="219.0"/>
+            <y:Point x="9.333333333333332" y="73.298828125"/>
+          </y:Path>
+          <y:LineStyle color="#FF0000" type="dashed" width="1.0"/>
+          <y:Arrows source="none" target="standard"/>
+          <y:EdgeLabel alignment="center" distance="2.0" fontFamily="Serif" fontSize="24" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="33.40234375" modelName="six_pos" modelPosition="head" preferredPlacement="anywhere" ratio="0.5" textColor="#FF0000" visible="true" width="181.97265625" x="-239.56966145833337" y="-129.423828125">glUniform1i(..., 1)</y:EdgeLabel>
+          <y:BendStyle smoothed="false"/>
+        </y:PolyLineEdge>
+      </data>
+    </edge>
+  </graph>
+  <data key="d0">
+    <y:Resources/>
+  </data>
+</graphml>
Add a comment to this file

Documents/Texturing/TextureBindingDiagram.svg

Added
New image
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill-opacity="1" color-rendering="auto" color-interpolation="auto" stroke="black" text-rendering="auto" stroke-linecap="square" width="782" stroke-miterlimit="10" stroke-opacity="1" shape-rendering="auto" fill="black" stroke-dasharray="none" font-weight="normal" stroke-width="1" height="429" font-family="'Dialog'" font-style="normal" stroke-linejoin="miter" font-size="12" stroke-dashoffset="0" image-rendering="auto">
+  <!--Generated by ySVG-->
+  <defs id="genericDefs"/>
+  <g>
+    <defs id="defs1">
+      <clipPath clipPathUnits="userSpaceOnUse" id="clipPath1">
+        <path d="M0 0 L782 0 L782 429 L0 429 L0 0 Z"/>
+      </clipPath>
+      <clipPath clipPathUnits="userSpaceOnUse" id="clipPath2">
+        <path d="M-6 -8 L776 -8 L776 421 L-6 421 L-6 -8 Z"/>
+      </clipPath>
+      <clipPath clipPathUnits="userSpaceOnUse" id="clipPath3">
+        <path d="M-6 -8.5977 L776 -8.5977 L776 420.4023 L-6 420.4023 L-6 -8.5977 Z"/>
+      </clipPath>
+      <clipPath clipPathUnits="userSpaceOnUse" id="clipPath4">
+        <path d="M-7 -8 L775 -8 L775 421 L-7 421 L-7 -8 Z"/>
+      </clipPath>
+    </defs>
+    <g fill="rgb(227,214,255)" transform="matrix(1,0,0,1,6,8)" stroke="rgb(227,214,255)">
+      <rect x="28" y="7.5977" clip-path="url(#clipPath2)" width="340" rx="4" ry="4" height="148.4023" stroke="none"/>
+    </g>
+    <g fill="rgb(227,214,255)" transform="matrix(1,0,0,1,6,8)" stroke="rgb(227,214,255)">
+      <rect x="28" width="340" height="33.4023" y="7.5977" clip-path="url(#clipPath2)" stroke="none"/>
+    </g>
+    <g font-family="serif" font-size="24" transform="matrix(1,0,0,1,6,8)">
+      <text x="121.6875" xml:space="preserve" y="33.7266" clip-path="url(#clipPath2)" stroke="none">Program Object</text>
+    </g>
+    <g fill="rgb(227,214,255)" transform="matrix(1,0,0,1,6,8) translate(0,0.5977)" stroke="rgb(227,214,255)">
+      <image x="31" y="10" clip-path="url(#clipPath3)" width="16" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAbUlEQVR42mOMi4v7&#13;&#10;z0AmaG9vZ2ABMRYuXEiy5h07djBISUlBDACBZ8+ekWTA8uXLGTw8PBiYGCgEw8AA&#13;&#10;FnQBaWlpvBqePn1KmQtAUYfXBSAb0BWR5AVS08RwiUZQxgClbbIMAGVJUKiDMgY5&#13;&#10;AAAckR2JbOwokAAAAABJRU5ErkJggg==" height="16" preserveAspectRatio="none"/>
+    </g>
+    <g stroke-linecap="round" transform="matrix(1,0,0,1,6,8)" stroke-dashoffset="2" fill="rgb(102,102,153)" stroke-dasharray="0,4" stroke="rgb(102,102,153)" stroke-miterlimit="1.45">
+      <rect x="28" y="7.5977" clip-path="url(#clipPath2)" fill="none" width="340" rx="4" ry="4" height="148.4023"/>
+    </g>
+    <g fill="rgb(102,102,153)" transform="matrix(1,0,0,1,6,8) translate(0,0.5977)" stroke="rgb(102,102,153)">
+      <image x="31" y="10" clip-path="url(#clipPath3)" width="16" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAbUlEQVR42mOMi4v7&#13;&#10;z0AmaG9vZ2ABMRYuXEiy5h07djBISUlBDACBZ8+ekWTA8uXLGTw8PBiYGCgEw8AA&#13;&#10;FnQBaWlpvBqePn1KmQtAUYfXBSAb0BWR5AVS08RwiUZQxgClbbIMAGVJUKiDMgY5&#13;&#10;AAAckR2JbOwokAAAAABJRU5ErkJggg==" height="16" preserveAspectRatio="none"/>
+    </g>
+    <g font-family="serif" font-size="20" transform="matrix(1,0,0,1,6,8)">
+      <text x="61.8125" xml:space="preserve" y="80.8564" clip-path="url(#clipPath2)" stroke="none">uniform sampler1D texName1</text>
+    </g>
+    <g stroke-width="2" stroke-miterlimit="1.45" transform="matrix(1,0,0,1,6,8)" stroke-linecap="butt">
+      <rect x="43" y="56" clip-path="url(#clipPath2)" fill="none" width="282" rx="4" ry="4" height="34"/>
+    </g>
+    <g font-family="serif" font-size="20" transform="matrix(1,0,0,1,6,8)">
+      <text x="61.8125" xml:space="preserve" y="114.8564" clip-path="url(#clipPath2)" stroke="none">uniform sampler2D texName2</text>
+    </g>
+    <g stroke-width="2" stroke-miterlimit="1.45" transform="matrix(1,0,0,1,6,8)" stroke-linecap="butt">
+      <rect x="43" y="90" clip-path="url(#clipPath2)" fill="none" width="282" rx="4" ry="4" height="34"/>
+    </g>
+    <g fill="rgb(255,255,204)" transform="matrix(1,0,0,1,6,8)" stroke="rgb(255,255,204)">
+      <rect x="125" y="289" clip-path="url(#clipPath2)" width="618" rx="4" ry="4" height="116.2031" stroke="none"/>
+      <rect x="125" width="618" height="43.2031" y="362" clip-path="url(#clipPath2)" stroke="none"/>
+    </g>
+    <g font-family="serif" font-size="32" transform="matrix(1,0,0,1,6,8)">
+      <text x="127" xml:space="preserve" y="396.1719" clip-path="url(#clipPath2)" stroke="none">Texture Image Units</text>
+    </g>
+    <g fill="rgb(255,255,204)" transform="matrix(1,0,0,1,6,8) translate(1,0)" stroke="rgb(255,255,204)">
+      <image x="127" y="292" clip-path="url(#clipPath4)" width="16" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAbUlEQVR42mOMi4v7&#13;&#10;z0AmaG9vZ2ABMRYuXEiy5h07djBISUlBDACBZ8+ekWTA8uXLGTw8PBiYGCgEw8AA&#13;&#10;FnQBaWlpvBqePn1KmQtAUYfXBSAb0BWR5AVS08RwiUZQxgClbbIMAGVJUKiDMgY5&#13;&#10;AAAckR2JbOwokAAAAABJRU5ErkJggg==" height="16" preserveAspectRatio="none"/>
+    </g>
+    <g stroke-linecap="round" transform="matrix(1,0,0,1,6,8)" stroke-dashoffset="2" fill="rgb(102,102,153)" stroke-dasharray="0,4" stroke="rgb(102,102,153)" stroke-miterlimit="1.45">
+      <rect x="125" y="289" clip-path="url(#clipPath2)" fill="none" width="618" rx="4" ry="4" height="116.2031"/>
+    </g>
+    <g fill="rgb(102,102,153)" transform="matrix(1,0,0,1,6,8) translate(1,0)" stroke="rgb(102,102,153)">
+      <image x="127" y="292" clip-path="url(#clipPath4)" width="16" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAbUlEQVR42mOMi4v7&#13;&#10;z0AmaG9vZ2ABMRYuXEiy5h07djBISUlBDACBZ8+ekWTA8uXLGTw8PBiYGCgEw8AA&#13;&#10;FnQBaWlpvBqePn1KmQtAUYfXBSAb0BWR5AVS08RwiUZQxgClbbIMAGVJUKiDMgY5&#13;&#10;AAAckR2JbOwokAAAAABJRU5ErkJggg==" height="16" preserveAspectRatio="none"/>
+    </g>
+    <g fill="red" font-size="24" font-family="serif" transform="matrix(1,0,0,1,6,8)" stroke="red">
+      <text x="237.5" xml:space="preserve" y="339.4277" clip-path="url(#clipPath2)" stroke="none">0</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <rect fill="none" x="204" width="79" height="34" y="313" clip-path="url(#clipPath2)"/>
+    </g>
+    <g fill="red" font-size="24" font-family="serif" transform="matrix(1,0,0,1,6,8)" stroke="red">
+      <text x="316.5" xml:space="preserve" y="339.4277" clip-path="url(#clipPath2)" stroke="none">1</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <rect fill="none" x="283" width="79" height="34" y="313" clip-path="url(#clipPath2)"/>
+    </g>
+    <g fill="red" font-size="24" font-family="serif" transform="matrix(1,0,0,1,6,8)" stroke="red">
+      <text x="395.5" xml:space="preserve" y="339.4277" clip-path="url(#clipPath2)" stroke="none">2</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <rect fill="none" x="362" width="79" height="34" y="313" clip-path="url(#clipPath2)"/>
+    </g>
+    <g fill="red" font-size="24" font-family="serif" transform="matrix(1,0,0,1,6,8)" stroke="red">
+      <text x="474.5" xml:space="preserve" y="339.4277" clip-path="url(#clipPath2)" stroke="none">3</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <rect fill="none" x="441" width="79" height="34" y="313" clip-path="url(#clipPath2)"/>
+    </g>
+    <g fill="red" font-size="24" font-family="serif" transform="matrix(1,0,0,1,6,8)" stroke="red">
+      <text x="553.5" xml:space="preserve" y="339.4277" clip-path="url(#clipPath2)" stroke="none">4</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <rect fill="none" x="520" width="79" height="34" y="313" clip-path="url(#clipPath2)"/>
+    </g>
+    <g fill="red" font-size="24" font-family="serif" transform="matrix(1,0,0,1,6,8)" stroke="red">
+      <text x="629.5" xml:space="preserve" y="339.4277" clip-path="url(#clipPath2)" stroke="none">...</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <rect fill="none" x="599" width="79" height="34" y="313" clip-path="url(#clipPath2)"/>
+    </g>
+    <g fill="rgb(204,255,204)" transform="matrix(1,0,0,1,6,8)" stroke="rgb(204,255,204)">
+      <path d="M578 47.0977 L596.3 7.5977 L742.7 7.5977 L761 47.0977 L742.7 86.5977 L596.3 86.5977 Z" clip-path="url(#clipPath2)" fill-rule="evenodd" stroke="none"/>
+    </g>
+    <g font-family="serif" font-size="24" transform="matrix(1,0,0,1,6,8)">
+      <text x="597.2012" xml:space="preserve" y="56.5254" clip-path="url(#clipPath2)" stroke="none">Texture Object</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <path fill="none" d="M578 47.0977 L596.3 7.5977 L742.7 7.5977 L761 47.0977 L742.7 86.5977 L596.3 86.5977 Z" fill-rule="evenodd" clip-path="url(#clipPath2)"/>
+      <path fill="none" stroke-dasharray="6,2" d="M306.5 313.0215 L306.5 219 L9.3333 219 L9.3333 73.2988 L34.9789 73.255" clip-path="url(#clipPath2)" stroke="red"/>
+      <path fill="red" stroke-dasharray="6,2" d="M42.9788 73.2413 L30.9703 68.2618 L33.9789 73.2567 L30.9874 78.2618 Z" clip-path="url(#clipPath2)" stroke="none"/>
+    </g>
+    <g font-size="24" stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" fill="red" font-family="serif" stroke-dasharray="6,2" stroke="red" stroke-miterlimit="1.45">
+      <text x="68.9303" xml:space="preserve" y="209.7266" clip-path="url(#clipPath2)" stroke="none">glUniform1i(..., 1)</text>
+    </g>
+    <g stroke-linecap="butt" transform="matrix(1,0,0,1,6,8)" stroke-miterlimit="1.45">
+      <path fill="none" d="M669.5 86.587 L669.5 172 L322.5 172 L322.5 305" clip-path="url(#clipPath2)"/>
+      <path d="M322.5 313 L327.5 301 L322.5 304 L317.5 301 Z" clip-path="url(#clipPath2)" stroke="none"/>
+      <text x="409.375" font-size="24" y="136.7402" clip-path="url(#clipPath2)" font-family="'Times New Roman'" stroke="none" xml:space="preserve">glActiveTexture()</text>
+      <text x="418.0234" font-size="24" y="163.3184" clip-path="url(#clipPath2)" font-family="'Times New Roman'" stroke="none" xml:space="preserve">glBindTexture()</text>
+    </g>
+  </g>
+</svg>
Add a comment to this file

Documents/Texturing/Torus.png

Added
New image

Documents/Texturing/Tutorial 14.xml

         reduce the number of parameters to two. Also, the specular shininess is a constant value
         across a mesh. So, for any given mesh, the specular function is a function of one parameter:
         the dot-product between the half-angle vector and the surface normal.</para>
-    <!--TODO: Equation for Gaussian, with a constant shininess and based on the dot-product.-->
+    <equation>
+        <title>Gaussian as Function of One Variable</title>
+        <mediaobject>
+            <imageobject>
+                <imagedata fileref="GaussianLookup.svg"/>
+            </imageobject>
+        </mediaobject>
+    </equation>
     <para>So how do we get a look-up table to the shader? We could use the obvious method; build a
         uniform buffer containing an array of floats. We would multiply the dot-product by the
         number of entries in the table and pick a table entry based on that value. By now, you
         <para>Our first use of textures is in the <phrase role="propername">Basic Texture</phrase>
             tutorial. This tutorial shows a scene containing a golden infinity symbol, with a
             directional light and a second moving point light source.</para>
-        <!--TODO: Picture of the tutorial.-->
+        <figure>
+            <title>Basic Texture</title>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="Basic%20Texture.png"/>
+                </imageobject>
+            </mediaobject>
+        </figure>
         <para>The camera and the object can be rotated using the left and right mouse buttons
             respectively. Pressing the <keycap>Spacebar</keycap> toggles between shader-based
             Gaussian specular and texture-based specular. The <keycap>1</keycap> through
                 texture. A sampler uniform in a shader is set to a particular image unit; this sets
                 the association between the shader and the image unit. To associate an image unit
                 with a texture object, we bind the texture to that unit.</para>
-            <!--TODO: Diagram of the connection between texture objects, sampler uniforms, and the context state.-->
+            <figure>
+                <title>Texture Binding and Context</title>
+                <mediaobject>
+                    <imageobject>
+                        <imagedata fileref="TextureBindingDiagram.svg"/>
+                    </imageobject>
+                </mediaobject>
+            </figure>
             <para>Though the idea is essentially the same, there are many API differences between
                 the UBO mechanism and the texture mechanism. We will start with setting the sampler
                 uniform to an image unit.</para>
             <para>We pass the texture unit directly; there is no need to add
                     <literal>GL_TEXTURE0</literal> to it to convert it into an enumerator. This
                 effectively adds an additional value to each texture unit.</para>
-            <!--TODO: Diagram from above, but with sampler objects.-->
+            <figure>
+                <title>Sampler Binding and Context</title>
+                <mediaobject>
+                    <imageobject>
+                        <imagedata fileref="SamplerBindingDiagram.svg"/>
+                    </imageobject>
+                </mediaobject>
+            </figure>
             <note>
                 <para>Technically, we do not have to use a sampler object. The parameters we use for
                     samplers could have been set into the texture object directly with
             <para>If we use resolution <keycap>1</keycap>, we can see that it is a pretty rough
                 approximation. We can very clearly see the distinction between the different texels
                 in our lookup table. It is a 64-texel lookup table.</para>
-            <!--TODO: Picture of the low resolution image, with a shot of the correct one off to the side-->
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="Lookup%20Low%20Resolution.png"/>
+                </imageobject>
+            </mediaobject>
             <para>Switching to the level <keycap>3</keycap> resolution shows more gradations, and
                 looks much more like the shader calculation. This one is 256 texels across.</para>
-            <!--TODO: Picture of resolution 3, with shot of correct off to the side.-->
+            <mediaobject>
+                    <imageobject>
+                        <imagedata fileref="Lookup%20Mid%20Resolution.png"/>
+                    </imageobject>
+            </mediaobject>
             <para>The largest resolution, <keycap>4</keycap>, is 512 texels, and it looks nearly
                 identical to the pure shader version for this object.</para>
-            <!--TODO: Picture of resolution 4, with the correct shot to the side.-->
+            <mediaobject>
+                    <imageobject>
+                        <imagedata fileref="Lookup%20High%20Resolution.png"/>
+                    </imageobject>
+            </mediaobject>
         </section>
     </section>
     <section>
             multiplication is insufficient to express it. Matrices can only handle linear
             transformations, and the perspective projection needs a division, which is non-linear.
             We have seen the effect of this non-linear transformation before:</para>
-        <!--TODO: Diagram from before of camera space to NDC space.
-This time, we want to mark the nearest line A, farthest line B, and the middle line C.
-Add line D in a different color, representing the NDC space midpoint. Show it on both objects.-->
+        <figure>
+            <title>Projection and Interpolation</title>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="PerspectiveInterpolation.svg"/>
+                </imageobject>
+            </mediaobject>
+        </figure>
         <para>The transformation from normalized device coordinate space to window space is fully
             linear. So the problem is the transformation from camera space to NDC space, the
             perspective projection.</para>
         <para>There are no camera controls in this demo; the camera is fixed so as to allow the
             illusion presented to work. Pressing the <keycap>P</keycap> key switches between
             perspective-correct interpolation and window-space linear interpolation.</para>
-        <!--TODO: Picture of perspective correct vs. linear.-->
+        <figure>
+            <title>Perspective Correct Interpolation</title>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="PerspectiveInterpolation.png"/>
+                </imageobject>
+            </mediaobject>
+            <caption>
+                <para>Left: Linear interpolation. Right: Perspective-correct interpolation</para>
+            </caption>
+        </figure>
         <para>The interesting bit is as follows. Switch to the perspective-correct version (a
             message will appear in the console window) and press the <keycap>S</keycap> key. Now,
             the <keycap>P</keycap> key no longer seems to have any effect; we seem to be trapped in
         <para>To see texture mapping in action, load up the <phrase role="propername">Material
                 Texture</phrase> tutorial. This tutorial uses the same scene as before, but the
             infinity symbol can use a texture to define the specular shininess of the object.</para>
-        <!--TODO: Picture of the tutorial.-->
+        <figure>
+            <title>Material Texture</title>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="Material%20Texture.png"/>
+                </imageobject>
+            </mediaobject>
+        </figure>
         <para>The <keycap>Spacebar</keycap> switches between one of three rendering modes: fixed
             shininess with a Gaussian lookup-table, a texture-based shininess with a Gaussian
             lookup-table, and a texture-based shininess with a shader-computed Gaussian term. The
         </section>
         <section>
             <title>The Way of the Map</title>
-            <!--Kill this section if it is too hard to get images for it.-->
             <para>We use two objects in this tutorial: a flat plane and an infinity symbol. The
                 mapping of the plane is fairly obvious, but the infinity symbol's map is more
                 interesting. Topologically, the infinity symbol is no different from that of a
                 torus.</para>
-            <!--TODO: diagram of a torus-->
+            <figure>
+                <title>A Torus</title>
+                <mediaobject>
+                    <imageobject>
+                        <imagedata fileref="Torus.png"/>
+                    </imageobject>
+                </mediaobject>
+            </figure>
             <para>That is, the infinity symbol and a torus have the same connectivity between
                 vertices; those vertices are just in different positions.</para>
             <para>Mapping an object onto a 2D plane generally means finding a way to slice the
                 context end to end. Therefore, mapping a texture onto this means reversing the
                 process: cutting the torus lengthwise down an arbitrary line, much like a car tire.
                 Then, it is cut again along the side, so that it becomes a plane.</para>
-            <!--TODO: diagram of a torus, then cut lengthwise, then cut down the side.-->
             <para>Exactly where those cuts need to be made is arbitrary. And because the specular
                 texture mirrors perfectly in the S and T directions, it is not possible to tell
                 exactly where the seams in the topology are.</para>
             <para>The best way to understand how the shininess texture affects the rendered result
                 is to switch to the dark material with the <keycap>9</keycap> key. The plane also
                 shows this a bit easier than the curved infinity symbol.</para>
-            <!--TODO: picture of the flat plane in black.-->
-            <para>The areas with lower shininess look like smudge marks. While the bright marks in
-                the highly shiny areas only reflect light when the light source is very close to
-                perfectly reflecting, the lower shininess areas will reflect light from much larger
-                angles.</para>
+            <figure>
+                <title>Surface smudges</title>
+                <mediaobject>
+                    <imageobject>
+                        <imagedata fileref="Material%20Flat%20Rings.png"/>
+                    </imageobject>
+                </mediaobject>
+            </figure>
+            <para>The areas with lower shininess, the bright areas, look like smudge marks. While
+                the bright marks in the highly shiny areas only reflect light when the light source
+                is very close to perfectly reflecting, the lower shininess areas will reflect light
+                from much larger angles.</para>
             <para>One interesting thing to note is how our look-up table works with the flat
                 surface. Even at the highest resolution, 512 individual values, the lookup table is
                 pretty poor; a lot of concentric rings are plainly visible. It looked more
                 texture. In the best possible case, every texel in the texture maps to the same
                 physical size on the object's surface. Fortunately for a graphics programmer, doing
                 that isn't your job.</para>
-            <para>Unless your job is writing the tool that the artists use to help them in this
-                process.</para>
+            <para>Unless of course your job is writing the tool that the artists use to help them in
+                this process.</para>
         </section>
     </section>
     <section>
 
 The GLM library is distributed under the terms of the MIT License, as specified in the "glm-0.9.0.7/copying.txt" file.
 
-With two exceptions, all other materials in this distribution are copywritten and distributed under the terms of the MIT License, as specified in the "./MIT License.txt" file. The two files that are not distributed under this copyright are:
+With a few exceptions exceptions, all other materials in this distribution are copywritten and distributed under the terms of the MIT License, as specified in the "./MIT License.txt" file. The two files that are not distributed under this copyright are:
 
 * Documents/Positioning/Coord_system_SZ_0.svg
-* Documents/Illumination/GammaCorrectFunc.svg.
+* Documents/Illumination/GammaCorrectFunc.svg
+* Documents/Texturing/Torus.png
 
 These files have been released in the public domain and therefore are not copywritten.

Tut 14 Textures Are Not Pictures/Material Texture.cpp

 	MaterialBlock mtl;
 	mtl.diffuseColor = glm::vec4(1.0f, 0.673f, 0.043f, 1.0f);
 	mtl.specularColor = glm::vec4(1.0f, 0.673f, 0.043f, 1.0f) * 0.4f;
-	mtl.specularShininess = 0.2f;
+	mtl.specularShininess = 0.125f;
 	mtls[0] = mtl;
 
 	mtl.diffuseColor = glm::vec4(0.01f, 0.01f, 0.01f, 1.0f);
 	mtl.specularColor = glm::vec4(0.99f, 0.99f, 0.99f, 1.0f);
-	mtl.specularShininess = 0.2f;
+	mtl.specularShininess = 0.125f;
 	mtls[1] = mtl;
 
 	g_materialUniformBuffer = mtls.CreateBufferObject();
Add a comment to this file

Tut 14 Textures Are Not Pictures/data/main.dds

Binary file modified.

Add a comment to this file

Tut 14 Textures Are Not Pictures/data/main.pdn

Binary file modified.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.