OpenBlackBox

 

                                       The inside is no longer the Dark side
Skip Repetitive Navigational Links

Docs

Will contain links to documentation.

Brief overview

The download has 3 projects.
OpenBlackBox is the core system.
OpenBlackBox.GUI.WinForms is the first GUI attempt (don't worry, there'll be others and better than this)
WindowsApplication1 is an example app that uses these two assemblies for some tests.

OpenBlackBox core
The main classes of OpenBlackBox are Boxes, Pins and the Graph. Same meaning as in DirectShow, although Filter is their word for my Box:

Pins define the interface of a Box - they're the connection to the Box's surroundings. They can receive data from, or transmit data to Pins on other Boxes.

Boxes use the data they receive from their Input Pins, process it, and then send the result(s) to their Output Pins.

The Graph is primarly a toolbox for managing Boxes and Pins - adding/removing Boxes, creating connections between Pins, analyzing the "topology" and properties of the setup, save/load etc.

Random notes:
  • A  Box can have any number of inputs and outputs.
  • Pins are typed, that is they can only transmit one kind of data. Currently I've only implemented string, float, canvas and gradient types.
  • A Box will start processing once all its Inputs are ready.
  • There's currently no "pull" functionality - a Box can't force another Box that is connected to its input to start processing. This makes realtime video difficult.
  • Recursive graphs are allowed

Tutorials

Will contain links to tutorials.

Using the system from code can be as simple as this:

 

            //Create the renderer. Can be GDI or Direct3D (later possibly OpenGL).

            //(Only Direct3D supports GPU shaders)

            Endogine.StageBase renderer = Endogine.StageBase.CreateRenderer("Direct3D",

                this.panel3D, System.IO.Directory.GetCurrentDirectory() + "\\");

 

            //Create a OBB Graph, and provide it with the renderer:

            graph = new Graph(renderer);

 

            //Create boxes. First a Box that just creates a 200*200 bitmap:

            graph.Add(new EmptyBitmap(200, 200, 3, false));

            //Then add a Noise Box. AddAndAutoConnect() tries to connect the new box to the existing graph.

            graph.AddAndAutoConnect(new Noise());

            //Add NormalMap and Light Boxes:

            graph.AddAndAutoConnect(new NormalMap());

            graph.AddAndAutoConnect(new Light());

 

            //Tell the graph to analyze its contents, to find Start and End Boxes, possible recursions etc:

            graph.Analyze();

 

            //Optional: Create a graphical interface for looking at the graph, and debugging.

            OpenBlackBox.GUI.WinForms.GuiGraph gui = new OpenBlackBox.GUI.WinForms.GuiGraph();

            //Tell the GUI where to render its contents:

            gui.ParentControl = this.panel1;

            //And connect the Graph to it:

            gui.OBBGraph = graph;

 

            //Execute the whole Graph immediately:

            graph.Run();


This code corresponds to the screenshots of Noise/NormalMap/Light in the gallery.