Skip to content

Instantly share code, notes, and snippets.

View d7samurai's full-sized avatar
💭
innovation through irritation™

d7samurai

💭
innovation through irritation™
View GitHub Profile
@d7samurai
d7samurai / .readme.md
Last active December 15, 2025 14:57
Minimal D3D11 bonus material: MSAA

Minimal D3D11 bonus material: MSAA

image

This is essentially just the original Minimal D3D11 codebase with 8x MSAA added. However, since MSAA only smooths triangle edges and does not affect textured surface interiors, texturing is removed to isolate and make the effect of MSAA clearer.

In short there are two parts to it: 1) Create and render to an MSAA texture rather than your typical rendertarget/framebuffer (note: the depth buffer must match), and 2) [Resolve](https://gist.github.com/d7samurai/d74299f8bcadcb9cb0686

@d7samurai
d7samurai / .readme.md
Last active January 21, 2026 16:06
Minimal D3D11 bonus material: fullscreen triangle

Minimal D3D11 bonus material: fullscreen triangle

image

Basic setup for rendering a fullscreen triangle - as opposed to a fullscreen quad. This is a triangle that extends past the screen boundaries so that it covers it all, with the excess getting clipped away. The use case for this is typically doing a full screen pass for composition or post processing effects etc (though nowadays you might go for a compute shader instead).

Generally a triangle is preferred over a quad because the geometry is simpler (fewer vertices / shader invocations) and it eliminates the quad’s internal diagonal split. Since pixel shading runs in 2×2 pixel units (incidentally also referred to as "quads"), units that straddle the diagonal will do redundant work on pixels that gets masked out and discarded; both triangles pay this cost along the split, each discarding work tha