Jump to Start Page: 1 2 3 4

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.

eXtended Tiny Encryption Algorithm

21 June, 2009 - eXtended Tiny Encryption Algorithm

For all your enciphering/deciphering needs

Recently a friend and I were discussing various encryption algorithms; we needed one that could be squeezed onto a tiny ROM and had little performance overhead. A quick search lead us to the appropriately named "Tiny Encryption Algorithm", and boy was it tiny. It was also both simple to implement and easy to use. For a little extra memory overhead, we decided to implement the eXtended Tiny Encryption Algorithm.

For further explanation, complete source code and our test harness, please refer to the xTEA page.

dowload zip file The source is available by following this Clicky.

Cube Mapping

13 June, 2009 - Cube Mapping Update

It's an update

Thanks to viewer feedback, you know who you are, the cube mapping sample has been updated to help show the cube being mapped. It's important to remember that this is a cube mapping sample, and not an environmental mapping sample.

The updates show an exploded cube representing the reflections shown on the lamp shade. Now, tapping the '-' and '+' keys will adjust the transparency of the exploded cube.

Keep the questions and suggestions coming.

dowload zip file Enjoy the updates here.

Quick Response Barcode

27 December, 2008 - QR Barcode Detection

A side project

Woot, the first entry on the "Coding 4 fun" section of my corner of cyberspace - QR Barcode Detection.

These pesky little symbols are popping up everywhere. They've been a huge success in Japan for years and now telephony operators world wide are jumping on the bandwagon.

view slideshowvideo To help understand some of the theory behind QR codes and what makes them so "quick" and easy to detect and decode, check out this short slidepack and accompany video.

A quick seach on youtube illustrates some very interesting examples and applications of QR codes in the real world.

This is a quick and dirty implementation of some interesting graphics algorithms such as perspective transformation correction, which corrects for both rotation and perspective distortions without expensive trigonometry function calls, and everyone's favourite cross product method to determine the barcode's orientation. Although this is a simple implantation, it seems to be very quick and robust.

Have a happy new year everyone!

dowload zip file The source is available by following this Clicky. Both a Visual Studio Project and Linux style make file are enclosed.

9 August, 2008 - Show Reel

No triangle was harmed in the making of this reel

I've been meaning to post this video for a while, so without further delay, please enjoy. Hit me back with comments - good, sucks, boring? Let me know.

video YouTube Video Link

Render to texture

22 July, 2008 - Render To Texture

Made easy using OpenGL

A reoccurring question clogging my inbox over the last few months is "how do I render to a texture", frame buffer or something in between. Not to disappoint fans, even I was in awe at just how simple this sample turned out. This sample both illustrates the technique and provides a simple reference implementation.

dowload zip file Without further ado, here is the Clicky.

Tokyo

10 June, 2008 - In Tokyo

I've been living, or should I say working, amongst of vibrant lights of Tokyo - the museum of the future. Anyway an end is in sight, so stay tuned for more simple samples.

Shatter

10 February, 2008 - It's the way it shatters that matters

Requiring DirectX 9

With a little imagination shaders can do almost anything. This sample demonstrates two simple shaders that shatter, or explode, a pre-processed model.

The first shader uses the flat surface normal of each triangle in a model to independently transverse each triangle in an outward direction. Furthermore, each triangle in the model is independently and randomly rotated around it's centroid. This simple pair of effects creates the appearance of the model shattering outwards into fragmented pieces. Very cool, and very easy. However, normally when an object "explodes", all fragments explode in an outward direction from the center.

To remedy this technically incorrect artifact, a second shader has been provided. And guess what? The second shader shatters every triangle in the model outwards from the center of the model. This cheap effect is processed entirely within the shaders and would make a great addition to any shoot 'em up game.

dowload zip file Enjoy the simplicity of this Clicky.

Cube Mapping

29 December, 2007 - Cube Mapping

Yes, you guessed correctly, GLSL

This been a while since my previous sample, working in Japan has been keeping me busy. Alas, no excuses. Down to the business of the latest graphical delight - Cube mapping. After performing a few "back of the envelope" calculations, it was great to discover how easy it was to setup and allow OpenGL to auto generate the required texture co-ordinates. This combined with a pinch of GLSL and voila - Cube mapping made easy.

In other news, the site will soon celebrate its first birthday, new hosting was secured and the hit counter has gone crazy over the last few as the 50k hit approaches. Celebrations all round. Happy New Year everyone!

dowload zip file Enjoy the simplicity of this Clicky.

High Dynamic Range Rendering

14 October, 2007 - High Dynamic Range Rendering

HDR made easy

The concept of High Dynamic Range rendering, or HDR for short, represents one of the many reasons why real-time renderings are more impressive than ever before. Thanks to video hardware evolution, implementing HDR, and post-processing effects in general, has never been easier.

This little gem implements HDR by rendering the scene to a master Frame Buffer Object (FBO). This master FBO is then processed through a high pass shader filter that only captures the highlights of the scene. The output of the high pass filter is saved to its own FBO. Next, three downsampled FBOs are created. These four (the original high pass FBO plus the three downsampled FBOs) are then blurred together before presenting the HDR scene to the final frame buffer.

Obviously for this sample to work with your setup, your video hardware must support FBOs and support Non-power of Two (NPOT) texturing.

dowload zip file As always, have fun with the ease and simplicity this simple sample. Clicky.

Oily Film Effect

28 September, 2007 - Oily Film Effect

More OpenGL and GLSL

Recently I've been intrigued with NVIDIA's FX Composer, and while it's a great tool it lacks native GLSL support. Anyway, I was really impressed with the new shader library, however many of them have visual artifacts that are easy to remedy. For example, the Film effect is both a quick and easy shader to implement, but the original shader suffers from texture wrapping artifacts because the texture coordinates are not clamped.

After converting the original shader into pure GLSL and simply clamping the texture input into the fragment shader the artifacts disappeared. How easy was that?

Yet again, this example also shows the usefulness and effectiveness of one - dimensional textures (or texture lookups). This is truly an easy shader to implement into any scene with no additional requirements, so what are you waiting for? Give it a try.

download zip file Hope you enjoy the ease and simplicity of the Visual Studio Project (.NET 2005) windows and GLUT build Clicky.

Jump to Start Page: 1 2 3 4