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 | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
GetAntialiasingMode | ||
GetAntialiasingQuality | ||
GetClearColor | ||
GetClearDepth | ||
GetClearPolicy | ||
GetGLRenderAction | Returns the render action used for rendering. | |
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 | Performs an offscreen rendering of the scene graph without saving the result. | |
RenderToBuffer(SoBufferObject) | Calls RenderToBuffer(buffer, OIV.Inventor.SoOffscreenRenderArea.OutputFormats( .SoOffscreenRenderArea.RGB )). | |
RenderToBuffer(SoBufferObject, SoOffscreenRenderAreaOutputFormats) | Render the given scene graph and save the result in the given buffer. | |
RenderToFile(String) | Calls RenderToFile(filename, OIV.Inventor.SoOffscreenRenderArea.OutputFormats( .SoOffscreenRenderArea.RGB )). | |
RenderToFile(String, SoOffscreenRenderAreaOutputFormats) | 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. | |
SetGLRenderAction | Defines the render action used for rendering. | |
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.
Notes & Limitations:
The default tile size is set to the maximum viewport size supported by the hardware (GL_MAX_VIEWPORT_DIMS), which means that tiling will be enabled only when large viewport sizes are requested.
When tiling is enabled, the elements OIV.Inventor.Elements.SoViewportRegionElement, OIV.Inventor.Elements.SoLogicalViewportElement and OIV.Inventor.Elements.SoModifyViewVolumeElement are set with different values for each tile, which means that scenegraphs that manage sub-viewports will need to take these elements into account in order for the final rendering to be correct.
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", SoOffscreenRenderArea.OutputFormats.RGBA); myOffscreen.RenderToBuffer(myBuffer);
Note |
---|
Member available since Open Inventor 10.0 |