July 2011
5 posts
9 tags
Daily DSP tip :-)
So, I played a bit with software synthesizers in the past and last week I took the project up for revision. Doing so, I came up with the following easy waveform generators: Sine: double wave_sine(double x) { return sin(x); } Square: double wave_square(double x) { return (abs(x)-floor(abs(x)))<0.5?-1.0:1.0; } Saw tooth: double wave_saw(double x) { return (abs(x)-floor(abs(x))); } Triangle:...
Jul 21st
5 notes
9 tags
Jul 8th
4 notes
9 tags
WatchWatch
I gathered a few of my PC Demos in a single play list on Youtube. Watch and enjoy :-)
Jul 4th
6 notes
5 tags
Jul 3rd
6 notes
8 tags
Easy Frame Buffer Object class
So, I’ve been fiddling a lot with frame buffer objects lately. And before you get to it - Yes, I know I’m several years behind :-) For those of you who don’t know what Frame Buffer Objects are - they are frame buffers stored in your video memory which can be used as any other texture in OpenGL. It replaces the insanely slow glCopyPixels which copy an area of the current context...
Jul 3rd
11 notes
June 2011
3 posts
½-page - second try :-)
So, here is my second try at using shaders in less than a half page of code. My first try used both SDL and GLEW which could be considered “cheating”. Second time around I use “raw” Win32 API and OpenGL to make everything work. Everything in 36 lines. #include <windows.h> #include <gl/gl.h> #include <gl/glu.h> #include "glext.h" #include...
Jun 20th
3 tags
Shaders in ½ page?!
So, I read on a Danish webpage that it’s not possbile to initialize and setup shaders in less than a ½ page of code. With this in mind I tried taking my engine code and cut off the bells and whistles - leaving nothing but raw code and no safety net. What it does is: Set up fullscreen 1024x768 in 32bpp Load and compiles vertex shader from file Load and compiles fragment shader from file ...
Jun 19th
3 tags
Jun 8th
5 notes
February 2011
3 posts
3 tags
Fish-eye rendering et al
So, I’ve taken some time off from work for the vinter holidays here in Denmark. These periods normally results in two things: 1) next to no computer interaction and 2) heaps of new ideas spring to mind. I’ve been thinking of doing fish-eye and polar rendering for a while. And just the other day the most simple and straight forward technique came to mind. Back in the old 2D-days I...
Feb 17th
1 note
2 tags
Part #5: Slow mover
In this post about my work place I’ll look at the pace the organization is able to change direction with regards to processes etc. Just looking at the size of the development organisation of 2.000 combined with the conservative image will paint crawling images of painfully slow development cycles. When I first joined the company a raid of CMMI and a RUP-infested evangalists were crusading...
Feb 9th
2 tags
How do you make a demo?
I’ve seen a multitude of tutorials on how to code actual demo effects; but I’ve never seen a clear article on the creative process that generates the demos. Here is one! In todays post I’d like to give you all a short insight in my creative process of making demos for competiting at parties. I suspect that my way isn’t the ideal way, however it works for me and my busy...
Feb 1st
January 2011
9 posts
1 tag
How to code a 4k intro
Coding a 4k intro is a matter of discipline and code magic. You have to be very good friends with the development environment you are working with and know it’s inner details. My work flow for coding a 4kb intro is either to go back to my source folder and just delete the effects and start over - or start from scratch using some of the ready made frameworks available on the net. The...
Jan 27th
6 notes
2 tags
Part #4: Ancient development environment
The technology is old alas the surrounding tools must be just as old. This is actually true. We have heaps of tools that requires access via 3270 terminal software to the mainframe. In addition, we also have a range of Windows based tools.  As many of you know, the financial industry is sleeping tight with IBM when it comes to technology and tools. On the development tools this means that we...
Jan 26th
2 tags
Part #3: Everyone is old?
Working with mainframes every one is bound to be old, right? Well yes and no. During the life time of the IT department there has been quite a lot of expansion. The official figures are currently 2.000 in the development department - and I’m pretty sure this has increased dramatically since 1980s. In my department the majority of developers are around the age of 30 (give and take 5...
Jan 25th
2 tags
Part #2: Conservative work environment
If you google the word “conservative” it’ll give you a range of definitions such as “resistant to change”, “avoiding excess”, et. Which are all plausible when looking at the IT-department of a bank from the out side. Most applications are ran on mainframes and written in Cobol and PL/1. That’s a technology which has had little change since...
Jan 21st
2 tags
Part #1: Real life experiences
Working in the development department of the largest financial institution in Denmark has many facets. The strongest aspect is the social part and the informal atmosphere. Before joining the bank I had the default set of prejudices against the financial sector: Conservative work place Every one is old Ancient development environment Slow mover Instead of just babling on, I will comment...
Jan 19th
5 tags
Code snippet for loading textures
Yeah, well. Loading textures is something that has to be done and over the years I have used a variety of different image loading libraries like devIL, sdl_image, etc. They are all great but mostly require an extra external dll residing next to the compiled binary. To remove the dependency on external dll’s I’ve found a public domain image loader by Sean Barett. It loads jpg, png,...
Jan 15th
1 note
6 tags
Entry for Tokyo Demo Fest
This weekend featured one of the first japanese demo events with lectures, competitions and socializing. I didn’t personally attend, but I created a demo with Klaus Lunde and Mogens Skjold. When building a demo I tend to follow an unusual path (atleast from what I can read on the blogs of Smash/Fairlight and Navis/ASD). The process is usually like this: I contact a musician that has the...
Jan 10th
3 notes
3 tags
Jan 6th
1 note
2 tags
Tool of the day
Todays most awesome tool is small, efficient and does its job very well. It’s called “Dynamic Log Viewer” and is a log file viewer. I use it all the time. Associate any .log file with the application and you’re hooked. The most awesome part of the tool is the ability to dynamically update the view as new lines are added to the log file. This means that I can monitor...
Jan 5th
December 2010
6 posts
3 tags
Render to texture - frame and render buffers
I finally got to the point where I needed to upgrade my render to texture routines. For a long time I’d copy the pixels from the video ram to conventional ram which consumes quites some cycles and loweres performance considerably. This is of course oldskool and not a good idea (performance wise). In addition, the method was limited to handling quadratic textures in power of two sizes (e.g....
Dec 29th
2 tags
Most useless javascript
I’m pretty sure that most of you have seen the YouTube movie about the most useless machine ever build. Below is a script that does exactly the same - just without the gimmick and thus not quite as funny as the YouTube original :-) Link to most useless machine / javascript
Dec 27th
1 note
2 tags
Shader fiddling
Once in a while you just want to get away from big projects or major design choices  and get back to basics. In my case this means plotting simple pixels on a blank screen. However, I am a modern person and plotting simple pixels on a blank screen no longer means direct access to VGA memory at 0A000h. In these days of GPUs and modern APIs there is no such concept as a simple pixel (well there is,...
Dec 20th
3 tags
Follow up on scoped OpenGL
Ah, yesterdays post seemed to stir some of my readers - always nice to observe other peoples reactions to my thoughts. The two major concerns I met were: “The macro at the bottom will impact my code - I have to fragment a whole lot more than I would like to!” “Using the scoped definitions I am no longer able to enable/disable features on a per line basis” Ad 1) Well...
Dec 15th
3 tags
Use the compiler to keep track of OpenGL
In a world of rapid development and an emphasis on lowering bugs and perhaps not specifically speed - I have found it usefull to take advantage of the C++ stack for keeping track of my OpenGL states. Sounds weird? Well, yes. Reviewing 10 years of OpenGL code has boiled down to heaps of enable/disable and begin/end statements covered with late night debugging figuring out why stuff doesn’t...
Dec 14th
1 note
5 tags
Translating mouse clicks
Building user interfaces for games or other applications for PC and Mac requires input handlers for mouse, keyboard, etc. I often tend to forget how easy it is to unwrap the 2D-mouse coordinates into 3D-screenspace coordinates. Below is a snippet that I use - it takes 2D-screen coordinates as inputs and unprojects using the model view and projection matrices. As a little bonus it will read the...
Dec 14th
1 note
November 2010
3 posts
3 tags
First game play test
I tried the prototype on my 3 year old kid. He enjoyed the game alot and found the 3D elements exciting. He also found some issues that I have to work out in future version. Rapid prototyping rules :-)
Nov 4th
4 tags
Nov 4th
5 tags
Choosing the right audio library is difficult!
Lately I’ve been interested in audio libraries and thus have tried a wide range - to be exact OpenAL, SDL_Audio, FMOD and BASS. Which library should I use for cross platform development? This really depends on what you want to achieve. If the goal is simply to have MP3 replay on many platforms - then I’d say that SDL_Audio is fine. However, if you need it for a game or something...
Nov 4th
October 2010
3 posts
4 tags
Old stuff released at TRSAC party
During the weekend of 22nd - 24th of October I released a few entries for the competitions. The material was found on an old hard drive that was left untouched since atleast 2005. I spent some time getting the sources to compile under Visual Studio Express C++ 2010 - and that was pretty much it. Demo competition: The Pink Brigade This was meant to be released around 2003-2004. It was a joke...
Oct 24th
5 tags
Presentation notes from JAOO / GOTO conference
Hi guys I took some notes during some of the presentations I saw at the JAOO / GOTO conference. I can’t say if they are of any value - but here they are (in Danish :-) Future of 3D graphics technology (Henrik Wann Jensen) Anderledes indlæg på konferencen. Snakker om udviklingen i 3D-grafik fra helt primitive 3D-verdener til aktuelle 3D-verdener i Avatar Henrik har arbejdet på...
Oct 8th
5 tags
Back in the real world
After a few days of hiding behind theoretic speeches and practical seminars I have returned to the real world. From monday till wednsday, I attended the local software development/engineering conference named JAOO. During the monday evening event the name changed to GOTO (which is considered harmfull). I totally agree with the name change, as Kresten motivated it by the fact that many people...
Oct 7th
September 2010
3 posts
4 tags
Few days till JAOO
I’ll be attending the JAOO conference in Århus from monday - wednsday next week. JAOO was originally a java oriented conference but has shifted to more generic development subjects which made it interesting for me to attend. It’s been 3 years since I last attended the conference and I have to say I’m looking forward to it. This year will be my 4th visit to the conference. The...
Sep 29th
3 tags
Doing visuals for 15 years ...
I have recently found a joy in viewing my old productions and suddently realised that I have been releasing demos and intros (audio and visual applications) for more than 15 years. My first real production was called Nope! and was released at The Party 1995. The Party was the first real big computer party. It had more than 3.000 visitors and occasionally rave parties in the sleeping hall. I was...
Sep 14th
3 tags
FSAA and SDL
It’s old news that enabling full screen anti aliasing will produce better looking result on the screen. And why is that? Well, mainly because of the subsampling technique. In essence FSAA 8x can be thought of as rendering in 8x resolution and scaling it back to 1:1 before displaying on screen. Look at the building below. The image was produced in 300x300 with no aliasing enabled. This...
Sep 3rd
August 2010
9 posts
4 tags
Simple fragment shader class
So, experimenting with shaders et al made me generate the following C++ class for handling the fragment shaders. It can easily be extended to vertex shaders (and to shader programs covering both items). It’s fairly easy to use: FragmentShader fs1("shaders/test.fs", true); // load from file FragmentShader fs2("void main(void){ gl_FragColor=vec4(0.0,1.0,0.0,1.0); }"); // load from memory...
Aug 30th
2 tags
Making flashy 3D look smart
Here is a neat trick that has gotten quite some attention after Crytek took it under their wings back in 2007. It’s called Screen Space Ambient Occlusion (SSAO). Using SSAO correct will present the images with a shading model which relies on the current view port.  Basic steps: Take the depth buffer of the current frame For each pixel in the buffer calculate the delta depth values of the...
Aug 25th
1 note
3 tags
Urgent: Summer Meeting 2010 →
Two weeks to go and I’ve already got 16 signups for my cozy garage event called Summer Meeting. It will be a fun weekend featuring demos and relaxed conversations.  Check out the webpage for more info!
Aug 16th
3 tags
Get rid of the damn start menu! →
I’m quite sure most of you know this - but Launchy simply rocks. Finding the stuff I need in my ever growing start up menu gets harder and harder every day. New tools are installed, sorted, filtered etc. Using launchy I am able to start any tool I want, simply by alt+tabbing and searching for the tool (e.g. alt+tab “vcex” start visual studio express c++ :)
Aug 9th
4 tags
The Pomodoro Technique →
Working in a hectic environment with heaps of e-mails going in, phones ringing, software failing and software being developed - I often find it useful to perform some personal planning. I am not working by a strict pomodoro recipe, however it’s a nice inspiration on how to structure the daily work while still being responsive to production issues etc.
Aug 5th
5 tags
Aug 4th
3 tags
Top 5 reasons to celebrate mistakes at work →
How does your workplace handle mistakes? Is it more like a celebration or a witch hunt? What has been your most spectacular screw-up at work so far? How did you handle it and what did you learn from it? Please write a comment, I’d like to hear your take.
Aug 4th
4 tags
Quick guide to setting up SDL on Windows
Hi all, SDL has proven to be one of the simplest ways of preparing a framework for coding OpenGL. It handles all the borring details of setting up windows and event handlers. Below is a source snippet that illustrates how I code my entry function in Windows programs: #define FULLSCREEN #define WIDTH 1024 #define HEIGHT 768 bool ShouldQuit() { SDL_Event e; while (SDL_PollEvent(&e)) {...
Aug 4th
5 tags
Render to texture
Hi folks, this is the first posting in a series of visual coding tricks. The first one is a primitive render to texture function that I often use. Rendering to textures can be used in a multitude of post processing effects - e.g. blur, radial blur, zoom blur, glow, etc.  Rendering to a texture is done as follows for each frame: Set up view port to fit the dimensions of the texture (Prepare) ...
Aug 4th