Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.

Archive for February, 2014

Week Five: Restructuring and Evolving

During week five things really started to come together and my face was shaped like this, :D, at the end of the week.

I remade the structure of the particle system abit. I erased the existance of what I called particle groups, so now all of the particles that have transparency is sorted together ll of the transparent particles are now located together and are sorted after every other transparent particle. Later I will also add that paricles also are sorted into transparent paricles, that needs sorting, and non transparent particles, that doesn’t need to be sorted (at least not every frame).

I also made created the basic layout for the three different type of editors. Right now they’re all located in the same project, but I will later split them up into three different projects as it will work better with how I’ve designed some parts of the system, and the other parts really don’t care one way or the other. As it will only improve things by making them simpler, I see on reason why I should not do it.

I did also implement the first (and I got to admit, somewhat sucky) version of the morphing system. Right now the particle emitters can only¬†instantaneously change from one type to another, and i hope that I will have time to implement some sort of interpolation system between the different shapes (mainly because I think it could turnout pretty cool ūüėČ ).

As I’m writting this at the start of the sixth week (Monday) I can also tell you that the movments of the particles are now calculated on the GPU through the use of¬†¬†OpenCL.

During the rest of the sixth week I’ll be giving the system a new feature, namley the ability for particle emitters to emitt other particle emitters, and I got to tell you I’m really looking forward to this one :D.

Until next time, be cool and stay in school ;).

Week Four: The particle system’s taking shape

This week I started implementing the particle system that will power the final version of the delivered demo. I’ve managed to implement all of the functionality that I entended for the system, exept for the emitters morphing conditions. So according¬†my time plan I’m still in good shape, which feels awesome.

There is however a problem with the systems current design, and¬†unfortunately I only realised that when I basically had finished its implementation. Again the problem has to do with the transparency of particles. All the particles are divided into groups that are used to keep track of all of the particles information. I then render the paricle groups individually, and this is where we find the problem. All of the particles in each particle group are sorted by their distance to the camera and are rendered correctly, and the different particle groups also gets sorted by the distance to the camera. This works really well as long as two groups don’t enter each others personal space, because the particles in different particle groups never gets sorted which means that some of the particles will be rendered in the wrong order. In¬†hindsight I should have realised that this would be a problem as I faced the transparency issue when i made the prototype. But as luck would have it, I think I have a solution¬†for this blunder :).

Unfortunately I woun’t be implementing my transparency solution next week, as I feel I need to think about it some more to really make sure that it will work. So next week I will instead start making the GUI for the editors. There will be three editors in total, one where you can create different particles, another where you can create the particles emitters, and one where you can test the different particle emitter and particles that you’ve made together. I’m confident that I’ll be done with the base of the editors that I can expand upon as the project develops further really early in the week (Monday or Tuesday morning), or rather I need to be done with them by then as I’ll also be implementing the emitters morphing conditions next week, which I have a few ideas for and would like to test them out to see which will work best.

I will tell you more about the particle system in the future, as i feel that it still might happen a lot of changes to the its final design. So bare with me because, as they say, good things comes to those who wait, and this is one of those times ;).

Fixed the Transparent Rendering Issue

As I explained in the thried week  project update post, I had an issue with the rendering of the transparant billboard particles I made for the prototype. Click on this link to read the post.

When your rendering transparent objects they need to be rendered in a specific order, namely, the object furthest from the camera needs to be rendered first and the object closest to the camera last. If you don’t do this then some of the particle fragments generated by the rasterizer will never reach ¬†the framebuffer and their colors woun’t be blended into the final image that ends up on the screen.

The solusion (which I’m 100% sure is not close to optimal) ironically came to me when all of the students was presenting what we’d done during the second and third weeks our projects, the preproduction and prototyping weeks. Instead of sorting by the distance from the camera to the center of the particles, I just transformed the particles position in world space to view space, and sorted the particles after the resulting z coordinate. I’m going to give it some more brain crunching time and I will hopefully come up with a better solusion.

Until next time, stay awesome ;).

Week Three: The Prototype Editor

As you probably got by the “subtle”¬†clue hidden in the post headline, I spent this week making a simple prototype particle editor, where I tried out some of the parameters that a user will be able to play around with in the final version of the program. The prototype has one type of particle and one type of particle emitter, but they’re located in the same editor. In the final version I’ll have one editor for the particles and another for the paricle emitters.

In the prototype you can modify the amount of particles that gets emitted every frame, how many particles that are alowed to be active at the same time, how long the particles will live after they’re born (in seconds, should parbably have written that in the GUI description, oops), the size of the particles, the direction they’re emitted, the velocity the particles are emitted with, and by the maximum angle that the particles emittion direction can be tilted by (it’s chosen at random).

For the prototype particle I decided to implement a billboard that has a texture with an alpha channel making parts of the billboard transparent. A billboard means that the object will constantly be facing a given target, in most cases (also in this case)¬†the target is the camera. So a viewer will always see the same part of the object. One thing that I didn’t know when i started was that when using transparent objects the objects needs to be draw in a specific order, namely the object furthest form the camera needs to be rendered first and the object located closest to the camera must be rendered last. If this criteria isn’t meet the object closer to the camera will overwritte the pixels of the objects located furter from the camera instead of blend with them. This becomes very apparent in the demo if you increase the size of the particles. This is because the distance form the particle to the camera is calculated from the center of the particle billboards, meaning that if two particles are very close together but the differnece in the positions y coordinate is relatively large, the particle that should be located behind the other particle can get a distnace that’s closer to the camera then the particle infront of it.

After I did those test programs in OpenCL last week I also realised that i need to design my particle system using a data oriented¬†approach inorder to efficient transfer¬†data from the host program to OpenCL. I also decided that I’ll use TinyXML-2 which is a free XML parser written by Lee Thomason to load and save data about the particles, particle emitters. I’ll also use it to load the different textures that the user can select for the particles and most likely for the shaders aswell.

If you want to try the particle demo you can click on the milestone two link in the upper right corner and navigate to the TestPrototype folder and click on the file, or just click on this link, I’d choose the later:P.

Next week (tomorrow) I’ll start to transform the prototype into the alpha and the omega version, whish me luck:).

The First and Second Weeks

Week One


During the first week of the project was dedicated to research and planing. The research was about what programs/frameworks I was going to use to create my particle system, but also trying to find out more information on different ways particle systems can be implemented and get some ideas that might improve the design I had in my head.

I made a project plan that includes the project goals, what the programs/frameworks I’m decided that I was going to use, a time schedual so I will know if I’m starting to fall behind, or if I’m¬†actually working better then I expected I would.

So what did my research lead me to. Well I decided that I was going to use Qt to design the GUI for the resulting demo I’m shooting for, because I’ve used it before during my studies and come to know it quite well. I’m going to use ¬†OpenCL for my GPGPU programing. Mainly because I’m curious about the language and how it taps into the powers GPU, but also because of its cross-platform support and its always good to try something new. I’m going to use GLSL to do the rendering, the reason is the same as with Qt, because I’ve used it on multiple¬†occasions during my time studying at this program.

More information on what the project is about is located at the “About the Project” section, or just click here.

Week Two


I started the week by doing a little more research and finishing up on some of the documents I needed to fill out about the project. Which all can be found by clicking at the Milestone 1 link at the top right of this page, or you just click here.

I also compleated a couple of quick tutorials on OpenCL, so I feel like I’ve at least got the basics down and how the basic parts of the framework relate to one another. I also created a basic setup for the program, but because I was dome with the basic setup in what seemed like no time at all, I started working on some ¬†next weeks tasks.


Next week (tomorrow), I’m going to start implementing the particle system so I’ll start bringing you some more information on the actual project topic, the particle system. So don’t go anywhere, the fun is just about to begin;).