SAMSON has an internal renderer that relies on OpenGL to display visual representations of the data graph. Developers of SAMSON Elements who want to display geometry in a SAMSON viewport typically implement display
functions in their classes (e.g. in a class derived from SBMVisualModel to implement a visual model), potentially thanks to display utility functions provided by SAMSON.
The internal renderer is also used to perform node selection, so that developers who want to add selectable objects to the data graph have to implement the displayForSelection
function of their data graph nodes.
See User guide: Visualizing for more information on SAMSON's rendering possibilities and settings.
SAMSON renders each frame using the following pipeline:
display
functions, which may be reimplemented in SAMSON Elements.display
function at this stage to achieve this type of functionality.displayInterface
function at this stage to achieve this type of functionality.
SAMSON uses shadow maps to implement shadows. During the Shadow computations step, the data graph is rendered from the point of view of the first light, to generate a depth map that is used during the post-processing step to determine whether a pixel should be shadowed or not.
To perform rendering, SAMSON uses, and requires from developers of SAMSON Elements to use, core-profile OpenGL functionality. For example, shaders are used to display e.g. atoms, bonds, etc. This implies that legacy OpenGL function calls (e.g. glBegin
, glEnd
, etc.) are not supported and should not be used in SAMSON Elements.
Because using core OpenGL functionality is sometimes cumbersome, especially when rendering simple objects, SAMSON provides several utility functions to render geometric primitives in batches, especially when implementing display
functions of data graph nodes. For example, the displayTriangles function makes it easy to display triangles in a SAMSON viewport.
These utility functions, in particular, facilitate the use of the renderer to perform node selection.
Please refer to the documentation of the SAMSON interface for information about each display function.