Tuesday 29 March 2011

Some technical thoughts

Hey, here Emmanuel:
Ofer asked me to do some posts about the technical elements of the project so we can share it with the people reading this blog, and hopefully giving us feedback.
Ok, I will start with a small introduction. Currently we are developing 'apoptosis' using vvvv and DirectX's shading language HLSL. This decision was made after some weeks trying out different options. On one hand we had the chance to develop the project using QuartzComposer or Jitter, both of available on mac, the platform Ofer and myself are used to work with. In particular I was fond of the idea of using QuartzComposer as it has a fantastic GLSL(openGL shading language) interface and performance, altogether with the possibility of writing plugins using objectiveC, a programming language(more a C extension) that I find very friendly and elegant. It also had a nice and 'cute' mac-ish look.
However I have been interested in trying out VVVV as it uses the amazing DirectX API for rendering visuals. Let's face it, OSX really needs to update their OpenGL implementation as it is missing a lot of nice features. I had some experience with vvvv but since some months ago I started diving on the HLSL dialect, a fundamental feature of vvvv. I am amazed how closely shading is related to the way the system renders the visuals, it almost feels that you need to 'cross' a shader before it reaches the rendering screen, i love it! For my surprise I found HLSL very direct and clean, even more that GLSL. I love the idea of having 'techniques' inside the shader so you can decide the combination of vertex and pixel shader you want to use. By playing with some shading technique you can get superb effects: depth of field, blurs, post production shaders, lights, materials, etc. Also using HSLS allows the access to amazing shading libraries and resources; for instance the last month I started porting some shaders from the NVidia library into vvvv with an almost 'out of the box' approach. It is not surprise that DirectX is so well supported as it is the foundation of the game industry.
Another nice feature inside vvvv is the possibility to use c# to develop plugins. This has been my first experience with this programming language. I am still wondering why they call this language c# and not java# or something as the similarities between both languages are shocking. It reminds me the way java plugins are managed within Jitter. There are a lot of possibilities here for implementing physical behaviors and complex systems. For 'Apoptosis' we have just used a slightly portion of that power but I am sure we will develop more and more implementations using this approach.
We are still dealing with this animal, sometimes worrying more about system related issues and optimization. We are testing our patches on 3 different computers and, as Windows operates under a non-defined hardware basis, we also have noticed some differences in the way different hardware GPU behave. ATI and NVidia seem to react differently to some parts of our code. It is a every day learning process…and we are having fun!

2 comments:

  1. good thoughts, but can you add some paragraphs to your text. very hard to read.

    ReplyDelete
  2. Hey Valentin, thanks for the feedback. Can you let me know which parts do you find more difficult? maybe I can elaborate from there…
    -emmanuel

    ReplyDelete