Unigine::Render Class
Unigine render. This interface provides access to Unigine rendering functions. For example, it is used by AppWall application to render onto multiple monitors.
To use this class, include the UnigineRender.h file.
Unigine::Render Class
Members
virtual ~Render ()
Virtual destructor.static Render * get ()
Return a pointer to the existing render.Return value
Pointer to the existing render.static void addRenderer (Renderer * render)
Adds the external renderer.Arguments
- Renderer * render - Pointer to the external renderer.
static void removeRenderer (Renderer * render)
Removes the external renderer.Arguments
- Renderer * render - Pointer to the external renderer.
virtual void setEnabled (int enable) const =0
Enable or disable the render.Arguments
- int enable - 1 to enable the render, 0 to disable it.
virtual int isEnabled () const =0
Return a value indicating if the render is enabled.Return value
Return 1 if the render is enabled; otherwise, 0 is returned.virtual void setFirstFrame (int first) const =0
The first frame flag.Arguments
- int first - The first frame flag.
virtual int isFirstFrame () const =0
Return the first frame flag.Return value
Return the first frame flag.virtual void updateCameraOffset (const UNIGINE_VEC3 & position) const =0
Update virtual camera offset.Arguments
- const UNIGINE_VEC3 & position - Camera position.
virtual void setCameraOffset (const UNIGINE_VEC3 & offset) const =0
Set virtual camera offset.Arguments
- const UNIGINE_VEC3 & offset - Virtual camera offset.
virtual UNIGINE_VEC3 getCameraOffset () const =0
Return virtual camera offset.Return value
Return virtual camera offset.virtual void setCameraThreshold (float threshold) const =0
Set virtual camera threshold.Arguments
- float threshold - Virtual camera threshold.
virtual float getCameraThreshold () const =0
Get virtual camera threshold.Return value
Virtual camera threshold.virtual void setShaderDefines (const char * defines) const =0
Set additional shader defines.Arguments
- const char * defines - Additional shader defines.
virtual const char * getShaderDefines () const =0
Return additional shader defines.Return value
Additional shader defines.virtual void setStereoDistance (float distance) const =0
Set stereo distance.Arguments
- float distance - Stereo distance.
virtual float getStereoDistance () const =0
Get stereo distance.Return value
Stereo distance.virtual void setStereoRadius (float radius) const =0
Set stereo radius.Arguments
- float radius - Stereo radius.
virtual float getStereoRadius () const =0
Get stereo radius.Return value
Stereo radius.virtual void setStereoOffset (float offset) const =0
Set stereo offset.Arguments
- float offset - Stereo offset.
virtual float getStereoOffset () const =0
Get stereo offset.Return value
Stereo offset.virtual TexturePtr getBlack2DTexture () const =0
Return black 2D texture.Return value
Black 2D texture.virtual TexturePtr getBlackCubeTexture () const =0
Return black Cube texture.Return value
Black Cube texture.virtual TexturePtr getWhite2DTexture () const =0
Return white 2D texture.Return value
White 2D texture.virtual TexturePtr getWhiteCubeTexture () const =0
Return white Cube texture.Return value
White Cube texture.virtual TexturePtr getGray2DTexture () const =0
Return gray 2D texture.Return value
Gray 2D texture.virtual TexturePtr getGrayCubeTexture () const =0
Return gray Cube texture.Return value
Gray Cube texture.virtual TexturePtr getEnvironmentTexture () const =0
Return environment texture.Return value
Environment texture.virtual void renderViewport (const mat4 & projection, const UNIGINE_MAT4 & modelview, const char * materials, int viewport_mask, int reflection_mask, int shadows) const =0
Renders the viewport into the current render target.Arguments
- const mat4 & projection - Projection matrix.
- const UNIGINE_MAT4 & modelview - Modelview matrix.
- const char * materials - Post materials (comma separated).
- int viewport_mask - Viewport bit mask.
- int reflection_mask - Reflection bit mask.
- int shadows - Shadows toggle.
virtual void renderViewport (const mat4 & projection, const UNIGINE_MAT4 & modelview, const mat4 * projections, const UNIGINE_MAT4 * modelviews, const char * materials, int viewport_mask, int reflection_mask, int shadows) const =0
Renders the stereo viewport into the current render target.Arguments
- const mat4 & projection - Mono projection matrix.
- const UNIGINE_MAT4 & modelview - Mono modelview matrix.
- const mat4 * projections - Stereo projection matrices.
- const UNIGINE_MAT4 * modelviews - Stereo modelview matrices.
- const char * materials - Post materials (comma separated).
- int viewport_mask - Viewport bit mask.
- int reflection_mask - Reflection bit mask.
- int shadows - Shadows toggle.
virtual void renderNode (const mat4 & projection, const UNIGINE_MAT4 & modelview, const NodePtr & node, const char * materials, int viewport_mask, int reflection_mask, int shadows) const =0
Renders a specific node with all children into the current render target.Arguments
- const mat4 & projection - Projection matrix.
- const UNIGINE_MAT4 & modelview - Modelview matrix.
- const NodePtr & node - Target node pointer.
- const char * materials - Post materials (comma separated).
- int viewport_mask - Viewport bit mask.
- int reflection_mask - Reflection bit mask.
- int shadows - Shadows toggle.
virtual void renderProcedurals (const Vector< MaterialPtr > & materials) const =0
Render procedural materials.Arguments
- const Vector< MaterialPtr > & materials - Procedural materials list.
virtual void renderImage2D (const mat4 & projection, const UNIGINE_MAT4 & modelview, const ImagePtr & image, int width, int height, const char * materials, int hdr) const =0
Renders the scene into a 2D image.Arguments
- const mat4 & projection - Projection matrix.
- const UNIGINE_MAT4 & modelview - Modelview matrix.
- const ImagePtr & image - Destination image pointer.
- int width - Width of the image.
- int height - Height of the image.
- const char * materials - Post materials (comma separated).
- int hdr - HDR toggle.
virtual void renderImageCube (const mat4 & projection, const UNIGINE_VEC3 & position, const ImagePtr & image, int size, const char * materials, int hdr) const =0
Renders the scene into a cube map image.Arguments
- const mat4 & projection - Projection matrix.
- const UNIGINE_VEC3 & position - World position.
- const ImagePtr & image - Destination image pointer.
- int size - Size of the image.
- const char * materials - Post materials (comma separated).
- int hdr - HDR toggle.
virtual int loadWorld (const XmlPtr & xml) const =0
Load a render state from the Xml.Arguments
- const XmlPtr & xml - Xml smart pointer.
Return value
Returns 1 if the operation was a success; otherwise, 0 is returned.virtual int saveWorld (const XmlPtr & xml) const =0
Save a render state into the Xml.Arguments
- const XmlPtr & xml - Xml smart pointer.
Return value
Returns 1 if the operation was a success; otherwise, 0 is returned.virtual int saveState (const StreamPtr & stream) const =0
Save a render state into the stream.Arguments
- const StreamPtr & stream - Stream smart pointer.
Return value
Returns 1 if the operation was a success; otherwise, 0 is returned.virtual int restoreState (const StreamPtr & stream) const =0
Restore a render state from the stream.Arguments
- const StreamPtr & stream - Stream smart pointer.
Return value
Returns 1 if the operation was a success; otherwise, 0 is returned.Unigine::Render::anonymous_78 Enumeration
PASS_WIREFRAME
= 0
PASS_DEFERRED
PASS_AUXILIARY
PASS_REFRACTION
PASS_VELOCITY
PASS_AMBIENT
PASS_LIGHT_PROB
PASS_LIGHT_SPOT
PASS_LIGHT_OMNI
PASS_LIGHT_PROJ
PASS_LIGHT_WORLD
PASS_TRANSLUCENT
PASS_SHADOW
PASS_POST
Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)