Node Edit a Graphical Programming Environment

What started it

Recently at work i had to start working on writing a DirectShow video codec. Since DirectShow is now pretty old i started off by researching the possibility of using other, newer, techniques. For example i knew there’s now the new MediaFoundation api. During my research i found out about DMO’s (DirectX Media Objects). DMO’s are classes that are generally implemented in a class library. These classes inherit from a publicly known interface, which makes them usable by other programs. Using COM you can even create instances of these classes from within another program.
The great part about this is that this is a great realization of  modularity. You can add / update these DMO’s without changing the software that uses them. You will then still affect that software without making any change to it. For example if you use one of these DMO’s in your program but the creator of the DMO finds a bug or knows how to do the actual implementation of the DMO better, he can update the class library and you get to benefit from this without having to make a change.

DirectShow Filter Graph

Lets visualize how you would use these classes with a very simple yet powerfull DirectShow FilterGraph. A FilterGraph is just a set of filters (DMO’s) that are connected to eachother. By combining multiple filters you can create a program. For example a simple video player would look something like this:
 On the left you can see a File Source filter. All this filter does is read data from your Hard drive and output this onto it’s output pin. Then you see the AVI Splitter which takes the File Source’s output data and splits it into video data and audio data. The remaining filters play the audio data over your speakers and show the video data on your screen (after decompression).
As you can see it only requires a couple of filters to make a simple video player. Each of these filters are very simple and understandable on their own as well. The benefit of this is that when implementing such a filter there’s little chance for bugs, and the filters are reusable too. For example we could replace the File Source by a Web Source which would enable us to play video from the internet.

The Idea

After learning these concepts they inspired me to start working on a proof of concept to see if this could be used to reach other goals as well. For example wouldn’t it be alot easier that if i want to make a simple program that i do this by connecting some sort of these filters instead of writing all the hairy code myself?
Well, lets try and make that possible. As long as we make the nodes simple yet powerfull enough we should be able to create a lot of different applications just by connecting them in a certain way.

Proof of Concept

Since i already have my game engine around i have a great framework to start with a quick test. Here’s what i came up with after a weekend:

 So what is all this? Well i thought that at the very least we would need three areas. One area for editing the graph (dark purple), one area that lists all available nodes (green), and an area that shows node properties. So what you see here is just a dummy graph (no actual node interaction yet) with a couple of nodes and how they could be connected.

Dont look at the graphical issues with the node names and pin buttons, i’ll fix those next post :)



©2017 Echo Gaming Entries (RSS) and Comments (RSS)  Raindrops Theme