# Simon's Graphics Blog

Work log for ideas and hobby projects.

## Gamma-Correct Rendering

With consumer-level hardware now capable of rendering high dynamic range image data, the days of the 8-bit sRGB framebuffer are numbered. Programmers of next-generation graphics devices are able to model lighting systems to high accuracy, then tone-map these values into a displayable range for conventional 8-bit sRGB equipment, such as PC monitors.

The graphics pipeline from source art to final output is complicated, and requires the programmer to work in several different colour spaces along the way. In this article I’ll give a brief overview of colour spaces, and then detail a commonly overlooked area in the texture pipeline where gamma is important.
Read the rest of this entry »

Written by Simon Brown

May 14th, 2004 at 8:00 pm

Posted in Rendering

## Continuous Silhouettes

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

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.

Written by Simon Brown

May 1st, 2004 at 8:00 pm

Posted in C++

## Why You Should Always Use static_cast

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++