UNIGINE 2.16.1: Screen-Space Haze Global Illumination, Better Import API, VR Improvements
Key Changes
- Screen-Space Haze Global Illumination
- Better dynamic reflections
- Optimized shadows rendering
- Improved asset import API
- Multiple tools improvements in the Editor
- Sandworm tool stabilization
- Optimized wake waves
- A set of new C++ samples
- Qt-based VR template
- Varjo XR integration improvements
- VR plugin for UnigineEditor
This release brings you more stability and optimization along with a pack of rendering improvements including a new Screen-Space Haze Global Illumination effect, better and more flexible API for runtime importing of assets.
Screen-Space Haze Global Illumination
True-to-life haze may be a nice-to-have thing for a game project, but it is crucial for simulation as well as for all projects where visual fidelity is a requirement.
Introducing Screen-Space Haze Global Illumination (SSHGI) - it is a new screen-space effect ensuring consistency of haze color with the current color of Global Illumination. The effect provides realistic result out of the box and has a rather simple set of parameters. This feature is available for Physically Based haze gradient mode only (other modes are planned to be removed in upcoming releases).
All scattering LUT textures were updated to provide more natural and physically correct scattering and shadow colors.
The set of SSHGI parameters is available in the corresponding group of Environment settings (Settings->Render->Environment).
Improved Runtime Asset Import API
We have refactored and improved import API in order to simplify creation of custom user importers. Now it is possible to register multiple importers from different vendors to be used for importing files having the same extension (importers are now identified by a pair Vendor + Name). You can also set priority for each importer for processing files with the specified extension.
class MyPlugin : public Unigine::Plugin
{
FbxParameters *fbx_params = {new FbxParameters};
StpParameters *stp_params = {new StpParameters};
protected:
int init() override
{
Unigine::Import::registerImporter("Unigine", "FbxImporter", "fbx", &createFbxImporter, fbx_params, 1);
Unigine::Import::registerImporter("Unigine", "FbxImporter", "obj", &createFbxImporter, fbx_params);
Unigine::Import::registerImporter("Unigine", "ObjImporter", "stp", &createStpImporter, stp_params);
Unigine::Import::registerImporter("Unigine", "ObjImporter", "brep", &createBrepImporter, nullptr);
}
};
Importer *createFbxImporter(void *opaque) { auto fbx_params = reinterpet_cast<FbxParameters *>(opaque); ... }
Importer *createStpImporter(void *opaque) { auto stp_params = reinterpet_cast<StpParameters *>(opaque); ... }
Importer *createBrepImporter(void *) { ... }
A number of importer management methods were added. Registration of importers has become more flexible as you can specify even creation and deletion methods for each of them:
New API is available for C++, C#, and UnigineScript. For more information on the related changes please refer to the API Migration Guide.
Better Dynamic Reflections
Sometimes, when specular highlights from glossy surfaces get into dynamic Environment Probes a very bright flickering of lighting from it may appear. A new Roughness Offset option (Settings -> Render -> Dynamic Reflections) makes surrounding materials look more matte for an Environment Probe than they actually are, reducing such flickering artefacts. This option is also available via the render_reflection_dynamic_roughness_offset console command.
Optimized Shadows Rendering
Added an ability to use advanced culling shadow cascades for Mesh Clusters and Clutters preventing shadows rendered in the nearest cascade from being rendered again in other cascades. This reduces the number of polygons rendered during the shadows rendering pass saving performance. However, in some cases this feature may take more than it gives, therefore it is disabled by default.
Varjo Integration Improvements
When developing XR and MR applications, you may need to mask specific objects to act as a "window" into the real world. This is especially useful if you want to see real-world elements, such as instruments or controller devices, in the virtual environment (like windows in a car simulator, for example).
We have added the support for blending masks to give you full control of the boundaries of mixed reality combining VR image from the user's application and the image from the video see-through (VST). A set of different masking modes is available enabling you to define how dynamic and static masks are treated within a mixed-reality view, including the use of chroma-key setups. Blending mask can be used to extend or restrict the chroma-key mask or to control the depth testing against the estimated video depth.
Image courtesy of Varjo
A number of other improvements were made as well:
- Added automatic white balance correction for mixed reality ensuring a consistent resulting image.
- Optimized rendering for HMDs having context (low-res) and focus (high-res) displays is available via a new Stereo Peripheral rendering mode saving performance on shadows and reflections along with other optimizations reducing rendering load, such as reduced resolutions for textures.
- Added Stereo Hidden Area support for Varjo HMDs that enables skipping pixels that are not visible in VR for better performance.
- Added debug mode enabling you to see masked areas while wearing HMD.
- Velocity has been renamed as Motion Prediction to be consistent with Varjo settings.
Lifetime Management for Widgets
All widgets as well as the user interface (UserInterface) now have a lifetime management system similar to nodes. They can be bound to a World (i.e. deleted when you unload one), to a Window (deleted when you close one), or to the Engine instance (deleted on the Engine shutdown). So, you don't have to worry about cleanup when creating your widgets, just choose the most suitable option upon widget creation, and let the Engine take care of the rest of its lifetime. Of course you can choose the old way too and manage them yourself manually.
You can find more information in the API reference for the Widget and UserInterface classes.
Console Key
We have changed the default key opening the Console adding more flexibility for customization and resolving a number of issues with using it on various layouts, such as German layout (QWERTZ). The default key for the Console remains the same (BACK_QUOTE), but you can remap it to any custom key you want (from the KEY_### values defined in the Input class), plus you can also use a modifier now if necessary (from the MODIFIER_### values defined in the Input class). This can be done via the corresponding parameters of the user config file (data/configs/default.user):
You can specify multiple keys by name or number separated by a comma:
<console_key>17,F1</console_key>
Engine and Editor Versions
Information about the current version of Engine, Editor, and core might be useful in many cases (e.g., writing own Engine and Editor plugins, checking compatibility in your custom tools, etc.). Version is represented as a four-component number - A . B . C . D.
In case you need version information when compiling your application or for any other purpose without having the Engine running, you can:
- take it from the data/core/version file as a string (e.g., "2.16.0.2");
- or, if you're using C++, include the UnigineVersion.h header and use the constants defined.
Other Engine Improvements
- Added a flag enabling you to make your windows topmost (placed above all other windows) and maintain this state even when deactivated. The flag is available via EngineWindow::setAlwaysOnTop() (EngineWindow.AlwaysOnTop for C#) method. This flag is also available for your application window in the CustomSystemProxy class.
- Added a pack of useful improvements to the FMOD plugin including abilities to control panning, pitch, frequency, priority for channels as well as mute/unmute them, ability to unload banks, improved event management and a lot more.
- Fixed an issue with asynchronous update of nodes. Dependent update (hierarchy based) now correctly processes NodeReferences: if a NodeReference is a child of a hierarchy dependent node (for example, ObjectParticles), the dependent node stored in this NodeReference is updated in accordance with the update of the parent.
- Performed additional optimization of multi-threaded node update. Now each child node of the same parent updates in a separate thread (if available).
- Fixed memory leaks when baking impostors on NVIDIA GPUs.
- Fixed visual artefacts of the Decal PBR Material graph appearing on NVIDIA GPUs.
- Fixed an issue with incorrect light distribution from static Omni sources due to invalid depth textures used for shadows (seen when Automatic Rebake option for static shadows is disabled).
- Shadow projection for Omni light sources now takes the transformation of the light source into account, the same way as for Proj lights.
- The Local Space option of Environment Probes now works for transparent objects as well.
- Optimized rendering of dynamic Environment Probes will skip the probes beyond the visibility distance saving performance.
- Fixed an issue with volumetric objects using the volume_cloud_base material having the Use Environment Lighting option enabled resulting in sharp transitions of lighting at the boundaries. Attenuation parameters are no longer affected by the Use Environment Lighting option.
- Fixed an issue with SSAO working incorrectly with the Water object causing visual artefacts.
- Fixed an issue with the Slope Scale parameter of the Grass resulting in disappearing grass blades when the camera is turned upside down.
- Fixed visual artefacts appearing when rendering clouds with low samples count caused by tonemapping applied during the TAA stage.
- Fixed an issue with painting Normal Maps, the feature is fully functional.
- Fixed an issue with incorrect displaying of Microprofile dumps in Google Chrome.
- Fixed an issue with GBuffer Normal in scenes containing a Landscape Terrain object, resulting in corrupted normals of objects in the buffer due to interference of the terrain's normals.
- Fixed an issue with fetching height values for the Landscape Terrain at points along the boundaries of low-density Layer Maps.
- Fixed an issue with incorrect rendering of Screen-Space Shadows on the Landscape Terrain object.
- Fixed issues with text input from some numpad keys.
- Fixed an issue with incorrect handling of simultaneous mouse button clicks (e.g., left and right together).
- Fixed an issue with automatic display mode selection by Window Size, now the highest possible frequency is selected as it should be.
- Fixed issues with invalid screen position for widgets returned in certain cases, when calling the corresponding API methods.
- Fixed marshaling for complex-type arguments of callback functions on C# side resulting in invalid data obtained due to incorrect memory alignment (e.g. TextureDraw callbacks of the Landscape Terrain).
- Fixed an issue with Texture Creator used in the Texture Paint mode resulting in absolute paths written for textures to the material file instead of their GUIDs.Fixed an issue with the engine window always opening on the first display of a multi-display config on Linux instead of opening on the one set as main.
- Fixed a crash of an application based on WPF System Proxy after executing the show_displays command on Windows7.
- Added an additional debugging option to use debug shaders for both types of binaries (debug and release). You can toggle debug shaders for your application via the video_debug_shader startup argument, the default value is 0 meaning that release shaders are used.
- Added an ability to check whether a standard Engine manipulator is currently being hovered by the mouse cursor: this feature is available via the WidgetManipulator::isHoverAxis() method.
- Fixed an issue with reduced resolution of the Bloom effect.
- Fixed an issue with resetting values of startup command-line arguments for BuildTool, RuntimesGenerator, and SandwormNode apps.
- Fixed Dear ImGui C# Integration sample on Linux, now it works on all supported Linux systems.
UnigineEditor
Faster Startup
Optimized "hot" startup of the Editor for heavy large-scale projects with a lot of content. "Cold" startup - is the first time, when you open your project in the Editor, when validation of all metadata and other operations are performed, all subsequent Editor startups are considered "hot". Optimizations bring up to 30%-35% reduction of loading time. However, there will be no difference at all for small projects: the more content your project has - the more noticeable the effect.
VR Plugin for Editor
VR output is now available in the Editor via the new VREditorPlugin. It will automatically detect that you’re running the Editor with a VR plugin (e.g. via the -extern_plugin startup argument) and add a new item to the Windows menu enabling you to open a viewport displaying an image from your HMD. Just like in any other viewport, you can switch between all currently available cameras, additional controls (e.g. focus supersampling factor or viewport mode) are added automatically depending on the type of hardware (Oculus, OpenVR, or Varjo).
Improved Validation for Assets and Runtimes
We have improved asset validation mechanism eliminating imperfections that have caused problems in some cases. Like when somebody makes changes to an asset, reimports it, and then commits this asset along with its meta file to a repository without commiting modified runtimes as well. Now you won't end up with a valid-looking asset having an old version of runtime(s), in this case you'll be notified that the asset has a problem.
Cleaner Improvements
Cleaner is a tool you use to optimize your project and save disk space by removing unnecessary assets. But there are a lot of runtime-files generated, especially in a big project, and they can be lost as well, eating up quite a lot of disk space (e.g. an asset is deleted, while its runtimes are not). Updated Cleaner tool switched to an upgraded dependency analyzer with an advanced script parser will now take care of them!
Unused runtimes having no assets are removed automatically during the cleanup process, as well as single meta-files. All cases of using runtimes directly (having no assets, but referenced from somewhere within the project) will be reported. All cleanup actions are logged, so you can track changes and be aware of any dependency issues and potential garbage in your project.
You can find more details in the updated article.
Managing Components/Properties for Multiple Nodes
You can now add and assign a component or property to multiple nodes at once. Just select them in the viewport or in the World Nodes window and click Add New Component or Property in the Properties window. Then drag the desired component/property to the corresponding field to assign it. Later you can select several nodes having the same component/property and replace it with another one just by dragging it to the corresponding field or by typing its name in this field.
Multiple Items Assignment for Array-Type Property Parameters
We have implemented automatic assignment of multiple items in the property array on the Parameters panel via a drag&drop operation. You can select multiple nodes in the World Nodes hierarchy (or multiple materials, properties, assets in the Asset Browser) and drag them to the desired element. In case of an array with a complex structure, items are dropped one by one (excluding those that do not correspond to the field type) into the specified parameter (field) of each array element.
Clear Structure: Group Headers and Nesting
We have improved the layout of widgets and made headers of parameter groups highlighted and seen clearly and we made clearer the structure of nested parameters which is especially important for complex properties/components having a lot of arrays and structure- and array-type parameters.
Copying Nodes to Clipboard
When building worlds it is often necessary to copy certain nodes and paste them somewhere else, within the current world or to another world in your project. We made copying to clipboard available for nodes, you can use it to copy selected nodes, node groups, and hierarchies, enabling you to perform copy-paste operations with nodes within or between the worlds of your project (Ctrl+C and Ctrl+V - as usual).
New Helpers
A pack of new helper visualizers has become available in the Helpers menu for various debugging purposes, including:
- Immovable - to highlight immovable (static) objects.
- World Shadow Casters - to highlight all surfaces that are configured to cast shadows from the current World Light source.
- Mesh Statics - to highlight all Static Meshes in the scene.
- Mesh Dynamics - to highlight all Dynamic Meshes in the scene.
- Clusters - to highlight elements of Mesh Cluster.
Help Icons
We have practically all elements of the Editor's interface covered with tooltips, but some things may require a more detailed explanation and examples than an average tooltip can handle. So, now some UI elements of the Editor may have an icon with a question mark next to them - the Help Icon. You can click it to display relevant documentation related to the object it is linked to. We plan to provide more of such icon-links across the Editor's interface to help you find necessary information quickly, in a click.
Plugin Compatibility Checks
UnigineEditor now checks version compatibility at startup and ignores all plugins, failing this check avoiding crashes on an attempt to run the Editor with an plugin having an incompatible precision version (e.g. float version of the Editor + double version of the plugin).
To ensure that your plugin is valid you should replace the following line in your custom Editor plugin's declaration in a header file:
Q_PLUGIN_METADATA(IID "com.unigine.EditorPlugin" FILE "YourPlugin.json")
with this one:
Q_PLUGIN_METADATA(IID UNIGINE_EDITOR_PLUGIN_IID FILE "YourPlugin.json")
Material Graph Editor Updates
Custom Temporal Filtering for Graph-Based Post Effects
You can now assemble custom temporal filters based on UNIGINE's TAA for your post effects created in the Material Graph Editor. Just check the Use TAA option for your Post Effect material and configure your filter using the parameters that appear.
You can also control a set of parameters available in the Temporal Filtering group of the Editor's Parameters window when such post material is selected.
Unused Material Parameters
Parameters of your material graphs that were never used (i.e. have no connection to the Material node) will now have an (unused) marker in the Parameters panel.
The list of other Material Editor improvements includes:
- Fixed an issue with shader compilation failure when connecting a constant to the Mip input of the Texture Resolution graph node.
- Fixed GUID conflict warnings when cloning nodes in the Material Graph Editor.
- Fixed incorrect rotation of the node preview in the Material Graph Editor.
- Fixed an issue with displaying parameter groups in the Material Graph Editor resulting in disappearing parameters and groups placed after an empty group in the material parameters hierarchy.
- The following new subgraphs were added:
Roughness Offset
Mirror Float
Mirror UV
Settings Sun Color
Settings Haze Physical Screen Space Global Illumination
Settings Haze Scattering Mie Intensity
Settings Haze Scattering Mie Front Side Intensity
Settings Haze Scattering Mie Fresnel Power
Other UnigineEditor Improvements
- UnigineEditor now automatically loads the FbxImporter, GLTFImporter, and FbxExporter plugins by default.
- Engine Viewport in UnigineEditor has become an ordinary main engine window created via Engine API to simplify implementation and keep in-editor testing of script-based logic identical with running it as an application. The only difference now is that Engine Viewport is no longer stackable with other Editor windows.
- Fixed an issue with the Editor performing migration of assets in a read-only mount at startup.
- Fixed a crash on importing an FBX-model with a number of bones exceeding the maximum limit per surface.
- Fixed an issue with deleting the .meta of the current world when saving it in the Editor.
- Fixed an Editor crash on creating groups in the World Nodes hierarchy and reverting changes via Undo (Ctrl+Z).
- Fixed an issue with disabling the Compression option for Lightmaps after reloading a world.
- Fixed an issue with an Engine window created and opened when running console applications (RuntimesGenerator/BuildTool/SandwormNode).
- Fixed mouse interaction with popup windows in Cluster/Сlutter Mask paint modes.
- The Selected Node Info has been moved to the bottom left corner of a viewport in order to avoid obscuring the selected node itself. Asset path is now displayed instead of a runtime path.
- Fixed issues with clicking through options in the Helpers/Render Debug menu when opening a dropdown.
- Fixed an issue with selecting an object for painting in the Texture Paint mode.
- Fixed an issue with incorrect behavior of the modal Texture Creator dialog window blocking the UI after being overlapped by the Editor window.
Optimized Wake Waves
We have made certain optimizations and improvements of ship wake waves for aircraft applications enabling you to create multiple performance-friendly long wake waves for distant views (from an aircraft high above the sea level). To showcase the feature a zodiac_boat node with the corresponding preset has been added to the IG Template. To check it out simply add a Global Water object to the scene and create an entity (type 300), new wake waves will be generated as the boat moves across the water surface.
Qt-Based VR Template
You can now create your own Qt-based plugins on the basis of the VR Template - just select VR Template and choose C++ (Qt-based) as API+IDE when creating a new project.
Sandworm Tool Improvements
- Fixed a crash on generating a terrain with several data sources in the Mask layer.
- Added blending of several data sources in a single mask.
- Fixed names duplication for points of boundaries.
- Fixed issues on editing boundaries of the Export Area.
- Implemented turning on of the Boundaries section on adding a new TMS URL.
- Fixed an issue with managing (detecting and saving) unsaved changes in the project.
- Fixed issues on undo/redo when selecting Terrain sources and Objects.
- Fixed issues on the Use Imagery Color and Split Length parameters for buildings in the Auto mode.
- Fixed seams for ObjectTerrainGlobal generated using the built-in and EPSG: 3395 projections.
- Fixed an issue on undo/redo for mask data sources and objects.
- Fixed issues on incorrect generating of a terrain in the Headless mode.
- Fixed a crash of the tool on closing the UNIGINE Editor.
- Fixed incorrect skillion roof generation.
- Fixed issues on changing the terrain type in the existing project.
- Implemented hiding of the Export Area boundaries when using the Color Picker.
- Fixed a crash on working with filters set for a mask source .
- Fixed an issue with incorrect reprojection of sources after changing the coordinate system.
- Fixed incorrect spreading of vegetation according to a mask.
- Fixed a crash on generating roads with adjustments (when the Adjust Terrain Heights and Masks flag is enabled).
- Fixed issues on distributed generation.
- Refactored logic of selecting UI elements.
- Minor UI improvements.
Demos and Samples
New API Samples
A set of samples has been added to the C++ Samples suite showcasing some typical use cases including the following:
- Split-Screen View implementation using the WidgetSpriteViewport enabling you to control movement of two cubes each having its own view on a single keyboard (WASD for the top view and arrow keys for the bottom) like in old-style racing games.
- CAD-Like View implementation demonstrating a multiview split screen combining views (front, side, top, and perspective) from cameras having different projection matrices like in a CAD software.
- Top-Down Controller implementation of some elements of a top-down strategy game enabling you to select one or multiple units panning the view, turning the camera and smoothly focusing it on the current selection.
- Widget Manipulator implementation enabling you to use Engine manipulators to move, rotate, or scale the currently selected object. You can also lock/unlock manipulator axes restricting current transformations and switch between local and world coordinates.
- Widget Target Marker implementing a HUD with a marker always pointing to the target, when it is within the field of view, or displaying an arrow pointing the direction to the target when it's out of sight (aligned with the screen borders).
- Cluster sample showing you how to remove selected elements from the Mesh Cluster and add new ones at locations pointed by the mouse cursor on clicking the left mouse button.
- Clutter-to-Cluster Converter sample demonstrating generation of a Mesh Clutter object and its conversion into a Mesh Cluster in a single click.
- Physics-Based Animation showcasing implementation of various movement modes for a cat and a simple game where a cat chases a laser pointer (different easing functions are used).
Some of these samples (Top-Down Controller, Cluster, Clutter-to-Cluster Converter, and Target Marker) were also implemented in C# and added to the C# Samples suite.
Documentation
Added a set of new ultrashort HowTo quick tip videos in English, Chinese, and Russian:
Other Documentation Changes
- Updated the Cleaner Tool article.
- Added a new article on Window Management.
- Updated Import System API and related articles.
- Added examples of code for the following API classes (Xml, Json, WorldTrigger, File, WindowManager, EngineWindow, Displays, UserInterface, Widget, WidgetDragArea, WidgetWindow).
- Added more descriptions to Material Graph Nodes Reference.
- Fixed a number of issues in the docs based on your feedback.
- The complete list of API changes is available in the API Migration Guide.
- The complete list of Console command changes is available in the Console Migration Guide.
- The complete list of instructions on upgrading your content to UNIGINE 2.16.1 is available in the Content Migration Guide.
Thank you for reading, and don't miss the updates as we keep working to make UNIGINE even greater!
- Your UNIGINE Team