Shawn Hargreaves' Blog

Game programming with the XNA Framework
0 comments
14 followers
101 entries
Advertisement
shawnhar
May 03, 2011
Antialiasing source textures
This is almost too obvious to be worth pointing out, but no amount of clever tricks like bilinear filtering and mipmapping will help if your input data is itself already aliased!

Yet the example texture used in my previous post had nasty pixelization along the diagonal black lines:



I can i…
870 views
shawnhar
April 29, 2011
Texture aliasing
Aliasing can occur any time you resample a texture, for instance to scale it, rotate it, or map it onto a 3D model. Thanks to our friend the Nyquist threshold, the resulting problems get worse the lower a frequency you sample at, ie. the smaller you shrink it.

Check out this awesome 32x32 test ima…
1,203 views
shawnhar
April 27, 2011
Multisampling
Multisampling is a compromise for people who really want to use supersampling, but can't afford it.

The idea is simple: instead of increasing the resolution for all rendering, what if we do triangle rasterization and depth/stencil tests at the higher resolution, but leave pixel shading and texture l…
1,229 views
shawnhar
April 27, 2011
Supersampling
Supersampling is the simple, brute force approach to antialiasing computer graphics.

In order to avoid aliasing, the Nyquist theorem says we must take at least twice as many samples as the highest frequency detail in our input signal. So how about we just render our scene at a really, really high …
1,376 views
shawnhar
April 21, 2011
How to resample a signal without aliasing
My previous post described how resampling a signal can cause aliasing problems. The worst problems occur when dramatically reducing the number of samples used to represent a signal, or when the source includes lots of high frequency detail. Specifically, there is a magic value called the Nyquist fr…
804 views
shawnhar
April 21, 2011
Why sampling a signal causes aliasing
The math behind digital sampling and filtering is fascinating, complex, and full of arcane terms like Nyquist frequency. But I'm barely a good enough mathematician to understand it, let alone try to explain it here! This post is my attempt to describe aliasing as it applies to computer graphics via…
976 views
shawnhar
April 20, 2011
Antialiasing
I've been meaning to write about antialiasing for a while, but now I sit down to do that I realize I have too much to say for a single article. So this post is the introduction to a series.

Antialiasing is one of the most important yet least widely understood areas of computer graphics. If I had a…
888 views
Advertisement
shawnhar
April 14, 2011
"Code" is a four letter word
"Source code"

"Bedroom coder"

"Can someone explain why this code isn't working?"

"He's such a natural, he thinks directly in code"

These are dirty, dirty phrases...

code (kohd) noun
A system used for brevity or secrecy of communication, in which arbitrarily chosen words, letters, or s…
799 views
shawnhar
April 05, 2011
Visitor and multiple dispatch via C# 'dynamic'
There is a somewhat convincing argument that software design patterns are really just an attempt to emulate missing language features.

Eric Lippert recently wrote a series of articles exploring how one might attempt to implement the "virtual method pattern", if that was not already built in to C#. …
990 views
shawnhar
April 01, 2011
Keyboard macros
I'm sure you've all watched someone who doesn't know keyboard shortcuts struggling to edit a document. It can be frustrating how long even simple things take, and hard not to start shouting advice: ctrl+shift+right, ctrl+x, end, ctrl+v!

But I occasionally see even master programmers, the kind with…
739 views
Advertisement

Popular Blogs

shawnhar
Generalist
101 Entries
14 Followers
klg71
Generalist
57 Entries
2 Followers
ApochPiQ
Generalist
628 Entries
45 Followers
15 Entries
14 Followers
johnhattan
Programmer
1,277 Entries
50 Followers
Advertisement