Simon’s Graphics Blog

Simon's Graphics Blog

last update:

Lua is a very compact, fast scripting language with great platform support. Editing lua scripts is nice and easy in most editors (such as gvim, but Visual Studio doesn’t highlight the syntax by default. So here’s a plug-in for Visual Studio .NET 2003 that highlights Lua 5.0 syntax and provides auto-completion for keywords and identifiers as you type.

Screenshot

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.

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.

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.

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.

This behaviour can be controlled through the C++ keyword explicit, however, in my experience even some very experienced C++ developers won’t be able to tell you how this keyword is used. This article is meant to be a simple description of explicit, and why it should be applied in virtually all cases.

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. :)

First I’ll detail the correct way to traverse between multiple base classes, then we’ll have a look at what the compiler generates to implement multiple inheritance. Finally we’ll see what C-style casts do in this implementation, and discover a whole new world of pain.

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.

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…

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…

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…