New Game Studio samples

Hot off the press, this sample provides handy classes for generating cubes, spheres, and teapots (great for debug rendering!) while this one shows how to do various hopefully useful things with skinned character models. Notice how Skinned Model Extensions reuses code from the Primitives3D sample for drawing the collision spheres? You’d almost think Primitives3D was…

3

Texture filtering: mipmapped sprite sheets

Beringela comments on my previous post: "Why don’t spritesheets (with an edge around each sprite) and mipmaps go well together and are there any workarounds other than not using spritesheets or not using mipmaps?" Let’s work through an example, which I shall simplify down to one dimension for clarity. Let’s say we have two textures,…

3

Texture filtering: sprite sheets

You can control what happens when texture filtering reads from past the edge of a texture using the SamplerState.AddressU and AddressV properties. But what if you are using a sprite sheet? The sampler address modes know nothing about how your sprites have been packed together, so when you filter a sprite from a sheet, the…

12

Texture filtering: the edge of the world

Long time no post.  But don’t worry, I’m not dead yet… One of the more surprising things about texture filtering is how easily it can read past the edge of the texture. Consider a 4×1 texture containing four color values: A B C D If we draw this using SpriteBatch with an integer destination location…

5