Difference between revisions of "3D Fundamentals Tutorial 8"

From Chilipedia
Jump to: navigation, search
(Video)
(Video)
 
(5 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
<div class="mw-collapsible mw-collapsed"><br />
 
<div class="mw-collapsible mw-collapsed"><br />
* Major refactoring, implementinng a <code>Pipeline</code> class: Why? [https://youtu.be/aeU8eVAExMQ?t=0m10s 0:10]
+
* Major refactoring, implementing a <code>Pipeline</code> class: Why? [https://youtu.be/aeU8eVAExMQ?t=0m10s 0:10]
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
 
:* Get rid of a lot of redundancy in the code
 
:* Get rid of a lot of redundancy in the code
Line 13: Line 13:
 
</div>
 
</div>
 
* The fixed function pipeline [https://youtu.be/aeU8eVAExMQ?t=3m00s 3:00]
 
* The fixed function pipeline [https://youtu.be/aeU8eVAExMQ?t=3m00s 3:00]
* Code refactoring/implementation: walks-through [https://youtu.be/aeU8eVAExMQ?t=5m35s 5:35]
+
* Code refactoring/implementation commits: start of the walks-through [https://youtu.be/aeU8eVAExMQ?t=5m35s 5:35]
 
* Implementing <code>Pipeline.h</code> [https://youtu.be/aeU8eVAExMQ?t=5m51s 5:51]
 
* Implementing <code>Pipeline.h</code> [https://youtu.be/aeU8eVAExMQ?t=5m51s 5:51]
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
 
:* The pipeline works through a series of nested function calls (representing the stages of the pipeline)
 
:* The pipeline works through a series of nested function calls (representing the stages of the pipeline)
 
:* The <code>Draw()</code> function [https://youtu.be/aeU8eVAExMQ?t=6m24s 6:24]
 
:* The <code>Draw()</code> function [https://youtu.be/aeU8eVAExMQ?t=6m24s 6:24]
:* The <code>Vertex</code> used throughout the pipeline [https://youtu.be/aeU8eVAExMQ?t=6m32s 6:32]
+
:* The <code>Vertex</code> type used throughout the pipeline [https://youtu.be/aeU8eVAExMQ?t=6m32s 6:32]
 
:* The <code>ProcessVertices()</code> function. Applies rotatioin & translation transformations [https://youtu.be/aeU8eVAExMQ?t=7m25s 7:25]
 
:* The <code>ProcessVertices()</code> function. Applies rotatioin & translation transformations [https://youtu.be/aeU8eVAExMQ?t=7m25s 7:25]
 
:* The <code>AssembleTriangles()</code> function. Assembles vertex stream into triangles, culls and passes on triangle vertices (three at a time) [https://youtu.be/aeU8eVAExMQ?t=8m06s 8:06]
 
:* The <code>AssembleTriangles()</code> function. Assembles vertex stream into triangles, culls and passes on triangle vertices (three at a time) [https://youtu.be/aeU8eVAExMQ?t=8m06s 8:06]
Line 24: Line 24:
 
:* The <code>PostProcessTriangleVertices()</code> function. Transforms into screen space and calls the draw function. [https://youtu.be/aeU8eVAExMQ?t=9m42s 9:42]
 
:* The <code>PostProcessTriangleVertices()</code> function. Transforms into screen space and calls the draw function. [https://youtu.be/aeU8eVAExMQ?t=9m42s 9:42]
 
:* The <code>DrawTriangle()</code> function. Same basic triangle drawing function that splits into flat top and flat bottom triangles and call <code>DrawFlatTriangle</code> with appropriate parameters [https://youtu.be/aeU8eVAExMQ?t=10m01s 10:01]
 
:* The <code>DrawTriangle()</code> function. Same basic triangle drawing function that splits into flat top and flat bottom triangles and call <code>DrawFlatTriangle</code> with appropriate parameters [https://youtu.be/aeU8eVAExMQ?t=10m01s 10:01]
 
+
:* Major difference in interpolation approach in the inner rasterization loop. Extended from texture coordinate only to interpolation of the whole vertex. This will be useful later. [https://youtu.be/aeU8eVAExMQ?t=10m37s 10:37]
 
+
:* Data members of the <code>Pipeline</code> class [https://youtu.be/aeU8eVAExMQ?t=11m37s 11:37]
 
+
</div>
 
+
* Different Scene classes and <code>TexVertex.h</code> removed [https://youtu.be/aeU8eVAExMQ?t=12m41s 12:41]
 +
* Templated interpolation implemented in <code>ChiliMath.h</code> [https://youtu.be/aeU8eVAExMQ?t=12m54s 12:54]
 +
* Adjustments to <code>Scene.h</code> [https://youtu.be/aeU8eVAExMQ?t=13m36s 13:36]
 +
* Adjustments to <code>Graphics.h</code> [https://youtu.be/aeU8eVAExMQ?t=14m01s 14:01]
 +
<div class="mw-collapsible-content">
 +
:* All triangle draw functions removed (moved to <code>Pipeline.h</code>)
 +
</div>
 +
* New <code>Cube.h</code> and <code>CubeSkinScene.h</code> setup [https://youtu.be/aeU8eVAExMQ?t=14m14s 14:14]
 +
<div class="mw-collapsible-content">
 +
:* <code>Cube.h</code> is made into a wrapper around a static function that returns triangle vertices.
 +
:* <code>CubeSkinScene.h</code> Builds and binds translation and rotation transformations based on keyboard input. All other functions have been moved to <code>Pipeline.h</code>
 +
</div>
 +
* We now have our new starting point from which we can build our 3-d engine with shaders [https://youtu.be/aeU8eVAExMQ?t=16m38s 16:38]
 +
<div class="mw-collapsible-content">
 +
:* Up next: a pixel shader
 
</div>
 
</div>
 
 
 
</div>
 
</div>
  

Latest revision as of 06:44, 22 May 2020

Here we set up the pipeline that is going to form the scaffolding for our model of the 3D graphics processing. In the coming videos, we are going to be replacing units of fixed functionality in this pipeline one by one with programmable shader stages.

Video

The tutorial video is on YouTube here.


  • Major refactoring, implementing a Pipeline class: Why? 0:10
  • Get rid of a lot of redundancy in the code
  • Introduce a structure to develop specific parts of the D3D10 Graphics Pipeline
  • Effective way to deal with proliferation of effects and settings related to graphics
  • The fixed function pipeline 3:00
  • Code refactoring/implementation commits: start of the walks-through 5:35
  • Implementing Pipeline.h 5:51
  • The pipeline works through a series of nested function calls (representing the stages of the pipeline)
  • The Draw() function 6:24
  • The Vertex type used throughout the pipeline 6:32
  • The ProcessVertices() function. Applies rotatioin & translation transformations 7:25
  • The AssembleTriangles() function. Assembles vertex stream into triangles, culls and passes on triangle vertices (three at a time) 8:06
  • The ProcessTriangles function. Placeholder for the Geometry Shader (implemented later). Creates a Triangle object and passes on 8:47
  • The PostProcessTriangleVertices() function. Transforms into screen space and calls the draw function. 9:42
  • The DrawTriangle() function. Same basic triangle drawing function that splits into flat top and flat bottom triangles and call DrawFlatTriangle with appropriate parameters 10:01
  • Major difference in interpolation approach in the inner rasterization loop. Extended from texture coordinate only to interpolation of the whole vertex. This will be useful later. 10:37
  • Data members of the Pipeline class 11:37
  • Different Scene classes and TexVertex.h removed 12:41
  • Templated interpolation implemented in ChiliMath.h 12:54
  • Adjustments to Scene.h 13:36
  • Adjustments to Graphics.h 14:01
  • All triangle draw functions removed (moved to Pipeline.h)
  • New Cube.h and CubeSkinScene.h setup 14:14
  • Cube.h is made into a wrapper around a static function that returns triangle vertices.
  • CubeSkinScene.h Builds and binds translation and rotation transformations based on keyboard input. All other functions have been moved to Pipeline.h
  • We now have our new starting point from which we can build our 3-d engine with shaders 16:38
  • Up next: a pixel shader

Downloads

The GitHub repository for the tutorial code is here.

3D Graphics History

Coming soon!

See also