Simon's Graphics Blog

Work log for ideas and hobby projects.

Continuous Silhouettes

without comments

Silhouettes are commonly used for real-time shadowing algorithms. Usually these are generated from the existing edges of a mesh using the face normals. Since shading is usually interpolated over the triangle from the vertex normals, this can introduce shading artifacts where the vertex and face normals do not agree. In addition, these silhouettes move discontinuously when the light or mesh is in motion, which can cause nasty popping artifacts when using penumbra wedge soft shadows, since the projected penumbra volumes are very sensitive to the distance from the silhouette edge to the light source.

This post describes an idea of how to generate silhouette geometry using the vertex normals of a mesh. These silhouettes match the vertex lighting exactly, and also move continuously under smooth lighting or geometry changes.
Read the rest of this entry »

Written by Simon Brown

May 11th, 2004 at 8:00 pm

Pooled Allocators For The STL

with 3 comments

One of the main complaints about the STL is the perceived lack of memory efficiency. In this article I’ll present a simple pooled allocator for use with the STL containers that allocate single elements at a time, such as list, set or map.

Read the rest of this entry »

Written by Simon Brown

May 1st, 2004 at 8:00 pm

Posted in C++

Why You Should Always Use static_cast

with 2 comments

I’m writing this to document my experience with the use of casting in large class hieararchies, specifically those that use multiple inheritance. I’ll be mainly having a go at anyone who likes to use C-style casts to move around their class hierarchy.
Read the rest of this entry »

Written by Simon Brown

May 1st, 2004 at 7:00 pm

Posted in C++

Why You Should Always Use explicit Constructors

with 3 comments

Part of the overloading rules in C++ allow for types to be freely converted to other types through the use of single-argument constructors. Since no compilers currently inform you when this is going on it can lead to obscure bugs and/or inefficient code.
Read the rest of this entry »

Written by Simon Brown

May 1st, 2004 at 6:00 pm

Posted in C++

How To Fix The DirectX Rasterisation Rules

with 4 comments

DirectX has always rasterised to render target pixel centres, and has always looked up textures from texel edges. Because of this, it is more difficult than it should be to write a flexible shader system where various portions of your pipeline are image-based. It is much simpler to work in a unified system where you write to render target pixel edges, and this article details a simple way of fixing this.
Read the rest of this entry »

Written by Simon Brown

May 1st, 2003 at 8:00 pm

Posted in C++,DirectX,Rendering

Really Old Demos – The Buggy Demo

with 4 comments

This demo is just here for posterity – it formed part of my August 2002 coding portfolio when I was first applying for jobs in the games industry. Be warned, there’s some seriously dodgy coding going on here…
Read the rest of this entry »

Written by Simon Brown

August 1st, 2002 at 8:00 pm

Really Old Demos – Cubic Shadow Mapping

without comments

This demo is just here for posterity – it formed part of my August 2002 coding portfolio when I was first applying for jobs in the games industry. Be warned, there’s some seriously dodgy coding going on here…

Read the rest of this entry »

Written by Simon Brown

August 1st, 2002 at 7:00 pm

Really Old Demos – OpenEngine

without comments

This demo is just here for posterity – it formed part of my August 2002 coding portfolio when I was first applying for jobs in the games industry. Be warned, there’s some seriously dodgy coding going on here…

Read the rest of this entry »

Written by Simon Brown

August 1st, 2002 at 6:00 pm

Representing Rotations In Quaternion Arithmetic

with 10 comments

Quaternions crop up a lot in game development, since they are an efficient way to store rotations in 3-space. This article attempts to serve as a mathematical introduction to quaternions, and explains how and why we choose to use them to represent 3D rotations.
Read the rest of this entry »

Written by Simon Brown

May 1st, 2002 at 8:00 pm

Posted in Quaternions