Click or drag to resize
SoOffscreenRenderArea Class

Render to an off-screen buffer for printing or generating textures.

Inheritance Hierarchy

Namespace: OIV.Inventor
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 2024.1.1.0 (2024.1.1)
public class SoOffscreenRenderArea : SoDisposable, 
	SiRenderArea, SiRenderAreaAntialiasing, SiRenderAreaTransparency

The SoOffscreenRenderArea type exposes the following members.

Public methodSoOffscreenRenderArea

Default constructor.

Public methodSoOffscreenRenderArea(SoGLContext)

Builds a new offscreen render area by sharing the given SoGlContext.

Public methodSoOffscreenRenderArea(SoRenderAreaCore)

Builds a new offscreen render area by using the given renderAreaCore.

Public methodDispose
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetAntialiasingMode
Public methodGetAntialiasingQuality
Public methodGetClearColor
Public methodGetClearDepth
Public methodGetClearPolicy
Public methodGetGLRenderAction

Returns the render action used for rendering.

Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodStatic memberGetMaxTileSize

Gets the maximum subimage (tile) size for rendering.

Public methodGetNumEdgePixels
Public methodGetSceneGraph
Public methodGetSceneManager

Returns the encapsulated scene manager.

Public methodGetSize
Public methodGetTileSize
Public methodGetTransparencyType
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetViewportRegion
Public methodRender

Calling the OIV.Inventor.SoOffscreenRenderArea.Render() method is useless and does nothing.

Public methodRenderToBuffer(SoBufferObject)
Calls RenderToBuffer(buffer, OIV.Inventor.SoOffscreenRenderArea.OutputFormats( .SoOffscreenRenderArea.RGB )).
Public methodRenderToBuffer(SoBufferObject, SoOffscreenRenderAreaOutputFormats)

Render the given scene graph and save the result in the given buffer.

Public methodRenderToFile(String)
Calls RenderToFile(filename, OIV.Inventor.SoOffscreenRenderArea.OutputFormats( .SoOffscreenRenderArea.RGB )).
Public methodRenderToFile(String, SoOffscreenRenderAreaOutputFormats)

Render the given scene graph and save the result in the given file.

Public methodSetAntialiasingMode

Define the antialiasing mode.

Public methodSetAntialiasingQuality

Define the antialiasing quality value.

Public methodSetClearColor

Defines the RGBA value used when the color buffer is cleared.

Public methodSetClearDepth

Defines the depth value used when the depth buffer is cleared.

Public methodSetClearPolicy

Defines the color buffer and depth buffer clear policy.

Public methodSetGLRenderAction

Defines the render action used for rendering.

Public methodSetSceneGraph

Defines the scene graph which will be traversed for rendering.

Public methodSetSize

Defines the image size to use for rendering.

Public methodSetTile

Defines the maximum sub-image (tile) size for rendering and the number of pixels on the border of each sub-image that are not written on the final image.

Public methodSetTransparencyType

Defines the algorithm for rendering transparent objects.

Public methodSetViewportRegion

Defines viewport region (within the image) to use for rendering.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public propertyIsDisposable
ISafeDisposable interface implementation.
(Inherited from SoDisposable.)
Public eventOnTileRendered

Event raised when a tile has been rendered.

Public eventStartRender

Returns the event handler that raises when a new render starts.


This class is used to render a scene graph and to write the the result into a file or a buffer.

This is not a screen capture class. The specified scene graph is rendered to generate an image. This allows generation of images larger (higher resolution) than the user's screen and/or using different (e.g. higher quality) rendering parameters. The offscreen rendering may take more or less time than the same rendering on screen.

The renderer can render very large images because it is able to render the scene as multiple "tiles" and assemble the tiles into a complete image. Of course this requires multiple render traversals of the specified scene graph (one for each tile).

Rendering a "snapshot":

Your application may want to render the same image that the user sees on the screen. There are several things to consider. First, the scene graph given to the renderer must include the camera node that the viewer is using. If the application allows the viewer to create a camera automatically, the scene graph returned by the viewer's OIV.Inventor.SoOffscreenRenderArea.GetSceneGraph() method does not include the camera. It's always safer to get the OIV.Inventor.SoSceneManager object then get the scene graph. Second, some rendering options are set on the viewer object, not in the scene graph. These options, which include background color and transparency mode, must be explicitly queried from the viewer and set on the renderer object.

Notes & Limitations:

SoOffscreenRenderArea myOffscreen = new SoOffscreenRenderArea();
myOffscreen.setSize( new SbVec2i32( 15360, 8640 ) );
if ( tileRendering )
 myOffscreen.SetTile(new SbVec2i32(3840, 2160), 2);

myOffscreen.SetClearColor( new SbColorRGBA(1.f, 1.f, 1.f, 1.f) );

myOffscreen.RenderToFile("result.png", SoOffscreenRenderArea.OutputFormats.RGBA);


Note Note

Member available since Open Inventor 10.0

See Also