OpenCL Particle System
Sunday, March 28, 2010OpenCL Particle System
The project is now concluded. The only things that happened to the project since my last blog entry is that the particles now have a better texture (which kind of looks like smoke, as in the picture) and project has been shown off at milestone3.
All the documents are available through the links on the side, now including a how-to with retrospect, the executable application and some demo movies.
Sunday, March 14, 2010OpenCL Particle System
The project is moving towards its end – and things are looking promising. There are now some adjustable values in the demo application. The attributes are the common ones in most particle systems for making decent looking particle effects.
The following behavior values are adjustable:
Velocity (min and max, random between them)
Lifetime (min and max)
Number of particles
These will be added the upcoming week (in the visualization tab):
Color & alpha
Unfortunately, it’s now obvious that I will not be able to complete everything. The Screen Space meshes algorithm will not be disposed at all, and Lennard-Jones Potential particle interactions will be limited due to incomplete spatial hashing and lack of GUI options for it. This is not fatal though, since the topics in the original plan/proposal have been covered, and I feel pleased with the project.
For the upcoming week I’ll add some additional visualization options (the three listed above), and write some documentation (the mandatory tutorial and possible some doxygen) . I will also look into the possibility for showing off the system live at milstone3.
Sunday, March 07, 2010OpenCL Particle System
I’ve written the spatial hashing the past week. My particle kernel, however, isn’t using it for the moment though, so I’m not sure if it’s working completely – but it’s likely. Some basic GUI functionality has also been added.
The screen space meshes has reach a dead stop, but I spoke to Johannes (one of the tutors for the projects) and he said I should give priority to the particles’ behaviors rather than visual appearance, since there’s only little time left, which sounds reasonable. Thus, for the upcoming week I will focus on completing unfinished features, and wrap up what’s almost done.
Sunday, February 28, 2010OpenCL Particle System
It turned out to be more difficult than expected to implement the screen space meshes algorithm. To be honest, I’ve not done much progress. The depth map is soon done though, and I’ve began look into silhouette detections, but there’s a lot of work left before it’s completed. For the upcoming week I will continue working on this, and hopefully get it done before I get too far behind in the schedule..
Sunday, February 21, 2010OpenCL Particle System
The schedule has been slightly changed since last week; the order which things will be completed has been updated, but the final goal remains the same. The reason for this is that it has been now determined how the particles are going to be visualized in the demo application - by using Screen Space Meshes - which is logical to complete early for the promotion of the framework and the corresponding work. See the project plan for more information.
According to the original plan, the past week’s progress would involve the following part: basic GUI implementation, spatial hashing and code cleaning (and make attributes changeable during run-time). Instead, due to the schedule change, I’ve completed the code cleaning and began with implementing the Screen Space Meshes method. At first I went for a CPU implementation, but then threw it away for a GPU-based.
For the upcoming week I’ve planned to work fulltime with the Screen Space Meshes, as it also consists of researching (i.e. paper reading) and might cause several implementation-related issues. If things turn out as expected, it should be completed by the end of next week.
Since the recent progress has been technical improvements and “behind the scene” progress, and no changes in visualization, no new pictures has been added to the blog for this week.
Sunday, February 14, 2010OpenCL Particle System
I’ve begun implementing interactions (forces) between the particles. This will be done using Lennard-Jones potential – a mathematical model that describes the interaction between a pair of atoms or molecules. It’s currently done in n^2 complexity, which makes it very computational heavy with only 1K particles. To speed it up I will look into spatial hashing later the upcoming week.
Tomorrow is the milestone 2 presentation, and I will show off a proof of concept movie I’ve prepared which shows what the framework is capable of so far. It’s available in the public section.
For the upcoming week I’ll be cleaning up the code, make it possible to change the particles’ attributes during runtime, and look into the spatial hashing.
Sunday, February 07, 2010OpenCL Particle System
During the past week I’ve been experience a lot of problems. The main issue right now is that I’m unable to run my application – without the operating system to freeze! This has lead to several hours of running check disk; I have to cut the power to restart the computer which causes corrupted project files. This might be caused by some kind of bug related to the OpenCL drivers, which somehow is triggered by my application – but it’s quite tough to solve the issue as I’m unable to run the code. However, it seems that the problem only occurs on Windows XP (while Windows 7 is unaffected), and thus I’ll bring my Win7 laptop at Monday, and work it out.
The past week has (luckily) not only been about problems though – I’ve also made some progress. My particle kernel now receives several particle attributes, and the particles burst out from the emitter in a spherical form. I’m sending an array of a structure containing all the particles’ attributes, so it’s quite easy to add additional ones if required. This means that I’m done with the prototype (as soon as I’ve fixed the bug) which was originally scheduled for milestone two – i.e. one week earlier than expected.
I’ve read a couple of papers about working with fluids using particle systems, but I haven’t made any real progress about it yet. I would prefer an algorithm which is adaptable for both smoke and water. I also ran into the parallel sorting algorithm “bitonic mergesort”, which I have never used before, that will likely come handy.
I will upload a picture of what I’ve done so far as soon as the application allows me to do this, without my computer to like… die.
Update! Image is now available!
Sunday, January 31, 2010OpenCL Particle System
During the past week I’ve been doing a lot reading into OpenCL demos. I’ve also began working on the prototype for milestone 2. The application so far shows a small window with a decent amount of particles moving along in a given direction. It’s also possible to move around using a free cam. The particles’ positions are updated on the GPU using OpenCL.
To render the particles I’m currently using a VBO, with its vertices-array set to the positions of the particles, and then rendered using GL_POINTS. They may also be drawn by sprites, if wanted. This method is quite sufficient in regard to performance, but might not be the optimal approach for my project. This is because I’m not quite sure how to apply transformations (rotation and scale) to the points, and secondly it would be pleasant to have the particles rendered as meshes instead of sprites. I’ll go through with this for now though, and might go back and revamp it later.
In aspect of the time-schedule it seems that my project is going well so far, and there have been fewer problems with getting started than expected, which seems promising.
For the upcoming week I’ll be focusing on adding attributes to the particles – e.g. lifetime, direction etc. I’ll also start thinking about how to calculate attractive forces between them, without making it too computational intensive.
Monday, January 25, 2010OpenCL Particle System
The past week has mainly been about researching and collecting information, both about OpenCL and GPGPU-programming in general. As a part of this, the first version of the project plan has been completed.
As the research shown so far, writing programs which are executed on the GPU differs significantly from more traditional programming (yet, nothing else was ever expected). I’ve found a couple of documents which should be enough to get started.
The next step, in line with the time schedule, is to set-up a visual studio project, configure dependencies, and make some small experiments and demos with OpenCL.