In FxGen 0.6, operator's properties change (properties added or removed) are managed manually by developer in order to keep compatibility with older files versions.
A NMapVarsBlocDesc structs array are added to describe operator's properties change from previous version.
Example when a new property is added (see 'Type'):
static NMapVarsBlocDesc mapblocdescBlurOp[] =
{
MAP(1, eubyte, "0", "" ) //V1 => 0-Width
MAP(1, eubyte, "1", "" ) //V1 => 1-Height
MAP(1, eubyte, "2", "" ) //V1 => 2-Amplify
MAP(2, eubyte, "0", "*0.0039215" ) //V2 => 0-Width
MAP(2, eubyte, "1", "*0.0039215" ) //V2 => 1-Height
MAP(2, eubyte, "2", "" ) //V2 => 2-Amplify
MAP(2, eubyte, "3", "" ) //V2 => 3-Type
};
static NVarsBlocDesc blocdescBlurOp[] =
{
VAR(efloat, true, "Width", "0.01", "NFloatProp") //0
VAR(efloat, true, "Height", "0.01", "NFloatProp") //1
VAR(eubyte, true, "Amplify", "16", "NUbyteProp") //2
VAR(eubyte, false, "Type", "0,[Box,Gaussian]", "NUbyteComboProp") //3
};
---
Now in FxGen 0.7 all this operations are transparant for developer and are managed by binary serializer.
In each fxgen project file, all class's properties declarations are saved (name and type).
So I can detect now what properties are added or removed with current version while reading an old file format.
Another optimization done for fxgen 0.7
now for the same test, I used only 3000 ko for processing...
I compare memory usage between FxGen 0.6 and 0.7 engine.
I generate a 256x256 texture size from MetalGrid1 example.
Results:
memory usage:
FxGen 0.6 => 7284 ko
FxGen 0.7 => 4300 ko
Great :-)
New FxGen operators engine is now ready:
- Designer code part have been removed (will be moved to designer tool).
- NOperator classes removed and replaced by simple C functions (less memory usage).
- Engine take now only compiled operators call in entry (generated from operator graph compiler)
- Multi cores operators process ready. (see later openCL or OpenMP)
I'll work now on my designer tool, with libraries management...
Alan McGovern (Mono Team) help me to optimize Gradient function. Now I have Mono.SIMD 3x faster than Mono 4DFloats ! But 2x less speed than new C++ version ....
The good thing is that Mono.SIMD version is now faster than 4DFloat C++ code.
I have done some performances tests:
The goal is to generate a 4096x4096 gradient texture (same as fxgen 'Gradient' operator) in order to compare C++ and C#.
I use mono 2.2 C# compiler under windows with and without new SIMD extension! (Thanks to Miguel de Icaza)
Results tests in ms:
In MS C 235 (VS Release Mode SIMD)
In MS C 360 (VS Release Mode 4D Float)
In Mono C# 453 (With Mono SIMD)
In Mono C# 562 (With Mono 4D Float)
In MS C# 609 (VS With 4D Float)
In MS C 672 (VS Debug Mode)
Then main idea is to see if a 100% C# version of fxgen could be possible.
That could allow users to create their own operators directly into the editor in C# script.
This operators could be write in C# then compiled and optimized by mono JIT for target CPU.
SIMD extension for Mono is really a good idea...
I work on a compiler for fxgen’s operators graph, the goal is to separate designer from runtime generator code. That will speed up operator’s calculation and reduce yet project file size.
After that, projects saved in compiled format could be used in games or as libraries. We can image base textures libraries (bricks, stones, metals…) imported and modified by artists in several games.
I look at .net framework too and I think to do functions bindings for use textures in C# projects.
Game industries use more and more C# for their tools, so it’s may be a good idea to think about a new operators editing in order to provide designer functions in C#. That allows developers to integrate fxgen operators editing directly in their tools. I think to do some samples.
Package at => https://sourceforge.net/projects/fxgen/
.Editor
Rewrited for new GUI.
Operators global view display (if any operators out of screen).
New color picker in HLS format.
.FxGenLib
Runtime class creation by modules added (futures plugins .dll, .so ..)
Better FxGen Serialization.
Added Stacked Errors tracer.
.GUI
New GUILib now oriented Cross-platform using OpenGL.
I have worked on my own cross-platform GUI, rendering is done now with opengl for cross platform support.
So why don't use others GUI API?
Previous version of fxgen already use win32 API wrapper classes and all editor's controls are customs. So after some try with widgets or qt4, my feeling is that it's easier and faster to do my editor with more adapted GUI classes to FxGenCore architecture (see PropertiesCtrl...), for QT4 or Widgets that ask me more work but from my previous GUI all that I need is to replace Win32 functions to cross platform form...
So Next FxGen 0.6a version in July.
FxGenLib
-------------
.Removed MS windows dependencies (use of standart C functions)
.GCC compilation support.
.Added textures garbage management.
.Operators graph scanning optimizations.
.Resources detail management
i.e For textures, process them for size * (x0.5, x1.0, x2.0, ...)
.API to use FxGenLib in other applications (games, demos... see 'BMP Extractor' example)
.Vector graphics renderer using 'Cairo'.
.Added and improved operators (SVG support ...)
.see Operators.txt for details.
Editor
---------
.New main submenu items "options" for textures details
.3D textures Visualization.
.Custom popup menu (OpenGL GUI preparation)
.Alpha support for color Type.
Main Change
----------------
.Any textures sizes management
.Operators parameters version management
.Compilation changed from Static Library to Dynamic (DLL)
.NArchive now support Memory and File Stream
.Added a color picker
.Added TGA Writer at viewport context menu
.Added Bilinear filtering On/Off at viewport context menu
New Operators
-------------------
.NLerpOp
.NThresholdOp
.NAlphaOp
.NNoiseOp
Changed Operators
-------------------------
.AddOp support different texture size
.Addop's bitmap had the first input operator's bitmap size.
.Other inputs have their size cropped.
.Alpha mode now blend alpha sources values only
.Now More than 2 inputs can be managed (source texture, normals, specular, ambiant)
.FlatOp, CellOp, CloudOp and GradientOp
.Added Width and Height
.RotoZoomOp
.All parameters changed
.ubyte to float
.texture resize
.x and y zoom factors separated
.Can change texture size now
.NColorOp
.Box and Gaussian Filters Types
.NLightOp
Now support input Specular operators too
.NGlowOp, NRect
.All parameters changed
.ubyte to float
Removed Operator
-------------------------
.NSetSize (now see RotoZoomOp)
Fixed
-------
.'A' button bug on properties control