1

Microsoft D3D11 documentation for D3D11_RASTERIZER_DESC structure writes:

The settings of the MultisampleEnable and AntialiasedLineEnable members apply only to multisample antialiasing (MSAA) render targets (that is, render targets with sample counts greater than 1).

Should I expect line rendering to be affected by those members only when I am rendering to a multisampled target and not when I am rendering on a "single sampled" one?

When drawing a Line Strip I found line rasterization to be affected by those settings:

enter image description here

What am I missing?

  • It's my understanding that the `AntialiasedLineEnable` member in **D3D11_RASTERIZER_DESC** only applies if doing line drawing and `MultisampleEnable` is FALSE. – Maico De Blasio Jun 16 '22 at 03:43
  • @MaicoDeBlasio and how do you interpret the quote from the documentation? to me that means that both those members are meaningful only if the drawing is happening on a multisampled render target. – leone ruggiero Jun 16 '22 at 09:42
  • The description for `AntialiasedLineEnable` is [here](https://learn.microsoft.com/en-us/windows/win32/api/d3d11/ns-d3d11-d3d11_rasterizer_desc) for **D3D11_RASTERIZER_DESC** . It's the same for **D3D12_RASTERIZER_DESC** in DirectX 12. – Maico De Blasio Jun 17 '22 at 03:08
  • The documentation (the same you and I posted) states: _"The settings of the MultisampleEnable and AntialiasedLineEnable members apply only to multisample antialiasing (MSAA) render targets (that is, render targets with sample counts greater than 1)."_ So my question is: Does that means that `AntialiasedLineEnable` and `MultisampleEnable` are ignored when drawing on a **not multisampled** target? If that's the case, why does my lines are rasterized differently depending on those settings even if I'm rendering on a target with sample count = 1? – leone ruggiero Jun 17 '22 at 06:58
  • Ok it seems that if sample count > 1, and if `MultisampleEnable` is false, then `AntialiasedLineEnable` acts as a toggle between aliased and alpha-antialiased line rendering. If `MultisampleEnable` is true, then you always get quadrilateral line rendering and `AntialiasedLineEnable` is ignored. – Maico De Blasio Jun 17 '22 at 14:15
  • Exactly. Please take a look at the image I posted: you see 2 lines clearly rasterized using different algorithms. The images are taken from the same application launched twice: first attempt drawing the line with a **RasterizerState** with both `AALineEnables` and `MSEnable` set to `true` and the second attempt using `false` for both (it's all in the image). The **target sample count is 1** for both the attempts, so I expected the line rasterization to be the same regardless of those settings. Why is the rasterization different? – leone ruggiero Jun 17 '22 at 14:33
  • If your table captures of Rasterizer State 152 (where Multisample and LineAA are true) and RS 648 (where Multisample and LineAA are false) were both generated from a single sample target, then I agree with you. The line segment on the left is clearly being anti-aliased, which contradicts the (somewhat confusing) Microsoft docs. I can only speculate that the runtime isn't behaving as Microsoft says. The differences in feature-level behaviour (that are also alluded to in the docs) further complicates matters! – Maico De Blasio Jun 17 '22 at 14:39

0 Answers0