Unigine.WidgetSpriteViewport Class
Inherits: | 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.
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 current constant frame duration used to render widgetspriteviewport viewport.
set
Sets a constant frame duration used to render sprite viewport. It can be used to decrease the frame rate to get higher performance. (For example, if the widget is used to create a TV set, lowered frame rate makes no visual difference, but allows for faster rendering of the scene.)
set value -
Frame duration in seconds (1/FPS). If a too small value is provided, 1E-6 will be used instead. 0 means that a widget is rendered at the same frame rate as the main application window.
int SkipFlags#
The skip flag set for the current viewport.
set
string PostMaterials#
Names of the current post postprocess materials that are applied after all other postprocess are rendered. they are used after engine.render.getpostmaterials(), if any.
set
Sets post postprocess materials that are applied after all other postprocess are rendered. They are used after engine.render.setPostMaterials(), if any.
set value -
Comma-separated names of postprocess materials.
mat4 Modelview#
The current model-view matrix of the associated camera.
set
Sets a model-view matrix for the associated camera.
set value -
Model-view matrix.
mat4 Projection#
The current projection matrix of the associated camera.
set
Sets a projection matrix for the associated camera.
set value -
Projection matrix.
int ReflectionViewportMask#
The current 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).
set
Sets a 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).
set value -
Integer, each bit of which is a mask.
int ViewportMask#
The current bit mask for rendering into the viewport. nodes are rendered in the sprite viewport if their masks match this one.
set
Sets a bit mask for rendering into the viewport. Nodes are rendered in this sprite viewport if their masks match this one.
set value -
Integer, each bit of which is a mask.
int TextureHeight#
The height of the texture buffer used for a widget that affects the widget size.
set
Sets the height of the texture buffer used for a widget. This affects the widget size accordingly.
set value -
Height of the texture buffer size.
int TextureWidth#
The width of the texture buffer used for a widget that affects the widget size.
set
Sets the width of the texture buffer used for a widget. This affects the widget size accordingly.
set value -
Width of the texture buffer size.
int AspectCorrection#
The value indicating if the aspect correction enabled for widgetspriteviewport.
set
Sets the aspect correction for the WidgetSpriteViewport. 1 enables correction, 0 disables.
set value -
1 to enable aspect correction, 0 to disable.
Members
static WidgetSpriteViewport ( Gui gui, int width, int height ) #
Constructor. Creates a new viewport sprite with given properties.Arguments
- Gui gui - GUI, to which the new sprite will belong.
- 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).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.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.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.This method is valid only for the base WidgetSprite class. It cannot be used for the WidgetSpriteViewport!
Return value
Pointer to the texture.Last update:
2020-04-10
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)