Jump to content

Unigine SDK 2013-02-11: OpenFlight and FBX Import, Collisions with Mesh Clutters/Clusters, and Extended C++ API


photo

Recommended Posts

OpenFlight Import Plugin

 

Now it is possible to import assets from OpenFlight format, the simulation and training industry standard for geometry data. Added support for SGI texture format usually used together with OpenFlight.

 

The plugin imports polygonal geometry, including groups, loads and integrates Level of detail nodes into Unigine LOD system, and converts Degree of freedom nodes into NodePivot nodes for full control over mesh rotation. Due to smart management of external reference nodes, they are loaded only once and instanced. The model is added together with an assigned material and the whole set of textures, converted and compressed into real-time ready formats. Alpha blending for textures and polygon offsets (based on Subface nodes) for materials are also automatically supported. Moreover, the plugin imports infinite, local and spot lights with correct parameters read from the OpenFlight asset.

 

130210_openflight_plugin_sm.jpg

 

FBX Import Plugin

 

New FBX plugin allows for easy FBX import from any digital content creation applications that support this format. Given a FBX file, it loads all scene elements with their full hierarchy. That includes converting meshes into Unigine-native formats and optimizing them on the fly, automatic creation of materials, compression and optimization of textures for real-time rendering, as well as import of skinned animations, lights and cameras.

 

Make sure to put your FBX assets into the data folder so that they can be converted on-the-fly.

 

130210_fbx_plugin_sm.jpg

 

Both OpenFlight and FBX plugins, as well as the Collada plugin introduced previously, work with double precision coordinate builds.

 

Urban Driving Demo

 

Urban Driving demo is an example of player-controlled, physics-based vehicle demo in the urban environment, optimized for rendering via occluders. It also goes together with weather presets and a day-night cycle.

 

130210_urban_driving_sm.jpg

 

Render

  • GLSL shaders are now fully compliant with the OpenGL 3.2 core profile specification (instead of the compatibility one), improving compatibility with Intel and Apple OpenGL drivers.
  • Added Bokeh flares (Render -> HDR -> Bokeh) available when both HDR and DOF are enabled. With them, bright areas out of focus are rendered with the bokeh effect (you can also set a custom texture for it).
  • Improved the quality of HDR flares; a limitation on their length is lifted.
  • Added a scattering direction vector (Render -> Scattering -> Direction) for a completely custom direction of scattering. Downward direction is also supported.
  • Areal perspective correction for light scattering can be disabled by setting Render ->Scattering -> Areal from 0 (no correction) to 1 (height correction in full effect).
  • Added alpha support for all primitives in the visualizer.
  • Visualizer checks objects for visibility within the screen before rendering.
  • Motion blur effect is available with double coordinate precision builds on huge distances from the world's origin.
  • Motion blur flickering is fixed, no more issues in samples.
  • Fixed issues with the motion blur effect when DOF is enabled: it is no longer rendered across the blurred areas.
  • Billboard clouds (with billboards_cloud_base material) now automatically disappear when the camera is close to them to avoid any possible clipping artifacts.
  • Removed UpSample and UpScale options in Materials. Instead, a new Downsize drop-down option allows for a fillrate optimization for transparent materials. It can downscale and filter them, and even render scaled and filtered material on the scene background (can be used for volumetric clouds).
  • Fixed random flickering of the scene when multi-threaded physics is enabled.
  • No more random sparkles with HDR and anti-aliasing enabled.
  • Fixed a rare bug with incorrect lighting of grass, terrain and leaves with Ambient light option enabled in Materials.
  • Fixed a bug with Receive shadow flag in Nodes -> Surfaces not working correctly.
  • Correct handling of device remove event under DirectX 11 without crashes.
  • Issues with DirectX 9 fullscreen mode are gone, handling of device lost event is completely safe.
  • A debugging mode can be enabled for AppLevel plugin via the -debug CLI option.
  • AppWall plugin safely handles invalid command line parameters.
  • Removed iZ3D stereo support.
  • Increased performance of LUT color correction when default render settings (such as Gamma, Contrast, etc.) are used.
  • Changed the order of video modes: now resolutions with 16x9 aspect ratio come first.
  • Added support for 2560x1440 and 2560x1600 resolutions.
  • Added support for anti-aliasing for Mac OS X.
  • Added full support for SGI image file format.
  • Now all GPUs available in the system are detected. If GPUs are the same, they are listed, for example, as GPU name x2.
Node-related Features:
  • Added X and Y flipping options for ObjectGrass, ObjectMeshClutter and WorldClutter to flip masks (if textures are flipped, lightmaps are influenced as well).
  • Removed Compaction flag from ObjectMesh and ObjectSkinnedMesh.
  • Decals with a new Dynamic flag checked are automatically updated in the non-editor mode. They are reprojected onto a surface when the decal node (or its parent) has been moved, or if they are enabled/disabled. It can be used, for example, to cast a decal-based shadow from a moving car.
  • Added Distribute parameter for volumetric clouds of ObjectSky. It controls the density of clouds in the distance for better visual quality (use lower values for that).
Render Console Commands:
  • Added a console command d3d9_render_use_alpha_to_coverage for disabling alpha-to-coverage under DirectX 9, if required. Now light scattering and all depth-based effects work impeccably when anti-aliasing is enabled.
  • Removed a console command d3d11_render_use_geometry_shader, now it is always on.
  • Console commands render_manager_load_* are renamed into render_manager_create_*.
  • Console command render_manager_warm_shaders is renamed intorender_manager_create_shaders.
  • Console command render_manager_load_shaders is renamed intorender_manager_check_shaders. This console variable should be used only for shader debugging purposes; its execution can be stopped by ESC key.
  • Console command render_force_no_translucent is renamed into skip_translucent.
  • If render options are skipped via render_skip_* console commands, they are automatically disabled in the interface.

Bokeh flares in action:

 

130210_bokeh_flares_sm.jpg

 

A new sample with a custom shader that calculates world coordinates based on depth buffer values: samples/shaders/coordinate_00.

 

130210_depth_shader_sm.jpg

 

File System

  • Arbitrary directories from outside the data directory can now be added to the file system via*.ulink files (much like mount --bind command in Linux). This link file contains a directory path relative to data and is stored anywhere inside of it. A slash symbol in the end is required, for example ../../my_project/. If a link file is added during engine runtime,filesystem_reload should be run.
  • Added a console command filesystem_ignore. It takes a full directory name as a value and ignores all folders found within data with such names. It can be used to ignore version control systems (by default, .svn folders are ignored). Multiple values are comma-separated. This option comes into effect only after filesystem_reload is run.
  • Removed FileSystem plugin as no longer necessary one.
  • Script functions mkdir() and rmdir() can receive a second optional flag to create/remove all specified directories recursively (for example, a/b/c/d) at once.
  • Console command data_icase is renamed into filesystem_icase.
Nodes
  • New NodePivot allows for easy control over node rotation. (It has two matrices inside: one sets the basis of rotation, and another one transforms children nodes.)
  • Added Orientation flag for WorldTransform node. If unchecked, the child node preserves its initial orientation rather than being oriented along the spline.
  • Fixed issues with large-sized WorldOccluder and WorldOccluderMesh.
  • In *.world and *.node files a hidden attribute has been renamed into folded.

Make sure to run the utils/Upgrade/upgrade.py script to update node files format in your projects!

 

Physics

  • Collisions with ObjectMeshCluster and ObjectMeshClutter objects are available now. (It can be either collisions with polygons or with simplified collision surfaces.)
  • Fixed a bug with ragdoll bodies on saving and restoring the world state.
  • Physical objects now interact with geometrical waves on water meshes with BodyWater assigned.

Interaction between water waves and physics:

 

130210_physics_waves_sm.jpg

 

GUI

  • For a system GUI a custom font, skin and even a resource file can be loaded in run-time. This allows to change the default look of the engine interface.
  • Added padding support (for top, bottom, left and right sides) for all box and windowcontainers.
  • New align tag can be used in UI files. Unless overridden in child widgets, it specifies a default align option.
  • Added support for tables in all widgets with rich-text formatting (such as labels, buttons, etc.). Use <table/><tr/>; and <td/> tags; spacing and border color attributes are supported.
  • No more need to use <text/> tags for any of leaf widgets (that cannot have children). For example, now it can be simply <label>text</label>.
  • Added setBorder() function for WidgetScrollBox to disable or enable a border around it.
  • Fixed memory leaking issue for WidgetCanvas.
  • Added a bold font fontb.ttf into data/>core/gui/ to be used for interfaces.
  • Fixed a bug with non-rendered space in some fonts.
  • Fixed a bug with incorrect scaling of a WidgetWindow title.
  • When a fixed framerate is set, WidgetSpriteViewport, WidgetSpriteNode and WidgetSpriteVideo are also rendered with the specified FPS.
  • Fixed a bug with incorrect focus on overlapping sprite widgets.
  • Added a UnigineScript callback systemSetLanguageCallback() into the system script.
  • It is possible to hide text in WidgetDialogMessage and embed any Unigine widget instead of it.
Flash
  • Improved rendering of alpha-blended objects with textures.
  • Fixed a bug with rendering scaled objects.
  • Fixed issues with incorrect addressing to movie clips.
Mobiles
  • Multi-touch events are now correctly handled on Android when one of the fingers was lifted.
  • For iOS, iPhoneOS 6.1 SDK is required.
Scripts
  • Added an extended set of swizzles for matrices. row0...row3 or col0...col3 return the full row/column. row03...row33 or col03...col33 return the first three elements of the row/column as vec3. Plus an underscore symbol is now supported (for example, my_matrix.col33_1).
  • Added kill_thread() function to terminate a thread (a thread ID is returned by thread()). Do not call this function from the terminated thread.
  • Now in the assertion the full name of the function that caused a crash is output (due to added __FUNC__ predefined constant variables).
  • New set/getParameter() functions work with variables that are automatically converted to a property type. getParameter() can also return a custom value (it is an optional second argument) if no value is found to be returned.
  • Improved set/getState() and set/getParameter() in Material and Property classes, they can either receive an index or a name.
  • Added a new function into system.h to receive multiple localization languages on the system script initialization.
  • New dedicated Settings namespace in the system script, in case main settings need to be accessed from it.
  • Function engine.config.get() can receive a second optional argument returned if a value is not found in the config.
  • Added merge() function that adds one array to another.

C++ API

 

Now you can create and manage nodes, as well as load them, directly from C++ code due to a set of new functions.

  • New functions grab() and release() in each class specify whether the node is deleted by C++ code (when the reference count goes to 0), or is handled by Unigine scripts. Check a new sample source/samples/Api/Constructors.
  • Added a set of functions into UnigineWorld to load nodes from C++ side.
  • New UnigineEditor allows for working with editor nodes.

Other C++ API changes are as follows.

  • Added Unigine::Callbacks class to handle script callbacks conveniently.
  • Added Unigine::Console class to work with available console commands, as well as create new commands and variables.
  • Inherited classes can be easily casted to base ones via getNode()getObject() andgetStream() functions.
  • Unigine::Stream class can now work with big- and little-endian file formats.
  • New UnigineUtils.h comes with a number of useful functions, such as min()max(), etc.
  • Added gui() callback into Unigine::Plugin that can be used to render a custom GUI.
  • Function App::needDestroy() is now to be used instead of removed App::destroy(). This method is called when all render resources must be destroyed.
  • Added a reverse iterator for UnigineTree container.
  • Added comparison operators between vector and matrices into UnigineMathLib.
  • Added a reverse iterator for map arrays in Unigine::ArrayMap.
  • Added Unigine::Map::append(Map) and Unigine::Set::append(Set) functions to copy a map into another map and a vector into another vector.
  • Added support for vec2, dvec2 and ivec2 data types.
Editor
  • Added Tools -> Plugins -> Core button to select editor plugins available in the data/coredirectory.
  • Increased the number of digits for Density field in ObjectMeshClutter and WorldClutter. Now it's possible to set such values as 0.0001 for it.
  • Fixed Tracker layout for LoadSave and Clear buttons.
  • The maximum track weight in Tracker can be higher than 1.
  • No more resetting of the interpolation type to a default one when Tracker keys are cloned.
  • Dimensions of file dialogs are now saved for the next time they are reopened.
  • Interface plugin windows restore their positions within available monitors (for example, in case if one of the monitors was turned off).
  • No more stalls on node selection when there is a huge number of child nodes in the world.
Tools
  • Added 3ds Max 2013 import and export plugins.
  • Improvements of Collada plugin include Import joints option (not to import the hierarchy of bones), optional texture compression and the animation drop-drop down list.
  • Fixed a bug with memory consumption by the Collada import plugin for some meshes.
GPUMonitor Plugin

 

Added GPUMonitor plugin for Windows, Linux and Mac OS X. If in the main menu Interface -> GPU monitor option is checked, it shows the graphics card temperature, as well as the available, per-frame information on the chip frequency. For NVIDIA GPUs, it is graphics, memory and processor clocks. For AMD GPUs, it is core and memory clocks. On Mac OS X, only temperature information is available.

 

Check also a new samples/plugins/gpu_monitor_00 sample.

 

130210_gpu_monitor.jpg

 

Other

  • Versions of plugins, as well as a version Unigine dynamic library (double precision libraries included) are now checked against the binary version on the engine start-up.
  • Warning messages regarding sound and video app selection on the engine start-up are now written into the console instead of being shown in a dialog window.
  • Added HAS_XAUDIO2 define to be used in scripts.
  • Fixed rare crashes on Mac OS X when ALT was pressed concurrently with an alphabetical key.
  • The minimum required Mac OS X version is now 10.7.
  • SDK browser has been updated to Qt version 4.8.4.

P.S. Good news, everyone! Finally, the Valley demo, improved and polished, is released as a benchmark this week.

 
 

Download links

All files can be found in "Downloads" section of the portal: https://developer.unigine.com/fileserver/index

  • Like 1
Link to comment

Bokeh flares look very nice.

 

"Removed UpSample and UpScale options in Materials. Instead, a new Downsize drop-down option allows for a fillrate optimization for transparent materials. It can downscale and filter them, and even render scaled and filtered material on the scene background (can be used for volumetric clouds)."

 

Will be interesting to see this in volumentric clouds.

 

Thanks for the Update!

Link to comment

Wow!!! It is not just an update, it's a very huge update.

 

There are a lot of nice things, but i m worried all this add in one month, Unigine crew have time for sleep a little ???

 

Very good job guys !!!

  • Like 1
Link to comment

In *.world and *.node files a hidden attribute has been renamed into folded.

 

Documentation needs to be updated to reflect this change...

 

Otherwise the release is looking good so far

Link to comment

Since when?

well he probably wants to say that flash is somewhat outdated technology wise, if you look on HTML5 and the fact it plays in every browser without additional stuff.

flash is not dead, it's yet very popular. but focusing on state of the art technology is always good.

 

 

@unigine:

 

5aAhTiL.jpg

 

 

while coders are happy.. i see what you did there  -_-

 

will post new screenshots when everything is fixed and adapted to the new features. the new DOF looks just awesome so far  :P

 

cheers

Link to comment

This update has highlighted a few things;

 

Firstly (and most importantly) opening our worlds is creating this log error;

12:40:11 Machine::do_callcfd(): can't find "getUpSample" function with 0 arguments
12:40:11 World::loadWorld(): world init function return 0 in "KASEMAKE/KASEMAKE.cpp" file

 

Removed UpSample and UpScale options in Materials. Instead, a new Downsize drop-down option allows for a fillrate optimization for transparent materials. It can downscale and filter them, and even render scaled and filtered material on the scene background (can be used for volumetric clouds).

I believe this is the cause, but what is the solution???

 

 

In *.world and *.node files a hidden attribute has been renamed into folded.

Was this a necessary change? The word "folded" sounds more convoluted than "hidden" to me. This isn't a huge issue but somewhat of an annoyance for us as if we use this SDK update in our next release we will have to run the upgrade script everytime someone opens a world, as world data from previous builds will no longer work without the upgrade (and users will have their own set of world files that we can't simply replace).

 

And like Danni already hinted, setFolded and isFolded functions exist but are without mention on both online and offline docs.

 

My last peeve is that the data folder now contains 2 files with the name "util.h". Since I hadn't specified full include paths I was referencing the wrong file. This had me confused for some time and some users may want to watch out for!

Link to comment

This update has highlighted a few things;

 

Firstly (and most importantly) opening our worlds is creating this log error;

12:40:11 Machine::do_callcfd(): can't find "getUpSample" function with 0 arguments
12:40:11 World::loadWorld(): world init function return 0 in "KASEMAKE/KASEMAKE.cpp" file

 

I believe this is the cause, but what is the solution???

 

Here we use imageMagick and imageDDS to prep our materials coming out of 3DStudio Max This means any up/down scaling happens before it ends up in Unigine. Typically you want to avoid upscaling - 

 

Was this a necessary change? The word "folded" sounds more convoluted than "hidden" to me. This isn't a huge issue but somewhat of an annoyance for us as if we use this SDK update in our next release we will have to run the upgrade script everytime someone opens a world, as world data from previous builds will no longer work without the upgrade (and users will have their own set of world files that we can't simply replace).

 

And like Danni already hinted, setFolded and isFolded functions exist but are without mention on both online and offline docs.

 

Presumably you wouldn't run the script on open world but once as a global search and replace when the update is installed. (it's an easy string replace)

 

My last peeve is that the data folder now contains 2 files with the name "util.h". Since I hadn't specified full include paths I was referencing the wrong file. This had me confused for some time and some users may want to watch out for

yup this is a problem. Though as practical advice I suggest pathing all your includes from data. As it's possible to have name conflicts with files you name yourself if you are not careful.

Link to comment

Here we use imageMagick and imageDDS to prep our materials coming out of 3DStudio Max This means any up/down scaling happens before it ends up in Unigine. Typically you want to avoid upscaling - 

Yes, but this doesn't really explain why I can't open my projects in this version? (see log errors in prev post)

 

Presumably you wouldn't run the script on open world but once as a global search and replace when the update is installed.

In our use case our software creates its own world and node files that are not saved to a specific location or machine. If a user recieves these files from a previous release, they will expect to be able to open them.

 

yup this is a problem. Though as practical advice I suggest pathing all your includes from data. As it's possible to have name conflicts with files you name yourself if you are not careful.

Of course I already understand this. In our case we debug unigine from the sdk data folder, but when we build a release candidate the scripts get packed into a single ung file, of which the relative paths will differ. This isn't a problem, I was more just throwing it out there. We deleted our data/Networks folder as an easy fix but we could use #ifdef's if we really wanted to.

Link to comment

Yes, but this doesn't really explain why I can't open my projects in this version? (see log errors in prev post)

possibly check that you haven't got a mismatch between binaries and libraries?

In our use case our software creates its own world and node files that are not saved to a specific location or machine. If a user recieves these files from a previous release, they will expect to be able to open them.

I want to hear Unigines logic behind this change - thinking about it - it seems counter intuative to me but I could be missing something.

Of course I already understand this. In our case we debug unigine from the sdk data folder, but when we build a release candidate the scripts get packed into a single ung file, of which the relative paths will differ. This isn't a problem, I was more just throwing it out there. We deleted our data/Networks folder as an easy fix but we could use #ifdef's if we really wanted to.

data networks you say - I remember being bitten by that one - you are right that should be fixed. I don't understand why you would be changing the location of your scripts relative to data, we pack into a separate filesystem and archive for shipping and we have never had the need to do that. 

Link to comment

Will the Valley demo be released as an Editable version for customers as reference?  If the source files will be released for customers when can we expect this?

 

Thanks in advance.

Link to comment

When I opened our project with the new update it seems all normals have seams and seem inverted

Could you please send details (what material, texture sample) to engine-support@unigine.com ?

Link to comment

There are a lot of nice things, but i m worried all this add in one month, Unigine crew have time for sleep a little ???

Anthony, I could only say that sleep was out of the option at that time :)

 

@unigine:

 

while coders are happy.. i see what you did there  -_-

 Sorry Pascal, I'm not actually sure I how your scene looked like before the update.

 

Was this a necessary change? The word "folded" sounds more convoluted than "hidden" to me.

Carl and Danni, that was done for pure purpose of making this option more clearly understandable. Since hidden can refer to disabling a  node, that tended to be confusing. Folded does not hint in any way on that.

 

My last peeve is that the data folder now contains 2 files with the name "util.h". Since I hadn't specified full include paths I was referencing the wrong file. This had me confused for some time and some users may want to watch out for!

 Just like Danni suggested, it's a good thing to use a path.

Link to comment
  • 2 weeks later...
  • 2 weeks later...

Done.

 

-1 is video_width x video_height
0 is 640x360
1 is 960x540
2 is 1024x576
3 is 1280x720
4 is 1366x768
5 is 1600x900
6 is 1920x1080
7 is 2560x1440
8 is 640x400
9 is 960x600
10 is 1024x640
11 is 1280x800
12 is 1440x900
13 is 1680x1050
14 is 1920x1200
15 is 2560x1600
16 is 640x480
17 is 800x600
18 is 1024x768
19 is 1280x960
20 is 1280x1024
21 is 1600x1200
22 is 2048x1536

Link to comment
×
×
  • Create New...