You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/1-introduction/1-3-basics/1-3-1-rasterizer-state.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,7 @@ Let's step into the few variables we can control in D3D11.
10
10
The first one is the FillMode, this only has two options and simply tells the rasterizer whether to completely fill a triangle, or to only show its edges (or as is more commonly known as "to display a wireframe").
11
11
That's right, we don't need a fancy shader or render the geometry in lines in order to display a wireframe, it's a built-in feature of the rasterizer, one mostly used for debugging or special kinds of visualisation.
12
12
13
-
!!! error
14
-
Show screenshot of triangle in wireframe mode / filled mode
15
-
13
+

16
14
17
15
The CullMode is a bit more useful, this controls when we cull certain triangles, and has three options, `Front`, `Back` and `None`. For most purposes we generally set this to `Back`, so what does this actually do?
18
16
@@ -23,9 +21,6 @@ Think of foliage or tree leaves for example, it's way more helpful to only place
23
21
24
22
Some shadowing techniques may also rely on Frontface culling in order to get better results, but we won't go into detail about that here now.
25
23
26
-
!!! error
27
-
Show screenshot of triangle in both front/backface culled (one will be empty)
28
-
29
24
Simple to explain, but perhaps a bit harder to understands is the "Vertex Winding Order" which is controlled by our input geometry as well as the rasteriser state.
30
25
31
26
Shortly explained, if `FrontCounterClockwise` is `true`, then a triangle is front facing if the vertices are in a **counter**-clockwise order , otherwise it is back facing.
@@ -49,6 +44,11 @@ For completeness-sake, the following is a "counter-clockwise triangle".
49
44
1 2
50
45
```
51
46
47
+
How it looks to have our triangle in `Front` and `Back` cull-modes.
48
+

49
+
50
+
(Yes, the "missing" triangle is the expected result here, it's being culled after all!)
51
+
52
52
53
53
The last few variables we can control require some knowledge on topics we'll cover in later chapters, for now the only important one that is set to `true` by default is:
54
54
`DepthClipEnable`, which allows the rasterizer to discard triangles, or more correctly "fragments" that fall beyond our depth-range from the viewport.
0 commit comments