Skip to main content

Posts

Showing posts from January, 2010

Volumetric lines 2

I promised I was going to do a follow up on the Volumetric Lines episode, so here it is. Like I said, it was very easy to change from regular lines, to using volumetric lines in PewPew. In fact, I already changed once the way lines are drawn: the early versions of PewPew used SDL without OpenGL, so the lines were drawn in software using the good old Bresenham . Switching to OpenGL forced me to reduce the coupling between the renderer, and the game engine. Here is all I had to do to make the switch to volumetric lines, besides the initialization: #ifdef USE_VOLUMETRIC_LINES for (int index=0; index < numberOfVertex; index+=6) VolumeLineRenderer::getInstance().renderLine( &vertexes[index], &vertexes[index+3] ); #else glVertexPointer(3, VERTEX_TYPE, 0, vertexes); glDrawArrays(GL_LINES, 0, numberOfVertex); #endif Here are some new screenshots comparing the regular render to Sebastien Hillaire's one with different line width. Now this is running on a PC, not on ...

Automatic .caf file creation

As I said in the previous post, I am currently working on adding sound effects to PewPew 2. The preferred format for sound effects with OpenAL on the iPhone is the .caf ( Core Audio Format ), but audio softwares usually output .wav files. Fortunately, there's an easy way to convert one format to the other, using a built in command in OS X: afconvert -f caff -d LEI16@44100 -c 1 in.wav out.caf Being a programmer, I am lazy, so I started thinking about automatizing the conversion for all my .wav files using a small python script that would look like that: for every file in the directory: exec "afconvert -f caff -d LEI16@44100 -c 1 file.wav file.caf" But it was not going to be efficient: every time I would want to regenerate a single .caf file, the script would regenerate all of them. And then it hit me: makefiles are made to solve this exact problem. I tested my idea with a small makefile that looked like: test.caf: test.wav afconvert -f caff -d LEI16@44100 -c 1 test.wav t...

Happy new year

First of all, happy new year. For some, 2009 was the year of the Ox and 2010 will be the year of the Tiger. For me, 2009 was the year of PewPew, and 2010 will be the year of PewPew 2! In 2009, most of my time was spent on creating the engine and getting to know the iPhone. Now that the engine is done, I am almost exclusively working on the content: I am creating tons of new ennemies and even more levels. I say "almost exclusively", because I actually did improve the engine. I did an important (though obvious) optimisation regarding the collision system (Chromatic Conflict is smoother now because of that), I made explosions luminous, and I am in the process of adding sound effects. The light added to the explosions is just an expanding texture (not even billboarded) whose transparency increases until it becomes totally transparent. It's simple, but it looks real good, I can't wait to post a video. The sound effects are handled with OpenAL. OpenAL enables you to speci...