SoOffscreenRenderArea Class |
Render to an off-screen buffer for printing or generating textures.
Namespace: OIV.Inventor
The SoOffscreenRenderArea type exposes the following members.
Name | Description | |
---|---|---|
![]() | SoOffscreenRenderArea | Default constructor. |
![]() | SoOffscreenRenderArea(SoGLContext) | Builds a new offscreen render area by sharing the given SoGlContext. |
![]() | SoOffscreenRenderArea(SoRenderAreaCore) | Builds a new offscreen render area by using the given renderAreaCore. |
Name | Description | |
---|---|---|
![]() | Dispose |
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.) |
![]() | Equals | (Inherited from Object.) |
![]() | GetAntialiasingMode | |
![]() | GetAntialiasingQuality | |
![]() | GetClearColor | |
![]() | GetClearDepth | |
![]() | GetClearPolicy | |
![]() | GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) |
![]() ![]() | GetMaxTileSize | Gets the maximum subimage (tile) size for rendering. |
![]() | GetNumEdgePixels | |
![]() | GetSceneGraph | |
![]() | GetSceneManager | Returns the encapsulated scene manager. |
![]() | GetSize | |
![]() | GetTileSize | |
![]() | GetTransparencyType | |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | GetViewportRegion | |
![]() | Render | Applies an OIV.Inventor.Actions.SoGLRenderAction to the scene graph managed here. |
![]() | RenderToBuffer | Render the given scene graph and save the result in the given buffer. |
![]() | RenderToFile | Render the given scene graph and save the result in the given file. |
![]() | SetAntialiasingMode | Define the antialiasing mode. |
![]() | SetAntialiasingQuality | Define the antialiasing quality value. |
![]() | SetClearColor | Defines the RGBA value used when the color buffer is cleared. |
![]() | SetClearDepth | Defines the depth value used when the depth buffer is cleared. |
![]() | SetClearPolicy | Defines the color buffer and depth buffer clear policy. |
![]() | SetSceneGraph | Defines the scene graph which will be traversed for rendering. |
![]() | SetSize | Defines the image size to use for rendering. |
![]() | SetTile | 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. |
![]() | SetTransparencyType | Defines the algorithm for rendering transparent objects. |
![]() | SetViewportRegion | Defines viewport region (within the image) to use for rendering. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
![]() | IsDisposable | ISafeDisposable interface implementation.
(Inherited from SoDisposable.) |
Name | Description | |
---|---|---|
![]() | OnTileRendered | Event raised when a tile has been rendered. |
![]() | StartRender | 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.
Limitations:
Can only generate an RGB image (not, for example, RGBA).
Maximum output image size is 25000 x 25000 pixels.
SoOffscreenRenderArea myOffscreen = new SoOffscreenRenderArea(); myOffscreen.setSize( new SbVec2i32( 15360, 8640 ) ); myOffscreen.SetSceneGraph(mySceneGraph); 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", 1.0f); myOffscreen.RenderToBuffer(myBuffer);
Since Open Inventor 10.0