This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine.WidgetSpriteViewport Class

Inherits from: WidgetSprite

This class is used to create virtual monitors that display data from arbitrary cameras in the world. This widget is used to render the whole scene, with all engine post-processes like HDR, DOF, motion blur, glow, etc. Unlike WidgetSpriteNode, this widget does not support alpha channel masking.

Notice
By default, the sprite viewport is rendered at the same frame rate as the main Unigine viewport. For it to be rendered at different frame rate (for example, lower one in order to decrease the rendering load), use setIFps().

The following sample demonstrates the usage of the WidgetSpriteViewport class:

WidgetSpriteViewport Class

Properties

float IFps#

The constant frame duration used to render WidgetSpriteViewport viewport.

int SkipFlags#

The skip flag set for the current viewport.

mat4 Modelview#

The model-view matrix of the associated camera.

mat4 Projection#

The projection matrix of the associated camera.

int ReflectionViewportMask#

The bit mask for rendering reflections into the viewport. Reflections are rendered in the sprite viewport if masks of reflective materials match this one (one bit at least).

int ViewportMask#

The bit mask for rendering into the viewport. Nodes are rendered in the sprite viewport if their masks match this one.

int TextureHeight#

The height of the texture buffer used for a widget that affects the widget size.

int TextureWidth#

The width of the texture buffer used for a widget that affects the widget size.

bool AspectCorrection#

The value indicating if the aspect correction enabled for WidgetSpriteViewport.

bool UseTAAOffset#

The value indicating if skipping render mode check is enabled for using TAA. Can be used to ensure proper TAA calculation when rendering mode for the Viewport is set to RENDER_DEPTH.

Members


WidgetSpriteViewport ( Gui gui, int width, int height ) #

Constructor. Creates a new viewport sprite with given properties and adds it to the specified GUI.

Arguments

  • Gui gui - GUI, to which the new sprite will belong.
  • int width - Width of the sprite.
  • int height - Height of the sprite.

WidgetSpriteViewport ( int width, int height ) #

Constructor. Creates a new viewport sprite with given properties and adds it to the Engine GUI.

Arguments

  • int width - Width of the sprite.
  • int height - Height of the sprite.

void SetCamera ( Camera camera ) #

Copies parameters of the given Camera instance.

Arguments

  • Camera camera - Camera to be copied.

Camera GetCamera ( ) #

Copies the instance of camera.

Return value

Camera instance.

void AppendSkipFlags ( int flags ) #

Appends a new skip flag without rewriting already set.

Arguments

  • int flags - A skip flag. Available flags:
    • SKIP_SHADOWS
    • SKIP_VISUALIZER
    • SKIP_POSTEFFECTS
    • SKIP_DYNAMIC_REFLECTIONS
    • SKIP_VELOCITY_BUFFER
    • SKIP_SRGB

int CheckSkipFlags ( int flags ) #

Checks if given flags are already set.

Arguments

  • int flags - A skip flag. Available flags:
    • SKIP_SHADOWS
    • SKIP_VISUALIZER
    • SKIP_POSTEFFECTS
    • SKIP_DYNAMIC_REFLECTIONS
    • SKIP_VELOCITY_BUFFER
    • SKIP_SRGB

Return value

1 if flag/flags already set, otherwise 0.

void RemoveSkipFlags ( int flags ) #

Removes the given skip flag without affecting other set flags.

Arguments

  • int flags - A skip flag to be removed. Available flags:
    • SKIP_SHADOWS
    • SKIP_VISUALIZER
    • SKIP_POSTEFFECTS
    • SKIP_DYNAMIC_REFLECTIONS
    • SKIP_VELOCITY_BUFFER
    • SKIP_SRGB

void RenderImage ( Image image ) #

Renders the sprite viewport into the image.

Arguments

  • Image image - Source image.

void SetImage ( Image image, int dynamic = 0 ) #

Sets a loaded into memory image for the first (bottom) layer of the sprite. This layer always exists in the sprite. An additional flag can be set in case the sprite image is going to be updated often or even each frame (for optimized memory management).
Warning
This method is intended for changing the sprite's background texture and is valid only for the base WidgetSprite class. It cannot be used for the WidgetSpriteViewport!

Arguments

  • Image image - Pointer to the image.
  • int dynamic - Positive number if the image will be updated each frame; otherwise, 0.

Image GetImage ( ) #

Returns the loaded into memory image that is currently set for the first (bottom) layer of the sprite.
Warning
This method is valid only for the base WidgetSprite class. It cannot be used for the WidgetSpriteViewport!

Return value

Pointer to the image.

void SetRender ( Texture texture, int flipped = 0 ) #

Sets a texture to be rendered for the first (bottom) layer of the sprite.
Warning
This method is intended for changing the sprite's background texture and is valid only for the base WidgetSprite class. It cannot be used for the WidgetSpriteViewport!

Arguments

  • Texture texture - Pointer to the texture.
  • int flipped - Flipped flag.

Texture GetRender ( ) #

Returns the pointer to the texture that is currently set for the first (bottom) layer of the sprite.
Warning
This method is valid only for the base WidgetSprite class. It cannot be used for the WidgetSpriteViewport!

Return value

Pointer to the texture.

void SetUseTAAOffset ( bool offset ) #

Sets a value indicating if skipping render mode check is enabled for using TAA. Can be used to ensure proper TAA calculation when rendering mode for the Viewport is set to RENDER_DEPTH.

Arguments

  • bool offset - true to enable skipping render mode check and use TAA; otherwise false.

bool IsUseTAAOffset ( ) #

Returns a value indicating if skipping render mode check is enabled for using TAA. Can be used to ensure proper TAA calculation when rendering mode for the Viewport is set to RENDER_DEPTH.

Return value

true if skipping render mode check is enabled for using TAA; otherwise false.
Last update: 2022-12-14
Build: ()