Welcome to Pixel Tangent featuring quality yet simplistic implementations of common graphic concepts. Primarily this site acts as an online portfolio of my graphics journey, as well as a place where others may learn. And the best part: all source code is provided.
It's been over a month since my last graphical delight, and while this treat may seem a little dull, the concept of sampling and anti-aliasing is an important concept in the industry for that winning edge (no pun indented). In three-dimensional rendering, anti-aliasing is a technique to minimise the distortion artifacts known as aliasing when representing a high-resolution signal at a lower resolution (our computer screen).
This sample attempts to demonstrate the very subtle visual enhancements that anti-aliasing a scene offers. While the visual enhancements are not jaw dropping, every visual improvement helps. And although modern video hardware would easy support an anti-aliased pixel format, this sample demonstrates use of the accumulation buffer and manually jittering the projection matrix to implement anti-aliasing in the off chance that an anti-aliased pixel format mode is not supported.
You can interact with the samples by moving the anti-aliased window. Have fun with both a Visual Studio Project (.NET 2005) windows and GLUT build are available in this clicky.
There hasn't been a post or a new sample in a while, but there is a good reason. Early this month work commitments have taken me to the other side of the world - from Melbourne, Australia to Stockholm, Sweden for around six months. It's summer time now and the weather is perfect. There's also time to squeeze in some sightseeing, this is if you're early enough to avoid the armies of tourists. Hopefully I'll find time to code some new samples so stay tuned.
Hoary! I am pleased to release my first sample free from the stranglehold of the fixed function (FF) pipeline. This sample demonstrates using the GPU to preform simple vertex animation by using a vertex shader with simple trigonometry.
The sample also illustrates how to easily implement a simple fly path that the eye or camera may follow. The fly path is determined by a series of control points which are used to form a spline. The spline chosen is known as a Catmull-Rom Spline which guarantees that each control point will lie on the spline (or the fly path). Although the Catmull-Rom Spline can not be optimised, it is extremely easy to understand and implement. Please forgive my attempt to symbolise a camera to mark the control points.
Get it while it's still hot, both a Visual Studio Project (.NET 2005) windows and GLUT build are available: Clicky.
This sample demonstrates the concept of overdraw which occurs when a pixel is written to the frame buffer more than once. Writing to pixels more than once negatively affects performance, thus it is the aim to keep overdraw to a minimum - boosting performance. One of the best methods to reduce overdraw is to cull backward (or frontward) facing primitives.
To visualise and count the number of times a pixel is written, we make use of the stencil buffer. Using the stencil buffer we simply increment the value of each pixel when it is written to and we use this information to visualise the output.
Admittedly not the most entertaining sample, both a Visual Studio Project (.NET 2003) windows and GLUT build are available Clicky.
In an attempt to improve model rendering performance, the model loading framework now supports the use of indexed geometry. Sadly the results were less than impressive equalling the performance of using intermediate mode. Could this be because the testing models were not a bottleneck then transferring the vertices from the CPU to the GPU? Anyway, it makes a nice little addition to the framework.
After replying with snippets of code to numerous emails enquiring how to use the Pixel Tangent rendering framework within a FPS, I decided to produce a quick demo scene for all to use and share. The Pixel Tangent rendering framework is designed to allow each class / object of the framework to be used (or incorporated) into any other rendering framework or engine. This is because each class is independent of any other class (in other words, no class coupling).
This demo scene combines animated models, z-fail shadows, and bump mapped flooring with the addition of a third person camera. An easy trick when designing a game using a third person camera is to only translate the camera and not the character of focus. By only moving the camera, the character can simply be placed in front of the camera - it's as easy as that.
Also with the removal of the Fixed Function (FF) pipeline in other graphics API's such as Direct X, the use of the FF has been reduced and shaders used extensively. With any luck I should be able to fully remove the use of the FF pipeline in upcoming demo scenes.
Hope you enjoy the Visual Studio Project (.NET 2003) windows and GLUT build Clicky.
As promised late last year, this new addition kicks off the first of planned new DX HLSL samples.
Using the pixel shader 2.0 model of the HLSL, a real-time procedural checker pattern is illustrated for use with 3D models plus the added bonus of a specular light source. Furthermore, the sample demonstrates how to use the in-built matrix shadow utility to generate simple and cheap planner shadows along with using the stencil buffer so that the shadow is only cast upon the floor.
Updated the vertex shader to support a scaling value to affect the size of the check pattern and changed the pixel shader by reducing the number of conditional tests and in the hope of getting anti-aliasing for free, however this had a large and unexpected performance hit (7%) with no visual improvements. So I've also kept the old shaders if you want to revert back - I would recommend it.
Have fun with the Visual Studio Project (.NET 2003) windows build Clicky.
While I thought the shadow volume technique had come and gone, partly due to its incredibly high fill rates, a friend of mine implemented the volume extrusion algorithm totally inside the GPU and renewed my interest. Is this the first step toward using new geometry shaders for a fully GPU Z fail shadow algorithm - looks promising?
Anyway, here is the result. The windows build demonstrates a static and hardcoded occluder from which the volume is calculated at run time. While the GLUT build demonstrates loading a MD2 model and dynamically calculating the shadow volume. Looks like the Z Fail Shadow technique has life in it after all.
The Visual Studio Project (.NET 2003) includes both a windows build and a GLUT build Clicky.
Yes, it's true, I'm seeing in the new year in New Zealand.
This year should be interesting. Who will survive the Blu-ray vs HD DVD war? Now that the big three consoles have been released, which is going to top market share? And will Vista live up to it's promises?
Happy New Year everyone.
Whether you've been naughty or nice have a very Merry Christmas.