Well, it’s finally “done”. Version 3.1 of Gorgon is now live on the release page. There have been many changes to Gorgon, particularly with the Editor application. Some of these changes are breaking changes, so if you intend to upgrade from 3.0, be aware you may have to change some of your code. That said, these changes are not severe, so updating should not be difficult.
There were a lot of changes, additions and bugfixes applied to this release and for a brief overview, you can view the commit log summary on the Github release page. To get more detail continue on…
A major focus of this release was to add additional missing functionality to the Editor application. But that’s not all that got updated, many areas in the graphics, 2D, and animation modules got a clean up, or in some cases, a complete overhaul.
Core
There were not many changes in the Core API, but some items of note are:
- A new extension method for the
IReadOnlyList
type for copying the contents of the list into an array. - New extension methods for
IReadOnlyList
for finding the first and last indices of the collection by using a predicate function. - Added a method to
GorgonColor
to perform linear interpolation (Lerp) between 2 colors.
Windows
The progress panel and wait panel controls are now available without the “plexiglass” overlay.
File System
The first module that got a major update is the virtual file system. Specifically, the file system writer object.
Many new methods have been added to move, copy, and rename directories and files. Along with these, events have been added to notify when a file or directory has been deleted, renamed, copied or moved. Files also have events triggered when a file has been opened and closed, and directories have a new event triggered when a directory is created.
These were added when the editor file system was overhauled to use the virtual file system included in Gorgon (previously it had its own implementation).
Several other smaller updates were added to the main virtual file system such as the ability to refresh the virtual files from the physical file data.
Finally, the RAM disk file system writer object has been removed since it really had no purpose.
Graphics.Core
Obviously, this one of the modules that people might actually care about.
A major update for the graphics interface is that the requirements for the API have been lowered from Direct 3D 11.4 to 11.2. This will allow people to run this on a wider range of hardware. However, the requirement of Windows 10 is still in place, that will not change.
A new object for texture caching is available called GorgonTextureCache which can be used to cache textures for re-use so that applications don’t need to load the same texture over and over (consuming more memory, and requiring more texture swapping). This cache system will take any kind of texture that implements the IGorgonTextureResource interface (Texture1D, Texture2D, and Texture3D).
The scissor rectangle functionality has been moved onto the main GorgonGraphics interface. This allows for much easier access to setting up clipping rectangles in that a new raster state object would be required every time a scissor rectangle is required. However, it will still have to be enabled via the raster state. Please note that this is a breaking change.
The API also received some smaller updates such as:
- The modulated and additive predefined blending states have been changed to use blending on the alpha channel as well.
- 2 new blending states are now available that work the same as the old modulated/additive blending states (i.e. alpha channel overwrite).
Gorgon.Fonts
The font factory system has been updated to allow loading from a stream. This enables loading external font data such as fonts stored outside of the Windows font registry.
Fonts no longer store the bitmap textures with the font data when persisted to a file or stream. Only the metadata required for generating the font is stored. Font files stored with the previous version of Gorgon, should load without issue.
2D Rendering
The 2D renderer has received a major update in its effect framework. Now building a new effect should be a lot more flexible and hopefully easier to use. As a result, the post processing compositor functionality has also been updated to use the new updated effect framework. This is obviously a breaking change.
The post processing compositor has been stripped down and simplified since the previous version was overkill. Again, a breaking change.
The sprite corner offsets functionality for the GorgonSprite object has been updated to improve the rendering result. In the previous version, modifying the sprite corner offsets resulted in a weird warped look to the sprite texture due to affine texture mapping. This has now been corrected using perspective correction and the sprites render correctly when the offsets are adjusted.
Two new effects have been added:
- A silhouette effect that will render a sprite with texture details replaced by a single color, but will observe texture alpha.
- A GBuffer effect that can be used to implement deferred rendering functionality such as deferred per pixel lighting.
The lighting effect has been drastically altered to work with the new effect system, and to improve its flexibility. This will result in a breaking change.
Several smaller updates include:
- A new batch state for inverted graphics as been added.
- Unproject/project methods for the camera interface have been added (this was an oversight from the previous version)
- Sprites now have a CopyTo method to copy sprite data into another instance.
- The renderer interface now has a method to retrieve the vertices for a sprite.
Animation
The animation system has had a complete overhaul. Animation tracks are now registered in the animation controller and are based on data type (e.g. Vector 2, Vector 3, etc…). This allows flexibility when building animation controllers as any property on an object can be animated now. The previous version of Gorgon used tracks that associated to properties directly, which made things difficult when trying to animate a property that didn’t conform.
Because of this, the builder used to create animations has been altered to take a track name which corresponds to the registered name of the animation track in the controller.
The Editor
The editor application has been extensively modified to handle a more streamlined plug in interface, and a new file system UI.
The file system UI has been changed from a tree containing all directories and files to a new control that contains a tree (for directories) and a list (for files). This results in a much better experience when managing files in the editor, and, because the files are in a list, multiple files can now be selected, which was not possible in the previous version.
API
There were many changes to accommodate a simpler plug in interface for the editor. Visual elements now have functionality like scrolling, and zooming built in rather than different implementations across the various application plug ins. This will make it easier for plug in authors to focus on their content rather than the boilerplate of building a visual interface.
Since the API is quite large, here is the list of changes from the commit logs:
- Obsoleted sprite/image loading extension methods for reading sprite/image content data from editor file system, replaced with a new object that will manage loading content data and make use of the texture cache to ensure proper lifetime management. Also added loader for animations.
- Made sub panel host control container accessible.
- Exposed a font factory in the default content renderer.
- Added method to texture cache to return the number of users for a texture.
- Added control for updating Opacity values.
- Added function to flush the file system metadata back to disk.
- Added texture caching system.
- Added methods to convert vectors and rectangles to and from client/camera space.
- Updated anchor editor to fix issue where cursor would not change when hovering over icon.
- Updated rectangle editor to add a property that will disable boundary clipping.
- Added anchor editing service for adjusting sprite anchors.
- Added flag to rectangle clip service to turn off the manual input UI.
- Removed superfluous properties from mouse event arguments.
- Added color picker as a service to the host services properties.
- Added sprite grid extraction as service in the API.
- Reworked base tool form to be in line with other plug in control types when it comes to functionality.
- Modified content plug in base class to allow returning of a default file extension.
- Updated content file explorer to allow for single select.
- Updated metadata to allow for multiple dependencies for the same type of dependency.
- Added common functionality for setting up a config panel for plug ins that use other plug ins for support.
- Added objects to display wait panels and progress panels. These are meant to make it easier to use these panels in custom plug ins.
- Adding better base objects for plug ins and cleaning up plug in APIs.
- Refactoring of plug in architecture and various APIs.
- Reworking content plug in APIs.
- Reworked importer plug in API.
- Reworking content detection based on new file system.
- Modified color scheme to be a little darker.
- Added theme renderer to the API
- Removed Krypton controls and replaced with standard controls for folder selector form.
- Added clipboard handler to view models.
- Changed clipboard service to use custom clipboard, the Windows one has some issues in .NET.
Image Editor
The image editor has been updated with functionality to apply effects such as blur, burn, dodge, etc… to the image.
Importing array layers or depth slices has been updated to support multiple file import using the updated file system UI + a new UI for picking the images.
Sprite Editor
The create sprite dialog has received a major update that allows assigning of the sprite texture and default size of the sprite prior to creating the sprite.
Animation Editor
This is a new editor plug in that creates and edits animations for Gorgon sprites.
Tools
The editor now has 2 new tools:
- The image splitter tool – Splits a texture atlas into individual images using sprites assigned to the atlas to determine the individual image boundaries.
- The image atlas tool – This is similar to the sprite texture atlas tool, but, unlike that tool it uses individual image files to compose a texture atlas. It also has the option to build sprites from the individual images.
Examples
The following new example applications have been added:
- An example showing how to use the corner offsets and corner colors to achieve the opening text crawl from Star Wars.
- A particle example showing how to implement a particle system. This uses code adapted from the HGE library.
- An example showing how to create and use the new
IGorgonContentLoader
interface to load in content from a Gorgon Editor filesystem. - An example showing how to create a content plug in for the Gorgon Editor.
And that’s it. As usual, please be aware that this stuff may have bugs. You can report any bugs to the Issues tab on the GitHub repo.