Purpose

The module OffscreenRenderer renders an Open Inventor scene to an ML image.

In contrast to the Viewer modules (e.g., SoExaminerViewer), the render area is not visible and may be much larger than the physical screen space (e.g., 3000x3000 pixel depending on the graphics card capabilities).

Usage

Just like any other OpenGL renderer the OffscreenRenderer module requires a virtual camera and at least one light source in the scene.

For simplicity, you can use the module SoCameraInteraction to provide a camera and a light source.

Have a look at the example network.

Details

Internally, the OffscreenRender uses OpenGL p-buffers to render the scene.

It is therefore quite fast, but the transfer of the frame buffer’s content to the ML image highly depends on the OpenGL implementation, which may be quite slow for large images.

Windows

Default Panel

../../../Modules/ML/MLOffscreenRenderer/mhelp/Images/Screenshots/OffscreenRenderer._default.png

Input Fields

sceneGraph

name: sceneGraph, type: SoNode

Output Fields

output0

name: output0, type: Image

Parameter Fields

Field Index

Background Color: Color Type: Enum
Buffer Type: Enum Update: Trigger
Enable Multi Sampling: Bool Use stencil: Bool
Multi Sampling: Integer  
Pixel Scale: Float  
Size: Vector2  
Supported: Bool  
Transparency: Enum  

Visible Fields

Transparency

name: transparencyType, type: Enum, default: BLEND

Defines the transparency to be used during rendering the scene graph.

Values:

Title Name
Screen Door SCREEN_DOOR
Add ADD
Delayed Add DELAYED_ADD
Sorted Object Add SORTED_OBJECT_ADD
Blend BLEND
Delayed Blend DELAYED_BLEND
Sorted Object Blend SORTED_OBJECT_BLEND

Type

name: imageType, type: Enum, default: RGB

Defines the type of ML output image (the C-dimension).

A change to this parameter will result in a new OpenGL p-buffer.

Values:

Title Name
Rgb RGB
Rgba RGBA
Rgba Float RGBA_FLOAT

Buffer Type

name: bufferType, type: Enum, default: AUTO

Defines the used buffer type.

Values:

Title Name
Auto AUTO
Pixel Buffer PIXEL_BUFFER

Supported

name: supported, type: Bool, persistent: no

Shows whether the hardware supports p-buffers.

Use stencil

name: stencilBuffer, type: Bool, default: FALSE

If checked, the offscreen renderer uses a p-buffer with a stencil buffer.

This is needed for e.g. SoSilhouette.

Size

name: size, type: Vector2, default: 64 64

Sets the size of the offscreen render area.

Pixel Scale

name: pixelScale, type: Float, default: 1

Sets the scale factor that is applied to pixel sizes and fonts in order to maintain readability on high-resolution images.

Background Color

name: bgColor, type: Color, default: 0 0 0

Sets the background color that is used to clear the frame buffer before rendering.

Update

name: update, type: Trigger

If pressed, the connected Open Inventor scene is rendered anew into the p-buffer and its content is written to the ML output image.

Enable Multi Sampling

name: enableMultiSampling, type: Bool, default: FALSE

Enable multi sample anti-aliasing (MSAA). This only works if framebuffer objects are supported and if Buffer Type is set to Auto.

Multi Sampling

name: multiSampling, type: Integer, default: 16

Sets the number of multi sampling samples that are used. If the hardware supports less samples, the module uses the maximum supported number of samples.