From: Raphaël L. <rl...@ci...> - 2012-05-10 14:03:23
|
Here comes the heavy changelog. Compilation projects: Only Visual Studio 2008 projects, found in the "vc90" directory are up to date. Compilation was not tested on other platforms (compilers or OS), but Linux should be added back in the future. Compilation options are factorized in .vsprops files. The projects themselves (.vcproj) only reference those files and list the source files of the project. Release and debug builds are output in separate subdirectories of the "bin" directory (Win32.Debug and Win32.Release). Fixed some project dependencies. New 3rd party library dependencies: Boost signals2, Boost system and filesystem, Boost test (for auto tests in debug compile). General code: Removed some obsolete (and unused) code. Removed some superfluous spaces at end of lines. Sorry for the inconvenience when you display file differences... Fixed warnings issued by VC90's level 4 warning policy (especially unused variables and implicit destructive casts). Changed some default values for member variables for better behavior at object creation. Changed all mgErrors (that quit without a prompt) to mgWarnings (this needed some tweaks to allow following code to not crash). Notable classes: mgText, mgPuppet. Removed strcmp()-based dllimport/export discrimination as it did not work for some Pro-SiVIC components (was not supposed to work at all anyway). Replaced it by a more classic PROJECT_EXPORT constant definition, set through compiler's "-D" argument. Test was factorized in dedicated headers for large projects, stored as "projectExports.h" in the "inc/mgdll" directory. Console creation is now done explicitly in main.cpp instead of default.script. Default.script feature should be removed in the future. Added a few automated unit tests. Project is compiled and executed during debug generations. Source files are in the "test" directory. Former TestXXX projects are no more maintained (including new TestBullet project which was created as a first attempt to integrate the Bullet physics library in mgEngine). Added Boost signals to notify GUI when some operations occur, like scriptable creation or deletion, simulation pausing, etc. Currently these signals are only catched by Pro-SiVIC GUI. General OpenGL code: Fixed some values like glColor(), glLineWidth() and glPixelStore() not being reset to default value after temporary changes, which created seemingly random side effects in unrelated operations. Updated mipmaps computation from gluBuild2DMipmaps and GENERATE_MIPMAP_SGIS in favor of the new explicit glGenerateMipmaps() method. Should improve performance especially for dynamic mipmaps, and allows compatibility with floating point textures. Re-activated disabled features like rendering to framebuffers in some classes. mgCore (project): mgMath.h constant definitions moved to new mgBase.h file (to speed up build). Added NOMINMAX constant definition in mgGL.h to avoid declaration of min() and max() in some obscure windows header included by wglew.h. Moved directory parsing and config file loading functions from main.cpp to either mgConfig class or mgMisc.h. Added mgMainPath() function in mgMisch.h to return the first path from a .conf path string (to use for file output, as mgLookupPath was designed for input). Added "app path" .conf key which is automatically created with the mgConfig object, allowing to define paths relative to the application directory even when it is not the current directory. Initialized through mgGetAppDir() function in mgMisc.h. Added mgObject base class and mgObjectRegister static class to factorize all previous ClassName() (and List() in some way) methods from mgEngine and resource classes, and to allow generic object handling by the new property system. MG_OBJECT(type) macro should be used when declaring a mgObject child class, and MG_REGISTER_INSTANCE(type) in its constructors. Added mouse wheel support and improved joystick support in mgCore. Optimized mgVertexBuffer and mgElementBuffer destruction using a STL trick. There are still performance issues due to VC90 checked iterators, which should be disabled in the future. Added mgCompatibility class to automatically perform some object type and script command renaming on the fly. This has currently no use in mgEngine, but was needed for Pro-SiVIC because we renamed a lot of things. Actual call to this class is performed by mgEngine's ParseCommandLine(). Added mgResourceServer class to manage resources: see description below. mgSDLCore: Added mouse wheel support. Changed window name to "mgEngine". Added manual control over vertical synchronization, through "use vsync" .conf key. mgEngine (class): Actual Clear and Cleanup processings are now managed by the scene graph and the resource server (see their descriptions below). Added Stop feature, which resets simulation time to 0 and pauses the simulation. Added "session name", "simulation name" and "simulation id" features, which allow identifying the current session (ie. program execution, script name...) and simulation (id is incremented and name is reset when stopping simulation). Clear feature calls stop and resets session name. Removed "start paused" feature. Simulations always start paused now (as a Clear is performed during engine initialization). improved pause semantics: "pause" pauses the simulation, "play" plays it. "togglepause" keeps the old "pause" meaning. Fixed script saving and loading not working with files that have a space in their names. The list of viewports is now exported in scripts in the right order, through "ToFront" calls at the end of the script. Fixed "slowdown" feature's real time computation to reflect the actual real time frequency (there used to be a significant bias, getting 60FPS when 50FPS were expected). When calling a single scriptable name without command, its status is now displayed. mgScriptable (scene graph): Added a scene graph structure at mgScriptable level, that includes previous mgPositionable's MakeChilfOf structure and adds many other features. A detailed documentation may come in the future. Every scriptable has a parent and a root. The root defines its scope, the parent allows structuring scriptables in a hierarchy. Parenting (and by extension the MakeChildOf hierarchy) does not allow loops or references out of the object's scope. Scriptable creation and deletion (as well as the Clear feature) are now managed by roots instead of engine. This does not break any compatibility as there is a main root (automatically created by engine) and any other root is in this main scene graph. Root scope is used to create object compounds. When an object is created by another (its root), it is part of its subgraph and the root name is added as a prefix of the object's name, with a separating slash "/". When the root is deleted, all the subgraph is too. An object cannot leave its subgraph and cannot see objects in other subgraphs. Script commands can be called on subgraphs by giving the root as argument, in that case the prefix is ignored. This system is currently used for virtual cameras in the cubeenvironment texgen plugin, and puppet parts in mgPuppet. The DoNotExport flag now means that the object was automatically created as part of a compound and its "new" command should therefore not be exported. This is also used for objects that are automatically created by the engine of the GUI (like the default renderer and the console). mgPositionables can only be child of other positionables in order to correctly link their coordframes. The main root is therefore a mgPositionable. Currently mgPositionable is the only mgEngine class to benefit from the scene graph hierarchy, and this is not really something new as the corrframe hierarchy was already in place. Other links (like mgCameraViewport child of its mgCamera) should be added in the future, with or without implied semantics. Added scriptable "visitor" classes (mgScriptableVisitors.h) and system that allow walking through the scene graph and applying various operations. For now, only searching (by name and/or by type) and listing (by type) are possible. This replaces the previous SearchName() and List() methods from most scriptable classes. Added new Persistent flag. When true, the object is not deleted during a Clear. The ForceClear() method allows deleting persistent objects though (when, for instance, its non-persistent root is deleted). Added new Disabled flag. When true, the object is ignored by most engine operations (rendering, ray tracing, drawing viewport, applying filter...), with the notable exception of mgActor signals (this system will change in the future to better respect the scene graph). All these flags can be used in visitor conditions, in order to list, for instance, only enabled objects. These conditions respect the object hierarchy: any children of a Disabled object are also considered disabled. Note that visitors, conditions and scriptable flags were not implemented optimally and require simplification/factorization/optimization. mgScriptable (property system): Added a property system that manages most of the scriptable configuration parameters (properties). A detailed documentation may come in the future. The system itself is managed in separate classes and is quite transparent. Properties are declared in the constructor using the MG_RW_PROPERTY macro and its friends. They can be listed and accessed from anywhere, allowing (for instance) automatic creation of configuration panels in a GUI based on the class hierarchy of an object, generic integration with any third part scripting language or data sharing interface... A property has a host (the holding class), a type (one of those listed in mgVariant.h: especially base types, vectors, colors, strings, mgObjects, enums), a name, a setter and a getter methods, and a textual description. Dynamic properties (like "layers") are also managed by this system. This system partially replaces script parsing. Commands named "Set" followed by the property name (a few other syntaxes are also allowed, like "SetProperty property value" or "property = value") set the property to given value. Without the "Set" prefix, the property value is displayed in the console. A lot of existing parsing code was therefore removed, but a large number of special cases remain. The Help command result is automatically populated with properties and their descriptions. Properties do not yet support automatic script export. mgScriptable (other): Added Init() method called after creation, in order to perform initializations that respect polymorphism. Name transformation is now in a separate method from the constructor and performs new operations for the scene graph. Creating a scriptable that has the same name as an existing one now deletes the previous one and overwrites. Help command is now managed through DisplayHelp() methods. They are automatically called by mgScriptable, no need to parse the command everywhere. Added new Hidden flag. When true, the object should not be listed in GUI (no use in mgEngine at this time). Added new Selected flag. When true, the object acts as selected for the GUI (no use in mgEngine at this time). Resources: New mgResourceServer class that manages resource creation and loading, the resource paths, file opening, resource cleanup, etc. It replaces previous Get() and List() methods from most resource classes. A detailed documentation may come in the future. Multiple resource servers can be present simultaneously, and should be dispatched in the scene graph as desired. For instance in Pro-SiVIC, resources can be packaged in .zip files which also contain a script, and all objects created in this script use resources from the zip archive (this is implemented through a compound object in the scene graph with a virtual root object). Secondary resource servers should themselves be resources of the main resource server (the one using engine.conf for path configuration and automtically created by mgEngine class). Resource "Get" should be done at a mgScriptable's level with GetResource(), not directly on a resource server. The scriptable will use its own resource server, and recursively get higher in the hierarchy if the resource was not found. For a resource server to know where to find resources of a given type, each mgResource class should use the MG_RESOURCE("path key") macro in their declaration (where "path key" is the .conf key for its path, for instance "mesh path"). Added Init() method called after creation, in order to perform initializations that respect polymorphism. Resource classes now read files using a std::stream when possible instead of plain C files (in PFM file loading for instance). Textures lose TGA file format support, as this format is supported only if SDL opens the file itself (which is incompatible with the resource server system). mgCoordFrame: Added scaling feature (this needed some adaptations in collision shapes). Added rotation angles (Euler type) support (and corresponding methods in mgPositionable). Added LookAt() method, which performs what used to be done in mgTrackTo. Ideally, a third party library like GLM should be preferred for managing coordframes in the future. mgCamera, mgCameraViewport: Added default renderer (created at engine initialization) which allows a camera to actually work as soon as it is created. Moved rendering code from mgCameraViewport to mgCamera for consistency. To ensure a minimum compatibility, script commands will be forwarded from viewport to camera is SetCamera was called first. As a consequence, dropped support for direct rendering to backbuffer. This had almost no use anyway considering it is not compatible with many features and ignores camera resolution. mgCameraViewport is now part of mgEngine project. This was useful at one point for DLL dependencies in Pro-SiVIC, but is not anymore since rendering is now done by camera. The mgCameraViewport separate project should be re-created in the future. Fixed non-backbuffer rendering resulting in a black screen on AMD cards. This was due to renderbuffers or textures not binded again to framebuffer after being reallocated. Added support for multisampling and distortion correction. Multisampling was also added at mgSimpleShadowMask (was not really useful) and mgRenderTarget level. Distortion correction is currently not used in mgEngine filters. Added manual control over depth format. Added more security checks when allocating renderbuffers, and fallback options (as multisampling + HDR + distortion becomes very memory heavy). Fixed some erroneous pixel format definitions (GL_RGB instead of GL_RGB8). Fixed export of images with exotic resolutions by using correct glPixelStore() alignment value. Viewports: Dropped support for mgGlowViewport, mgMotionBlurViewport and mgDOFViewport. Viewport list is now stored at mgEngine class level. Added autoresize feature to mgViewport, which resizes the viewport to keep the same proportional size when the rendering window is resized. Added picking feature to mgViewport, which allows translating and scaling the viewport with the mouse. However, mgSDLCore does not binds such mouse interactions to these methods so they are currently useless without Pro-SiVIC. The mgPickingParams structure in mgPicking.h also supports object and camera picking, but the actual picking code is Pro-SiVIC only. Removed Hide/Unhide feature. Use mgScriptable's Disabled feature. Renderers and renderables: Removed Hide/Unhide feature from renderables. Use mgScriptable's Disabled feature. Moved common flags from various renderers to mgRenderer (wireframe, etc.). Renderables are now sorted at mgRenderer level instead of mgRenderable. A functor is used in order to allow easy overloading in child renderer classes. Fixed mgUserStateRenderer not fully initializing its state with camera information. This caused crashes when using the CameraAligned feature of renderables. Removed some redundant state changing OpenGL calls when rendering opaque then blended objects. There is still a very huge number of redundant calls in mgEngine by the way... Fixed blended objects not being rendered during direct lighting passes in mgAccurateRenderer, which caused very strange effects. Light sources and materials: Added possibility to handle a single light mask directly at mgLightSource level (no mgUserLightMask). This required creating a new intermediate mgSpotLightMask class. Added possibility to set both diffuse and specular light source colors with a single command/property as this is wat makes most sense. Materials and light sources now accept new inputs for spectral rendering and advanced BRDFs. However, this is work in progress and was implemented in a quite brutal way. Please ignore this for the moment. Post-processing filters: Fixed mgGlowFilter and mgDOFFilter rendering in the same framebuffer as the output, as this created artifacts when the temporary blurred image was larger than the output. Fixed mgGlowFilter not clamping negative color values to 0 as this created artifacts when rendering in HDR. Added no-so-generic methods for allowing rendering filter result to texture and applying distortion correction in mgPostProcessFilter. They are currently not used in mgEngine filters. Geometric objects and import tools: Added possibility to store mgMesh and mgBSPData data arrays in binary form instead of ASCII, to reduce file size and improve loading speed. Still not used much. Option is "-i" in import tools. Added option to cut BSP along median plane instead of mean plane. Option is "-n" in OBJ2BSP. This proved to be not as useful as expected (and slower of course). Fixed many crashs/bugs in mgPuppet, added security checks, and allowed changing .def file on the fly. However support for this class will soon be dropped. mgSkyBoxActor no longer flushes renderer (this required adding fog and depth test accessors in renderer states). mgSkyBoxActor no longer moves along with the camera; it uses a virtual coordframe for rendering. This prevents artifacts when making another object (especially camera or light source) as child of the skybox. Fixed mgBSPShadowMask not being updated in some cases where it should have. Ambient occlusion is now completely disabled when "ambient occlusion res" .conf key is 0. Texgen plugins: Dropped support for "fire", "screentexture", "video", "waterfall", "blurtexture". Reflection plugins use a cache time of 50 frames to prevent issues when using cameras with various periods in Pro-SiVIC (temporary workaround). A better solution should come in the future. Utility classes: Added possibility to use real time instead of simulated time to compute speed in mgPositionController. This is on be default and allows moving objects when simulation is paused. Added default input identifiers to allow using a mgPositionController as soon as it is created. Fixed mgPositionInterpolator crashing when played at an invalid position (further than last keyframe). Fixed mgPosiitonInterpolator crashing when period was changed on the fly. Raphaël Lerbour, R&D Software Developer / Engineer _________________________________________ CIVITEC Bâtiment le Sésame 8 rue Germain Soufflot 78180 Montigny-le-Bretonneux Tel: (+33) 1 79 92 10 57 http://www.civitec.com |