App

The application is the core subsystem behind NRG it defines all the main features that your app. will be using at runtime. On top of controlling visual properties, it also allows you to set all the basic settings that your application will use including orientation, physics engine, graphics capabilities, security etc... On this page of the property editor, you can also visualize your application statistics, enable CPU, GPU, Network and SFX profiling, link external files and C/C++ plugins and a lot more.

Application


properties_app_application.png

Project Name: The name of the active project loaded into the editor. To set the active project to be the default startup project to be loaded when you are powering up the editor click the icon. To deactivate your project as default toggle it off or simply activate it from another NRG project.

Library Path: The current path where the current NRG project is loaded from. By default as long as you are developing your application all assets scripts will be saved as raw text; however by activating the icon, you will force the library to pre-compile all resources before saving them on disk. Take note that precompiled scripts are faster (approx. 5x) to load but slower to save. In addition, all scripts used in the final publishing phase of your project will be pre-compiled. No raw scripts will be included within your final application .npk and executed at runtime to maximize performance.

Remarks
Whether you are using a 32bits or a 64bits system precompiled binary scripts will be compatible with the virtual machine regardless of the VM have been compiled using a 32bits or 64bits system.
Warning
Once a script is binary compiled you cannot use a regular text editor to modify its content anymore.

Orientation: Specific for mobile devices this option allows you to set the default orientation of your application. The icon located on the right side of the combo box ( ) give you the ability to specify if the application enter full-screen mode automatically when the application starts within the editor using the Workspace Controls.

Physics Engine: Determine if your application should use physics.

Startup Scene: Set which scene you want to load as soon as you start your application (see Workspace Controls for more info.) or when bundled inside a C/C++ executable using AppStart();. To select a scene simply type in its name or press the icon to pop up the list of all the available scene contained within your library.

Pack Utility: Specify the utility where the packing rules and exclusion patterns are located.

Key Strength: The strength of the encryption key to use when compressing to .npk. This value has to be the same as the original one to open directly a .npk inside the editor.

Encryption Key: Used when loading an encrypted .npk prior before opening the package set the encryption password here to properly read the library database.

Note
The icon located on the top right of the slotbox header indicates read/write permission of the project. If you are loading a project directly from a .npk or you are currently running your app. you will only have read permission and the lock will be activated (in other words read-only).

Active Scenes


properties_app_active_scenes.png

List all scenes currently loaded (either automatically or manually) by your application. Select using the radio button located on the left side of the entry which scene you want to edit.

Icon Description
check_icon.png
Determine whether the scene should be updated each frame.
visible_icon.png
Control the visibility of the scene and if the scene render result will contribute to the final image.
upper_icon.png
Increase the rendering priority of the scene.
lower_icon.png
Decrease the rendering priority of the scene.
orbit_icon.png
Reload the scene from the library.

Scripts


properties_app_scripts.png

Manage the script connected to the application itself. To learn how to operate the scripting slot box please refer to the Scripts help section. On top of the standard events like OnUpdate() or OnDraw() the application scripts will allow you to respond to input events coming from the mouse, keyboard, touches, accelerometer, gyroscope and joysticks/gamepads.

To automatically resolve the name of the threads (by using the name of the asset connected to it, if any) associated to the application handler toggle on/off the icon.

Scripts connected to the application will respond to the following events callbacks:

Callback Description
OnStart() Triggered once when your application start.
OnStop() Triggered when the application shutdown.
OnLoad() Triggered every time a new scene is loaded. The scene pointer will be available using the this keyword.
OnUnload() Triggered when a scene is unloaded/removed from the application scene list. The scene pointer will be available using the this keyword.
OnUpdate() Occurs when the application updates (once per frame).
OnDraw() This event happen just before the application is ready to draw.
OnDisplay() Occurs when the application finish drawing the current frame.
OnTouchesBegan() Triggered when a pointing device emits a signal on screen (either mouse or touche).
OnTouchesMoved() One of the active point on screen controlled by the current pointing device have moved.
OnTouchesEnded() The active pointing device stop emitting signal for one or more point(s) on screen.
OnAccelerometer() Triggered once per frame; this callback allows you to read the data emitted by the accelerometer.
OnGyroscope() Triggered once per frame; this callback allows you to read the data emitted by the gyroscope.
OnJoystick() A joystick have been plugged or unplugged.
OnJoystickAxis() Allow you to read all the axis data for the active joysticks.
OnJoystickButtons() Triggered when one or more button(s) on one of the active joysticks have been pressed or released.
OnKeyboard() Handle keyboard events when a key is either pressed or released.
Note
None of the input callbacks listed above will respond when you are in edit mode. Input event callbacks will be available when your application is running and in full-screen mode.

Statistics


properties_app_statistics.png

Provide generic statistics about your application performances and memory usage. In addition, the bottom section of this area allows you to control the built-in performance heads up display and the type of statistics you wish to display on the screen.

Frames Per Sec.: The current frame rate of your application (including editor drawing time).

Frame Time: The time in a millisecond the frame took to be drawn on the screen.

Application Time: The total time since the application start.

Memory Usage: The amount of physical memory your application is using formatted as follows: current memory/memory peak.

Virtual Machine: The total amount of memory the Lua virtual machine is using.

VM References: The amount of unique active virtual machine references cached and linked to an actual memory address of existing resources; the format is active / cache, total memory usage.

History Usage: How much memory is used by the undo/redo buffer of the editor. The format is as follows: current index / total history, total memory usage.

Performance HUD: Control the built-in profiler. To clear the previous results cached to calculate average values over time click the icon to start fresh. For more information please refer the following section (Profiler ).

Profiler


The built-in profiler included at the core of NRG allows you to profile CPU, GPU (GFX), Network as well as the audio mixer. It provides valuable information to learn where the time is spent within your application; the list below is a rundown of all the different modes that you can use to profile your application.

Whether your application is running or you wish to profile a remote device; once activated the statistics will overlay your current drawing and list on all viewports the statistics that you have requested.

Mode Description
CPU Time profile all functions called by the CPU. Results are calculated using the total amount of data accumulated overtime.
CPU+Trace Same as the CPU mode except that results are accumulated on a per second basis.
GFX Profile all GFX (graphics API) function calls; use the total accumulated results to compile the statistics.
GFX+Trace Same as GFX mode except that the results are compiled on a per second basis.
SFX Profile all SFX (audio API) function calls; use the total accumulated results to compile the statistics.
SFX+Trace Same as SFX mode except that the results are compiled on a per second basis.
Audio Mixer Display the activity of the audio mixer; the listing display all sound sources available alongside and display their contribution to the final output.
Frame Statistics Quick and dirty compact CPU/GPU statistics.
Note
Enabling the profiler will introduce a slight performance overhead that might result in a degradation of frames per second.

CPU


properties_app_profiler_cpu.png
properties_app_profiler_cpu_trace.png
Header Description
Fps The current amount of frame displayed per seconds.
Time The average time in milliseconds to draw each frame.
State The current state of your application; playing, paused, stopped.
Frame # The end frame number when the statistics have been compiled.
Data The amount of bytes sent and received per seconds.
Resolution The current width and height in pixels of the current viewport.
Mem. The current amount of physical memory your application is currently consuming.
LVM How much of the physical memory is currently assigned to the Lua virtual machine.
Ref. The current/total amount of memory references pointing to existing in-memory resources the virtual machine is actually maintaining for the current state.
Column Description
Count The total amount of times the function have been called.
Time The average CPU time spent before the function returns.
Self The average CPU time the function itself cost.
TID The thread ID responsible for the function call.
Function The actual function name. In addition to standard CPU function calls scripts execution time are also included in the listing. Functions using the following frame class:function_name are intermediates function calls nested by a standard called relevant enough to affect the function performance to a certain degree.
Remarks
A higher Time and a lower Self time means the function itself call other functions that increase/contribute to its final CPU time cost.

GFX


properties_app_profiler_gfx.png
properties_app_profiler_gfx_trace.png

The left side of the GFX profiler mode is listing all the graphic functions calls (starting with the Gfx identifier) and contain basically the same columns as the CPU profiler mode. For information about the columns headers please refer to CPU. However, the right side introduce new data labeled under GPU Frame Samples & Statistics, refer to the listing below for more info.

Column Description
Count The total amount of times the sampler type have been called. In case of Draw Calls the Total column represents the amount of primitives sent to the GPU; points are weighted as 1, lines as 2, triangles as 3 and triangles strips based on their size accordingly.
Total The total recorded by either frame range (when using trace) or since the profiler starts.
Sampler The type of sampler the statistics are associated to.
Overall/Average The cumulative or average value on a frame/range basis.

Audio Mixer


properties_app_profiler_audio_mixer.png
Header Description
Device The physical device used to output the audio mixer result.
Capture The physical device used to capture audio.
Frequency The frequency rate in hertz of the audio mixer output.
Buffers The total of sound buffer ids currently created and their memory usage.
Sources The total amount of sound source ids created.
Active How many sound source ids are current active.
Inactive How many sound source ids are actually on standby.
Channels The total amount of channels used by the audio mixer to create the final output mix (mono: +1, stereo: +2).
Uploads Numbers of buffer uploads that occurs during the time frame and the total size.
Column Description
Type The type of sound source.
Distance The sound source distance relative to the listener. In case the sound is the type ambient the distance will always be 0.F
Gain The current gain applied on the source. A value of 1.0 is un-attenuated, each multiplication by 2 equals to an amplification of about +6dB.
Time The current playback time of source.
Status Display whether the sound is currently playing or is on standby.
Usage How much sound buffer memory is used to playback the sound source.
Channels How many channels the source is using. Take note a stereo buffers cannot be applied on a positional or directional source.
Source The name resolution of the source formated as Scene@Object_Name.SoundBuffer.

Budget


properties_app_profiler_budget.png

Display which objects are currently rendered on screen. Additional information can be found about the total amount of triangles and points sent to the GPU. This type of statistics is ideal to profile your draw call budget and have a good overall view of wich object is more computationally expensive to draw on GPU.

Frame Stats.


properties_app_profiler_frame_stats.png

This mode breaks down the time spent on each scene for each renderlayer on both CPU and GPU. Take note that this mode will affect the frame rate since it needs to provide accurate CPU and GPU readings and cannot relate on asynchronous operations.

Frame Rate


properties_app_profiler_frame_rate.png

Display the actual application frame rate; this mode have no overhead and is reliable and accurate.

External Files


properties_app_external_files.png

The external files section of the application properties allows you to connect local files to your project, and use it on operating systems supported by NRG at runtime. External files can be anything that your project might require; the same process is also used to directly link plugins created in C/C++ to your project. Once a plugin is added to the external files to your project you can directly call the C/C++ functions it contains from within your scripts.

Plugins are based on dynamic link libraries (Windows .dll), shared objects (.so for Android and Linux) and on MacOS dynamic libraries .dylib. All extensions associated with the existing platform will automatically be detected by the system and loaded accordingly. For more information about plugins and how to access other types of external files from C/C++ and scripts refer to the Scripting API documentation.

Remarks
If you are planning to release a plugin for multiple CPU architectures you will have a to provide multiple version of that plugin to the built-in external file system. The system will automatically detect and load the appropriate plugin for the current CPU architecture.

Platform: Select for which platform the file you are planning to connect to your project is targeted for.

External File: Click the icon to open up the File Explorer to select the file you wish to connect to your project.

Once added to your project, all external files will appear inside the group box located at the top of the external files section. To remove an existing entry click the icon. By default, all external files are tagged to be published along with your project (placed under the extern directory from the project root; see Special Groups). To use an external for production only toggle off the icon.

Note
Files manually added in this section will always be physically available to you regardless of the platform you are publishing on. They can be either written or read at runtime; as a developper each file will be available to you through <project_location> + extern/ + <filename>.
Warning
External files work the same as File Sync.; If you are moving or deleting the source file the editor will not sync your external files. If the path must be changed; you can manually edit your .project file (valid only for non-prebuilt projects) with a text editor.

Excluded Folders


properties_app_excluded_folders.png

This section allows you to exclude folder(s) from the publishing process. Folders can either be excluded on a platform basis; or for the entire application.

Platform: Select for which platform the folder should be excluded.

Exclude Folder: Click the icon to open up the File Explorer in folder selection mode; and select the folder or group you want to excluded.

The folders that are specified for exclusion will appear in the upper list of the section. To remove an existing entry from the list simply press the icon located on the right side of the item. The include or exclusion of the folder for publishing and remote editing can be (including local packing) can be turned on or off using the associated with the entry.

Graphics Extensions


properties_graphics_extensions.png

When you are creating a new project you are bound to choose a core graphics profile to ensure the minimal requirements of your application. Based on that selection other extensions might be available for the selected core profile. Toggle the graphics extension that you wish your application to rely on.

Available extensions are automatically detected when initializing the graphics context on the platform; this section allows you to force or override them. If an extension on the list is disabled it means that it is already included in the core profile that you have selected or are simply currently unavailable. It is recommended to ensure compatibility to use only the core functionalities but many of these extensions are present and supported by all manufacturers.

The list below are the extensions that you can force or override; internally NRG uses others and automatically adjust its functionalities on the availability of these extensions.

Extension Description
Depth textures. OES_depth_texture
Packed depth stencil textures. OES_packed_depth_stencil
Vertex array objects. OES_vertex_array_object
Multiple render targets. EXT_draw_buffers
Occlusion queries. EXT_occlusion_query_boolean
Non power of two textures. OES_texture_npot
Color buffer float. EXT_color_buffer_float
Color buffer half float. EXT_color_buffer_half_float
Enable anisotropic filtering. EXT_texture_filter_anisotropic
Disable compatibility limits. Each core profile contains minimum supported size requirements (ie: texture size, viewport dimension etc...) in their specifications. NRG is internally using the same values off the active core profile you have selected; however most vendor limits are higher than the minimum requirements. Toggling this extension will allow you to bypass the default limits and use the current vendor limits instead. Take note this override might requires extra work to insure the compatibility of your application on all supported platforms.

File Synchronization


properties_app_filesync.png

This section allows you to enable or disable file synchronization for specialized assets. File sync works for scripts, all types of shaders, utilities and textures; to enable for a specific asset first ensure that file sync is "on" by pressing the located at the top right of the section. Then simply import your asset and it will be automatically synchronized.

To clear all active file sync entry press the icon; to enable or disable the synchronization of a specific asset simply press the associated with its entry in the list.

Additional properties are available under File > Preferences > Editors > Settings to tune the frequency and behaviors or the file synchronization. Finally to remove an element from the list press the icon associated to the entry.

Summary


properties_app_summary.png

The bottom section of the application properties offers you an overall view of what is contained within your library. Each asset type and the numbers of assets associated with them is showed as well as the approximated total storage size of your project. Based on the library type that you are opening the storage section will vary. If the open project comes from a .npk to total compress size versus the total size will be displayed (like in the screenshot above) and the compression ratio (when available).

Located at the top right of this section the icon allows you to control whether or not to precompile a database of the assets of your library. If not the assets list will be populated for either the project working directory or the NRG package. Using NADB (NRG Asset Database) can drastically speed up loading large projects that contains many directories where each of them contains multiple files. By precompiling the asset database a single file is executed and populate the whole library asset entries.

Note
Resource sizes are expressed in bytes size not the actual size on disk as it may vary from system to system.




NRGeditor - Manual 2022.4.384543 - Fri Nov 4 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA