Ramses Core API

enum class EEffectUniformSemantic

Effect uniform semantic type.

Values:

enumerator Invalid

Invalid semantic.

enumerator ProjectionMatrix

Projection matrix 4x4.

enumerator ModelMatrix

Mesh model matrix 4x4.

enumerator CameraWorldPosition

^ Position, from where the renderer eye looks at the scene in world coordinates

Camera position vector 3

enumerator ViewMatrix

View matrix 4x4.

enumerator ModelViewMatrix

Model-view matrix 4x4.

enumerator ModelViewMatrix33

Model-view matrix 3x3.

enumerator ModelViewProjectionMatrix

Model-view-projection matrix 4x4.

enumerator NormalMatrix

Transposed and inversed MVP matrix for vertex normals.

enumerator DisplayBufferResolution

Resolution of currently set destination display buffer (either display framebuffer or offscreen buffer, does not give RenderTarget resolution)

enumerator TextTexture

Text specific.

enumerator TimeMs

synchronized clock in milliseconds, resets to 0 every ~24 days, i.e. value range is: 0 .. std::numeric_limits<int32_t>::max(). In order to avoid handling the wrap in the shader code or potential overflow issues the value should be reset using ramses::Scene::resetUniformTimeMs(). The value is not reset automatically at startup, but contains the time elapsed since clock epoch.

enum class EEffectAttributeSemantic

Effect attribute semantic type.

Values:

enumerator Invalid

Invalid semantic.

enumerator TextPositions

Text specific - vertex positions input. MUST be of type vec2.

enumerator TextTextureCoordinates

Text specific - texture coordinates input. MUST be of type vec2.

enum class EBlendOperation : uint8_t

Specifies the blending operation.

Values:

enumerator Disabled
enumerator Add
enumerator Subtract
enumerator ReverseSubtract
enumerator Min
enumerator Max
enum class EBlendFactor : uint8_t

Specifies the blending factor used with blending operation.

Values:

enumerator Zero
enumerator One
enumerator SrcAlpha
enumerator OneMinusSrcAlpha
enumerator DstAlpha
enumerator OneMinusDstAlpha
enumerator SrcColor
enumerator OneMinusSrcColor
enumerator DstColor
enumerator OneMinusDstColor
enumerator ConstColor
enumerator OneMinusConstColor
enumerator ConstAlpha
enumerator OneMinusConstAlpha
enumerator AlphaSaturate
enum class ECullMode : uint8_t

Specifies the culling mode.

Values:

enumerator Disabled
enumerator FrontFacing
enumerator BackFacing
enumerator FrontAndBackFacing
enum class EDepthWrite : uint8_t

Specifies the depth write state.

Values:

enumerator Disabled
enumerator Enabled
enum class EScissorTest : uint8_t

Specifies the scissor test state.

Values:

enumerator Disabled
enumerator Enabled
enum class EDepthFunc : uint8_t

Specifies the depth function.

Values:

enumerator Disabled
enumerator Greater
enumerator GreaterEqual
enumerator Less
enumerator LessEqual
enumerator Equal
enumerator NotEqual
enumerator Always
enumerator Never
enum class EStencilFunc : uint8_t

Specifies the stencil function.

Values:

enumerator Disabled
enumerator Never
enumerator Always
enumerator Equal
enumerator NotEqual
enumerator Less
enumerator LessEqual
enumerator Greater
enumerator GreaterEqual
enum class EStencilOperation : uint8_t

Specifies the stencil operation.

Values:

enumerator Keep
enumerator Zero
enumerator Replace
enumerator Increment
enumerator IncrementWrap
enumerator Decrement
enumerator DecrementWrap
enumerator Invert
enum class EDrawMode : uint8_t

Specifies the drawing mode.

Values:

enumerator Points
enumerator Lines
enumerator LineLoop
enumerator Triangles
enumerator TriangleStrip
enumerator TriangleFan
enumerator LineStrip
enum class ERotationType : uint8_t

Specifies the rotation convention used in calculation of transforms in a right-handed coordinate system. The order of the letters in each enum value represents the order in extrinsic notation. Extrinsic convention means a rotation around any ordered set of axes ABC is done in the specified order around the original world axes which are fixed. So the object gets rotated around world original axis A, then the result is rotated around world original axis B, then the result of both is rotated around world original axis C. This is opposite to intrinsic notation, where each axis of rotation gets affected by the rotations applied to preceding axes in the rotation order, i.e., the rotation axes get rotated with objects’ rotation around every axis, e.g., rotation around axes ABC would result in rotation around world original axis A, then rotation around axis B from the object’s perspective according to its orientation from the applied rotation around axis A, then rotation around axis C from the object’s perspective according to its orientation as result of applied rotations axes around A and B.

Extrinsic rotation conventions also mean that the order of axes specified is the inverse order of applying rotation matrix multiplication. For example Euler_ZYX means the rotation matrix will be of the shape Rx * Ry * Rz * v where v is a vector or another matrix and R are right-handed rotation matrices which rotate around an axis specified by the rotation order. Check the specific enum documentation for the exact rotation order in terms of ‘which rotation is applied first’.

Values:

enumerator Euler_XYZ

rotates around X then Y then Z axis in world coordinate system

enumerator Euler_XZY

rotates around X then Z then Y axis in world coordinate system

enumerator Euler_YXZ

rotates around Y then X then Z axis in world coordinate system

enumerator Euler_YZX

rotates around Y then Z then X axis in world coordinate system

enumerator Euler_ZXY

rotates around Z then X then Y axis in world coordinate system

enumerator Euler_ZYX

rotates around Z then Y then X axis in world coordinate system

enumerator Euler_XYX

rotates around X then Y then X axis in world coordinate system

enumerator Euler_XZX

rotates around X then Z then X axis in world coordinate system

enumerator Euler_YXY

rotates around Y then X then Y axis in world coordinate system

enumerator Euler_YZY

rotates around Y then Z then Y axis in world coordinate system

enumerator Euler_ZXZ

rotates around Z then X then Z axis in world coordinate system

enumerator Euler_ZYZ

rotates around Z then Y then Z axis in world coordinate system

enumerator Quaternion

rotation is defined by a normalized quaternion

enum class EScenePublicationMode

Specifies the mode of scene publication.

When using localOnly publication it is possible to render the scene locally without calling ramses::RamsesFramework::connect.

Values:

enumerator LocalAndRemote
enumerator LocalOnly
enum class EVisibilityMode : int8_t

Specifies the mode of node visibility.

Values:

enumerator Off

A node shall be invisible and the node shall not trigger its resources to be loaded.

enumerator Invisible

A node shall be invisible, but the node shall trigger its resources to be loaded.

enumerator Visible

A node shall be fully loaded and visible.

enum class ERamsesObjectType

RamsesObject type ID.

Values:

enumerator Invalid
enumerator ClientObject
enumerator RamsesObject
enumerator SceneObject
enumerator Client
enumerator Scene
enumerator LogicEngine
enumerator LogicObject
enumerator Node
enumerator MeshNode
enumerator Camera
enumerator PerspectiveCamera
enumerator OrthographicCamera
enumerator Effect
enumerator Appearance
enumerator Geometry
enumerator PickableObject
enumerator Resource
enumerator Texture2D
enumerator Texture3D
enumerator TextureCube
enumerator ArrayResource
enumerator RenderGroup
enumerator RenderPass
enumerator BlitPass
enumerator TextureSampler
enumerator TextureSamplerMS
enumerator RenderBuffer
enumerator RenderTarget
enumerator ArrayBuffer
enumerator Texture2DBuffer
enumerator DataObject
enumerator SceneReference
enumerator TextureSamplerExternal
enum class ETextureSamplingMethod : uint8_t

Texture sampling method.

Values:

enumerator Nearest
enumerator Linear
enumerator Nearest_MipMapNearest
enumerator Nearest_MipMapLinear
enumerator Linear_MipMapNearest
enumerator Linear_MipMapLinear
enum class ETextureAddressMode : uint8_t

Texture address mode.

Values:

enumerator Clamp
enumerator Repeat
enumerator Mirror
enum class ETextureFormat : uint8_t

Texture data format.

Values:

enumerator R8
enumerator RG8
enumerator RGB8
enumerator RGB565
enumerator RGBA8
enumerator RGBA4
enumerator RGBA5551
enumerator ETC2RGB
enumerator ETC2RGBA
enumerator R16F
enumerator R32F
enumerator RG16F
enumerator RG32F
enumerator RGB16F
enumerator RGB32F
enumerator RGBA16F
enumerator RGBA32F
enumerator SRGB8
enumerator SRGB8_ALPHA8
enumerator ASTC_RGBA_4x4
enumerator ASTC_RGBA_5x4
enumerator ASTC_RGBA_5x5
enumerator ASTC_RGBA_6x5
enumerator ASTC_RGBA_6x6
enumerator ASTC_RGBA_8x5
enumerator ASTC_RGBA_8x6
enumerator ASTC_RGBA_8x8
enumerator ASTC_RGBA_10x5
enumerator ASTC_RGBA_10x6
enumerator ASTC_RGBA_10x8
enumerator ASTC_RGBA_10x10
enumerator ASTC_RGBA_12x10
enumerator ASTC_RGBA_12x12
enumerator ASTC_SRGBA_4x4
enumerator ASTC_SRGBA_5x4
enumerator ASTC_SRGBA_5x5
enumerator ASTC_SRGBA_6x5
enumerator ASTC_SRGBA_6x6
enumerator ASTC_SRGBA_8x5
enumerator ASTC_SRGBA_8x6
enumerator ASTC_SRGBA_8x8
enumerator ASTC_SRGBA_10x5
enumerator ASTC_SRGBA_10x6
enumerator ASTC_SRGBA_10x8
enumerator ASTC_SRGBA_10x10
enumerator ASTC_SRGBA_12x10
enumerator ASTC_SRGBA_12x12
enum class ETextureCubeFace

Cube texture face identifier.

Values:

enumerator PositiveX
enumerator NegativeX
enumerator PositiveY
enumerator NegativeY
enumerator PositiveZ
enumerator NegativeZ
enum class ERenderTargetDepthBufferType

Enum for type of depth buffer created within a RenderTarget.

Values:

enumerator None
enumerator Depth
enumerator DepthStencil
enum class ERenderBufferFormat

Enum for format of a RenderBuffer.

Values:

enumerator RGBA4
enumerator R8
enumerator RG8
enumerator RGB8
enumerator RGBA8
enumerator R16F
enumerator R32F
enumerator RG16F
enumerator RG32F
enumerator RGB16F
enumerator RGB32F
enumerator RGBA16F
enumerator RGBA32F
enumerator Depth16
enumerator Depth24
enumerator Depth32
enumerator Depth24_Stencil8
enum class ETextureChannelColor : uint8_t

Enum for color of texture channel.

Values:

enumerator Red
enumerator Green
enumerator Blue
enumerator Alpha
enumerator One
enumerator Zero
enum class ERenderBufferAccessMode

Enum for access mode of a RenderBuffer.

Values:

enumerator WriteOnly

RenderBuffer with this access can only be used in RenderTarget.

enumerator ReadWrite

RenderBuffer with this access can be used both in RenderTarget and TextureSampler.

using MipLevelData = std::vector<std::byte>

Texel data of one mip level of a texture.

NOTE: the texel data is stored according to OpenGL convention (first byte is from the bottom texel row). See docs of glTexImage2D for more info.

const char *toString(EBlendOperation blendOperation)

Returns string representation for blend operation.

Useful for logging, etc.

Parameters:

blendOperation – The enum parameter for which you will get the string

Returns:

String representation of the blend operation

const char *toString(EBlendFactor blendFactor)

Returns string representation for blend factor.

Useful for logging, etc.

Parameters:

blendFactor – The enum parameter for which you will get the string

Returns:

String representation of the blend factor

const char *toString(ECullMode cullMode)

Returns string representation for cull mode.

Useful for logging, etc.

Parameters:

cullMode – The enum parameter for which you will get the string

Returns:

String representation of the cull mode

const char *toString(EDepthWrite depthWrite)

Returns string representation for depth write.

Useful for logging, etc.

Parameters:

depthWrite – The enum parameter for which you will get the string

Returns:

String representation of the depth write

const char *toString(EScissorTest scissorTest)

Returns string representation for scissor test.

Useful for logging, etc.

Parameters:

scissorTest – The enum parameter for which you will get the string

Returns:

String representation of the scissor test

const char *toString(EDepthFunc depthFunc)

Returns string representation for depth function.

Useful for logging, etc.

Parameters:

depthFunc – The enum parameter for which you will get the string

Returns:

String representation of the depth function

const char *toString(EStencilFunc stencilFunc)

Returns string representation for stencil function.

Useful for logging, etc.

Parameters:

stencilFunc – The enum parameter for which you will get the string

Returns:

String representation of the stencil function

const char *toString(EStencilOperation stencilOp)

Returns string representation for stencil operation.

Useful for logging, etc.

Parameters:

stencilOp – The enum parameter for which you will get the string

Returns:

String representation of the stencil operation

const char *toString(EDrawMode drawMode)

Returns string representation for draw mode.

Useful for logging, etc.

Parameters:

drawMode – The enum parameter for which you will get the string

Returns:

String representation of the draw mode

const char *toString(ETextureSamplingMethod samplingMethod)

Returns string representation for sampling method.

Useful for logging, etc.

Parameters:

samplingMethod – The enum parameter for which you will get the string

Returns:

String representation of the sampling method

const char *toString(ETextureAddressMode addressMode)

Returns string representation for address mode.

Useful for logging, etc.

Parameters:

addressMode – The enum parameter for which you will get the string

Returns:

String representation of the address mode

const char *toString(ETextureFormat format)

Returns string representation for texture format.

Useful for logging, etc.

Parameters:

format – The enum parameter for which you will get the string

Returns:

String representation of the texture format

const char *toString(ETextureCubeFace face)

Returns string representation for texture’s cube face.

Useful for logging, etc.

Parameters:

face – The enum parameter for which you will get the string

Returns:

String representation of the cube face

inline bool FormatSupportsMipChainGeneration(ETextureFormat format)

Returns if given texture format supports mipmap chain generation

Parameters:

format – the format in question

Returns:

true if given format supports generation of mipchain

class Appearance : public ramses::SceneObject
#include <Appearance.h>

The Appearance describes how an object should look like. This includes GLSL uniform values, and GPU states such as blending, buffer configurations, masks etc. The API to set uniform values is aligned to the glUniformX API of OpenGL. Beware that boolean values are reported and handled as int (0 is false, anything else is true) - similar to OpenGL conventions.

Public Functions

bool setBlendingFactors(EBlendFactor srcColor, EBlendFactor destColor, EBlendFactor srcAlpha, EBlendFactor destAlpha)

Sets blending factors for source/destination color/alpha. Blending operations need to be set as well in order to enable blending (see ramses::Appearance::setBlendingOperations()).

Parameters:
Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getBlendingFactors(EBlendFactor &srcColor, EBlendFactor &destColor, EBlendFactor &srcAlpha, EBlendFactor &destAlpha) const

Gets blending factors for source/destination color/alpha.

Parameters:
  • srcColor[out] Source color blending factor

  • destColor[out] Destination color blending factor

  • srcAlpha[out] Source alpha blending factor

  • destAlpha[out] Destination alpha blending factor

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setBlendingOperations(EBlendOperation operationColor, EBlendOperation operationAlpha)

Sets blending operation for color and alpha. To use blending also set the correct blending factors (see ramses::Appearance::setBlendingFactors()). Blending operations are disabled by default.

Parameters:
Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getBlendingOperations(EBlendOperation &operationColor, EBlendOperation &operationAlpha) const

Gets blending operation for color and alpha.

Parameters:
  • operationColor[out] Blending operation for color

  • operationAlpha[out] Blending operation for alpha

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setBlendingColor(const vec4f &color)

Sets blending color that can be used as blending color constant for some blending factors. The default value is (0,0,0,0)

Parameters:

color[in] RGBA channels of blending color to set ([0;1] range)

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getBlendingColor(vec4f &color) const

Gets blending color set via setBlendingColor.

Parameters:

color[out] RGBA channels of blending color ([0;1] range)

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setDepthWrite(EDepthWrite mode)

Enables or disables writing to depth buffer. The default value is ramses::EDepthWrite::Enabled.

Parameters:

mode[in] Flag denoting enabling or disabling depth writes.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getDepthWriteMode(EDepthWrite &mode) const

Gets the current state of writing to depth buffer.

Parameters:

mode[out] Depth write mode

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setDepthFunction(EDepthFunc func)

Sets depth comparison function. Default depth comparison function is ramses::EDepthFunc::LessEqual.

Parameters:

func[in] Depth comparison function to be used

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getDepthFunction(EDepthFunc &func) const

Gets depth comparison function.

Parameters:

func[out] Depth comparison function to be used

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setScissorTest(EScissorTest state, int16_t x, int16_t y, uint16_t width, uint16_t height)

Enables or disables scissor test and sets region for scissor test Scissor test is disabled by default (ramses::EScissorTest::Disabled)

Parameters:
  • state[in] Flag denoting enabling or disabling scissor test.

  • x[in] Offset of scissor region on x-axis.

  • y[in] Offset of scissor region on y-axis.

  • width[in] Width of scissor region.

  • height[in] Height of scissor region.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getScissorTestState(EScissorTest &state) const

Gets the current state of scissor test.

Parameters:

state[out] State of scissor test

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getScissorRegion(int16_t &x, int16_t &y, uint16_t &width, uint16_t &height) const

Gets region for scissor test.

Parameters:
  • x[out] Offset of scissor region on x-axis.

  • y[out] Offset of scissor region on y-axis.

  • width[out] Width of scissor region.

  • height[out] Height of scissor region.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setStencilFunction(EStencilFunc func, uint8_t ref, uint8_t mask)

Sets stencil function, reference and mask value for stencil testing. Stencil test is disabled by default.

Parameters:
  • func[in] Stencil function to be used, default: ramses::EStencilFunc::Disabled

  • ref[in] Stencil reference value to be used, default: 0

  • mask[in] Stencil mask value to be used, default: 0xff

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getStencilFunction(EStencilFunc &func, uint8_t &ref, uint8_t &mask) const

Gets stencil function, reference and mask value.

Parameters:
  • func[out] Stencil function currently set

  • ref[out] Stencil reference value currently set

  • mask[out] Stencil mask value currently set

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setStencilOperation(EStencilOperation sfail, EStencilOperation dpfail, EStencilOperation dppass)

Sets stencil operations for stencil testing. Default stencil operation values are ramses::EStencilOperation::Keep.

Parameters:
  • sfail[in] Stencil operation when stencil test fails

  • dpfail[in] Stencil operation when the stencil test passes, but the depth test fails

  • dppass[in] Stencil operation when both the stencil test and the depth test pass

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getStencilOperation(EStencilOperation &sfail, EStencilOperation &dpfail, EStencilOperation &dppass) const

Gets stencil operations.

Parameters:
  • sfail[out] Stencil operation when stencil test fails

  • dpfail[out] Stencil operation when the stencil test passes, but the depth test fails

  • dppass[out] Stencil operation when both the stencil test and the depth test pass

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setCullingMode(ECullMode mode)

Sets the culling mode indicating which side of mesh will be removed before rasterization. Default culling mode is ramses::ECullMode::BackFacing.

Parameters:

mode[in] Culling mode to be used.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setDrawMode(EDrawMode mode)

Sets the draw mode indicating by which primitive the mesh will be rendered Default draw mode is ramses::EDrawMode::Triangles, however if the effect used has a geometry shader, then the input type declared in the geometry shader is set as draw mode automatically when Appearance is created.

Parameters:

mode[in] Draw mode to be used.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getCullingMode(ECullMode &mode) const

Gets the culling mode indicating which side of mesh will be removed before rasterization.

Parameters:

mode[out] Culling mode to be used.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getDrawMode(EDrawMode &mode) const

Gets the draw mode indicating by which primitive the mesh will be rendered.

Parameters:

mode[out] draw mode to be used.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setColorWriteMask(bool writeRed, bool writeGreen, bool writeBlue, bool writeAlpha)

Sets color write mask. If needed certain color channels can stay untouched using the color write mask. By default writing to all color channels is enabled.

Parameters:
  • writeRed[in] Enable/disable flag for red channel

  • writeGreen[in] Enable/disable flag for green channel

  • writeBlue[in] Enable/disable flag for blue channel

  • writeAlpha[in] Enable/disable flag for alpha channel

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getColorWriteMask(bool &writeRed, bool &writeGreen, bool &writeBlue, bool &writeAlpha) const

Gets color write mask.

Parameters:
  • writeRed[out] Enable/disable flag for red channel

  • writeGreen[out] Enable/disable flag for green channel

  • writeBlue[out] Enable/disable flag for blue channel

  • writeAlpha[out] Enable/disable flag for alpha channel

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

template<typename T>
bool setInputValue(const UniformInput &input, T &&value)

Sets value to uniform input. Value type must pass ramses::IsUniformInputDataType. This method will fail if value type not compatible with the uniform data type (see ramses::UniformInput::getDataType).

Parameters:
  • input[in] The effect uniform input to set the value to

  • value[in] The value to set

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

template<typename T>
bool setInputValue(const UniformInput &input, size_t elementCount, const T *values)

Sets value(s) to uniform input. Value type must pass ramses::IsUniformInputDataType. This method will fail if value type not compatible with the uniform data type (see ramses::UniformInput::getDataType).

Parameters:
  • input[in] The effect uniform input to set the value to

  • elementCount[in] The number of elements to use from values. Must match ramses::UniformInput::getElementCount.

  • values[in] Pointer the the values, must contain at least elementCount elements.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

template<typename T>
bool getInputValue(const UniformInput &input, T &value) const

Gets value of uniform input. Value type must pass ramses::IsUniformInputDataType. This method will fail if value type not compatible with the uniform data type (see ramses::UniformInput::getDataType).

Parameters:
  • input[in] The effect uniform input

  • value[out] The value

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

template<typename T>
bool getInputValue(const UniformInput &input, size_t elementCount, T *valuesOut) const

Gets value(s) of uniform input. Value type must pass ramses::IsUniformInputDataType. This method will fail if value type not compatible with the uniform data type (see ramses::UniformInput::getDataType).

Parameters:
  • input[in] The effect uniform input

  • elementCount[in] The number of elements to copy to valuesOut. Must match ramses::UniformInput::getElementCount.

  • valuesOut[out] location where the values are copied to

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setInputTexture(const UniformInput &input, const TextureSampler &textureSampler)

Sets texture sampler to the input.

Parameters:
  • input[in] The effect uniform input to set the value to

  • textureSampler[in] The texture sampler

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setInputTexture(const UniformInput &input, const TextureSamplerMS &textureSampler)

Sets multisampled texture sampler to the input.

Parameters:
  • input[in] The multisampled texture sampler uniform input to set the value to

  • textureSampler[in] The multisampled texture sampler

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setInputTexture(const UniformInput &input, const TextureSamplerExternal &textureSampler)

Sets external texture sampler to the input.

Parameters:
  • input[in] The external texture sampler uniform input to set the value to

  • textureSampler[in] The external texture sampler

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getInputTexture(const UniformInput &input, const TextureSampler *&textureSampler) const

Gets texture sampler currently set to the input.

Parameters:
  • input[in] The effect uniform input

  • textureSampler[out] Will set texture sampler pointer to the TextureSampler object set to the uniform input, nullptr if none set or there was an error

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getInputTextureMS(const UniformInput &input, const TextureSamplerMS *&textureSampler) const

Gets texture sampler currently set to the input.

Parameters:
  • input[in] The effect uniform input

  • textureSampler[out] Will set texture sampler pointer to the TextureSamplerMS object set to the uniform input, nullptr if none set or there was an error

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getInputTextureExternal(const UniformInput &input, const TextureSamplerExternal *&textureSampler) const

Gets texture sampler currently set to the input.

Parameters:
  • input[in] The effect uniform input

  • textureSampler[out] Will set texture sampler pointer to the TextureSamplerExternal object set to the uniform input, nullptr if none set or there was an error

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool bindInput(const UniformInput &input, const DataObject &dataObject)

Bind a DataObject to the Appearance’s uniform input. The value from the DataObject will be used and any change made on the DataObject will be reflected in the Appearance. One DataObject can be bound to multiple Appearances. The data type of the DataObject must match the uniform input data type otherwise the call will fail and report error. DataObject cannot be bound to an input with semantics, texture input or array input. Once a DataObject is bound to an input the value cannot be set or get using set/getInputValue*() anymore. Binding a DataObject to an already bound input will unbind the old one and bind the new one.

Parameters:
  • input[in] The effect uniform input to bind the DataObject to

  • dataObject[in] The DataObject to be bound

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool unbindInput(const UniformInput &input)

Unbind a previously bound DataObject from the Appearance’s uniform input. Any previously set value that was set before binding will now be used. Appropriate set/getInputValue*() method must be used to set or get the value or another DataObject can be bound.

Parameters:

input[in] The effect uniform input to unbind the DataObject from

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool isInputBound(const UniformInput &input) const

Check whether a uniform input has any DataObject bound to it.

Parameters:

input[in] The effect uniform input to check

Returns:

true if there is any DataObject bound to the input, false otherwise

const DataObject *getDataObjectBoundToInput(const UniformInput &input) const

Gets the data object bound to a uniform input.

Parameters:

input[in] The effect uniform input to get the bound data object for

Returns:

The data object bound the uniform input if existing, otherwise returns nullptr

const Effect &getEffect() const

Gets the effect used to create this appearance.

Returns:

The effect used to create the appearance.

internal::AppearanceImpl &impl()

Get the internal data for implementation specifics of Appearance.

const internal::AppearanceImpl &impl() const

Get the internal data for implementation specifics of Appearance.

Friends

friend class internal::SceneObjectRegistry
class ArrayBuffer : public ramses::SceneObject
#include <ArrayBuffer.h>

The ArrayBuffer is a data object used to provide vertex or index data to ramses::Geometry::setInputBuffer and ramses::Geometry::setIndices. The buffer data of an ArrayBuffer is not filled initially and can be fully or partially updated between scene flushes.

If an ArrayBuffer object is created with type ramses::EDataType::ByteBlob then an element is defined as one byte, rather than a logical vertex element. Hence, all functions of ArrayBuffer referring to element refer to a single byte within byte array.

Public Functions

template<typename T>
bool updateData(size_t firstElement, size_t numElements, const T *bufferData)

Update data of the ArrayBuffer object.

Data type of provided data must pass ramses::IsArrayResourceDataType. This method will fail if the provided data type does not match this ArrayBuffer data type (see ramses::ArrayBuffer::getDataType and ramses::GetEDataType). For ArrayBuffer objects of type ramses::EDataType::ByteBlob an element is defined as 1 byte.

Parameters:
  • firstElement – The element index at which data update should begin.

  • numElements – The number of elements to be updated. FirstElement + numElements must be less than or equal to getMaximumNumberOfElements specified at creation time of the ArrayBuffer object. The function writes (or overwrites) buffer data up to the specified count only, leaving any previously written or un-initialized data untouched.

  • bufferData – Pointer in memory to the data provided for update. The function makes a copy of the data into ArrayBuffer data structures. ArrayBuffer object does not take ownership of the memory data passed to it.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

size_t getMaximumNumberOfElements() const

Returns the maximum number of data elements that can be stored in the data buffer.

For ArrayBuffer objects of type ramses::EDataType::ByteBlob this function returns the maximum size of buffer data in bytes.

Returns:

Maximum number of elements

size_t getUsedNumberOfElements() const

Returns the used number of data elements.

If data buffer fully set by updateData, then used and maximum number of elements are equal. For ArrayBuffer objects of type ramses::EDataType::ByteBlob this function returns the used size of buffer data in bytes because element is defined as byte for this type.

Returns:

Used size in number of elements

EDataType getDataType() const

Returns the data type associated with the buffer data.

Returns:

data type of buffer data

template<typename T>
bool getData(T *buffer, size_t numElements) const

Copies the data of the data buffer into a user-provided buffer.

The buffer must be sufficiently large to hold the data for the numElements to be copied out. This method will fail if the provided data type does not match this ArrayBuffer data type (see ramses::ArrayBuffer::getDataType and ramses::GetEDataType). For ArrayBuffer objects of type ramses::EDataType::ByteBlob an element is defined as 1 byte.

Parameters:
  • buffer[out] The buffer where the buffer data will be copied into

  • numElements[in] The number of elements to copy

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

internal::ArrayBufferImpl &impl()

Get the internal data for implementation specifics of ArrayBuffer.

const internal::ArrayBufferImpl &impl() const

Get the internal data for implementation specifics of ArrayBuffer.

Friends

friend class internal::SceneObjectRegistry
class ArrayResource : public ramses::Resource
#include <ArrayResource.h>

The ArrayResource stores a data array of a given type. The data is immutable. The resource can be used as an input for a ramses::Geometry.

If an ArrayResource object is created with type ramses::EDataType::ByteBlob then an element is defined as one byte, rather than a logical vertex element. Hence, number of elements is the same as the size in bytes.

Public Functions

size_t getNumberOfElements() const

Returns number of elements of the array.

EDataType getDataType() const

Returns the data type of the data array.

internal::ArrayResourceImpl &impl()

Get the internal data for implementation specifics of ArrayResource.

const internal::ArrayResourceImpl &impl() const

Get the internal data for implementation specifics of ArrayResource.

Friends

friend class internal::SceneObjectRegistry
class AttributeInput : public ramses::EffectInput
#include <AttributeInput.h>

The AttributeInput is a description of an attribute effect input.

Public Functions

EEffectAttributeSemantic getSemantics() const

Returns the effect input semantics.

Returns:

Effect input semantics

~AttributeInput()

Destructor of AttributeInput.

AttributeInput(const AttributeInput &other)

Copy constructor.

Parameters:

other – source to copy from

AttributeInput(AttributeInput &&other) noexcept

Move constructor.

Parameters:

other – source to move from

AttributeInput &operator=(const AttributeInput &other)

Assignment operator.

Parameters:

other – source to assign from

AttributeInput &operator=(AttributeInput &&other) noexcept

Move assignment operator.

Parameters:

other – source to move assign from

class BlitPass : public ramses::SceneObject
#include <BlitPass.h>

The BlitPass blits contents of one RendeBuffer to another. The source and destination RenderBuffer objects must have the same type, format and dimensions. BlitPass objects are ordered using a render order, which is also shared with RenderPass objects, i.e, BlitPass and RenderPass objects can all be ordered relative to each other.

Public Functions

const RenderBuffer &getSourceRenderBuffer() const

Get the source render buffer used for blitting.

Returns:

The source render buffer.

const RenderBuffer &getDestinationRenderBuffer() const

Get the destination render buffer used for blitting.

Returns:

The destination render buffer.

bool setBlittingRegion(uint32_t sourceX, uint32_t sourceY, uint32_t destinationX, uint32_t destinationY, uint32_t width, uint32_t height)

Set the region for blitting from source and destination render buffers. The source and destination regions must lie within the boundaries of source and destination render buffers respectively, otherwise the function fails with error status. If blitting region is not set the whole buffer is blit by default.

Parameters:
  • sourceX – Offset on x-axis for blitting from source render buffer

  • sourceY – Offset on u-axis for blitting from source render buffer

  • destinationX – Offset on x-axis for blitting to destination render buffer

  • destinationY – Offset on y-axis for blitting to destination render buffer

  • width – Width of blitting region, used for source and destination blitting regions

  • height – Height of blitting region, used for source and destination blitting regions

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

void getBlittingRegion(uint32_t &sourceX, uint32_t &sourceY, uint32_t &destinationX, uint32_t &destinationY, uint32_t &width, uint32_t &height) const

Get the blitting region in source and destination render buffers.

Parameters:
  • sourceX[out] Offset on x-axis for blitting from source render buffer

  • sourceY[out] Offset on y-axis for blitting from source render buffer

  • destinationX[out] Offset on x-axis for blitting to destination render buffer

  • destinationY[out] Offset on y-axis for blitting to destination render buffer

  • width[out] Width of blitting region, used for source and destination blitting regions

  • height[out] Height of blitting region, used for source and destination blitting regions

bool setRenderOrder(int32_t renderOrder)

Set the render order for the blit pass. This order defines the order in which the blit pass is executed relative to other blit and render passes. Blit and render passes with lower render order are executed first. Blit and render passes with same render order might be executed by the renderer in any order.

The default render order is Zero.

Parameters:

renderOrder – Render order used for ordering the blit pass

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

int32_t getRenderOrder() const

Get the render order of this blit pass.

Returns:

The render order of this blit pass.

bool setEnabled(bool enable)

Enable/Disable blit pass.

Parameters:

enable – The enable flag which indicates if the blit pass is rendered (Default:true)

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool isEnabled() const

Get the enable state of the blit pass.

Returns:

Indicates if the blit pass is enabled

internal::BlitPassImpl &impl()

Get the internal data for implementation specifics of BlitPass.

const internal::BlitPassImpl &impl() const

Get the internal data for implementation specifics of BlitPass.

Friends

friend class internal::SceneObjectRegistry
class Camera : public ramses::Node
#include <Camera.h>

The Camera base class is part of a scene and defines a view into the scene defined by the client application. It is also a Node with transformation.

A valid camera for rendering must have a viewport and a frustum set.

Subclassed by ramses::OrthographicCamera, ramses::PerspectiveCamera

Public Functions

bool setFrustum(float leftPlane, float rightPlane, float bottomPlane, float topPlane, float nearPlane, float farPlane)

Sets camera frustum planes of the Camera.

It is mandatory to set frustum planes using either this method or ramses::PerspectiveCamera::setFrustum in order to have a valid camera for rendering.

In order to set valid frustum, all these must be true: leftPlane < rightPlane & bottomPlane < topPlane & 0 < nearPlane < farPlane.

Important note: if frustum planes data is bound (see bindFrustumPlanes) the values set here will not be effective until unbound again, bound values are always overridden by values from bound data object. Bound values can only be modified via the ramses::DataObject bound to them.

Parameters:
  • leftPlane[in] Left plane of the camera frustum. Left opening angle if camera is perspective.

  • rightPlane[in] Right plane of the camera frustum. Right opening angle if camera is perspective.

  • bottomPlane[in] Bottom plane of the camera frustum. Bottom opening angle if camera is perspective.

  • topPlane[in] Top plane of the camera frustum. Top opening angle if camera is perspective.

  • nearPlane[in] Near plane of the camera frustum.

  • farPlane[in] Far plane of the camera frustum.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setViewport(int32_t x, int32_t y, uint32_t width, uint32_t height)

Sets the viewport to be used when rendering with this camera.

The viewport size does not have to match the size of the destination render buffer (ramses::RenderTarget or display’s framebuffer). However when the size matches, the projected camera frustum will fill destination buffer fully. The viewport is aligned with the lower left corner of the destination render buffer.

Important note: if viewport data is bound (see bindViewportOffset or bindViewportSize) the value set here will not be effective until unbound again, bound values are always overridden by values from bound data object. Bound values can only be modified via the ramses::DataObject bound to them.

The viewport position (x and y) are relative offsets to the destination render buffer’s lower left pixel. The viewport size (width and height) must be positive numbers in the range [1, 32768].

Parameters:
  • x[in] horizontal offset of the viewport rectangle in pixels (zero = leftmost pixel)

  • y[in] vertical offset of the viewport rectangle in pixels (zero = bottommost pixel)

  • width[in] horizontal size of the viewport rectangle in pixels (min 1, max 32768)

  • height[in] vertical size of the viewport rectangle in pixels (min 1, max 32768)

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

int32_t getViewportX() const

Returns the horizontal offset of the viewport in pixels relative to lower left corner of destination render buffer.

If viewport data is bound (bindViewportOffset) the value returned here represents the effective value used, i.e. the one from bound ramses::DataObject, not the one set via setViewport.

Returns:

horizontal offset of the viewport in pixels

int32_t getViewportY() const

Returns the vertical offset of the viewport in pixels relative to lower left corner of destination render buffer.

If viewport data is bound (bindViewportOffset) the value returned here represents the effective value used, i.e. the one from bound ramses::DataObject, not the one set via setViewport.

Returns:

vertical offset of the viewport in pixels

uint32_t getViewportWidth() const

Returns the viewport width in pixels.

If viewport data is bound (bindViewportSize) the value returned here represents the effective value used, i.e. the one from bound ramses::DataObject, not the one set via setViewport.

Returns:

viewport width in pixels

uint32_t getViewportHeight() const

Returns the viewport height in pixels.

If viewport data is bound (bindViewportSize) the value returned here represents the effective value used, i.e. the one from bound ramses::DataObject, not the one set via setViewport.

Returns:

viewport height in pixels

float getLeftPlane() const

Returns the left plane of the camera frustum.

If frustum planes data is bound (bindFrustumPlanes) the value returned here represents the effective value used, i.e. the one from bound ramses::DataObject, not the one set via setFrustum.

Returns:

the left plane of the Camera

float getRightPlane() const

Returns the right plane of the camera frustum.

If frustum planes data is bound (bindFrustumPlanes) the value returned here represents the effective value used, i.e. the one from bound ramses::DataObject, not the one set via setFrustum.

Returns:

the right plane of the Camera

float getBottomPlane() const

Returns the bottom plane of the camera frustum.

If frustum planes data is bound (bindFrustumPlanes) the value returned here represents the effective value used, i.e. the one from bound ramses::DataObject, not the one set via setFrustum.

Returns:

the bottom plane of the Camera

float getTopPlane() const

Returns the top plane of the camera frustum.

If frustum planes data is bound (bindFrustumPlanes) the value returned here represents the effective value used, i.e. the one from bound ramses::DataObject, not the one set via setFrustum.

Returns:

the top plane of the Camera

float getNearPlane() const

Returns the near plane of the camera frustum.

If frustum planes data is bound (bindFrustumPlanes) the value returned here represents the effective value used, i.e. the one from bound ramses::DataObject, not the one set via setFrustum.

Returns:

the near plane of the Camera

float getFarPlane() const

Returns the far plane of the camera frustum.

If frustum planes data is bound (bindFrustumPlanes) the value returned here represents the effective value used, i.e. the one from bound ramses::DataObject, not the one set via setFrustum.

Returns:

the far plane of the Camera

bool getProjectionMatrix(matrix44f &projectionMatrix) const

Gets projection matrix based on camera parameters. Projection matrix can only be retrieved after all parameters were set and are valid.

Parameters:

projectionMatrix[out] Will be filled with the projection matrix 4x4 column-major

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool bindViewportOffset(const DataObject &offsetData)

Binds a ramses::DataObject to be used as source for viewport offset values.

In addition to setViewport, which sets viewport parameters directly, a ramses::DataObject can be bound to viewport offset and size. When a ramses::DataObject is bound the values from it override those set using setViewport, see ramses::DataObject for possible use cases.

Parameters:

offsetData[in] Data object of type ramses::EDataType::Vector2I that will be used as source for viewport offset values

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool bindViewportSize(const DataObject &sizeData)

Binds a ramses::DataObject to be used as source for viewport size values.

In addition to setViewport, which sets viewport parameters directly, a ramses::DataObject can be bound to viewport offset and size. When a ramses::DataObject is bound the values from it override those set using setViewport, see ramses::DataObject for possible use cases.

Parameters:

sizeData[in] Data object of type ramses::EDataType::Vector2I that will be used as source for viewport size values

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool bindFrustumPlanes(const DataObject &frustumPlanesData, const DataObject &nearFarPlanesData)

Binds ramses::DataObject to be used as source for frustum planes values.

In addition to setFrustum (alternatively ramses::PerspectiveCamera::setFrustum), which sets frustum planes directly, a ramses::DataObject can be bound to provide values for left, right, bottom, top planes and another ramses::DataObject for near and far planes. When a ramses::DataObject is bound the values from it override those set using setFrustum, see ramses::DataObject for possible use cases. See ramses::RamsesUtils::SetPerspectiveCameraFrustumToDataObjects providing way to conveniently set perspective frustum on data objects also with basic validity checking.

Parameters:
  • frustumPlanesData[in] Data object of type ramses::EDataType::Vector4F that will be used as source for frustum planes values. The (x, y, z, w) floats represent (left, right, bottom, top) frustum planes.

  • nearFarPlanesData[in] Data object of type ramses::EDataType::Vector2F that will be used as source for frustum planes values. The (x, y) floats represent (near, far) frustum planes.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool unbindViewportOffset()

Unbinds any bound ramses::DataObject from viewport offset (see bindViewportOffset). Does nothing if no ramses::DataObject bound.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool unbindViewportSize()

Unbinds any bound ramses::DataObject from viewport size (see bindViewportSize). Does nothing if no ramses::DataObject bound.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool unbindFrustumPlanes()

Unbinds any bound ramses::DataObject from frustum planes (see bindFrustumPlanes). Does nothing if no ramses::DataObject bound.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool isViewportOffsetBound() const

Checks if there is a ramses::DataObject bound to viewport offset (see bindViewportOffset).

Returns:

True if there is any ramses::DataObject bound, false otherwise.

bool isViewportSizeBound() const

Checks if there is a ramses::DataObject bound to viewport size (see bindViewportSize).

Returns:

True if there is any ramses::DataObject bound, false otherwise.

bool isFrustumPlanesBound() const

Checks if there is a ramses::DataObject bound to viewport size (see bindFrustumPlanes).

Returns:

True if there is any ramses::DataObject bound, false otherwise.

internal::CameraNodeImpl &impl()

Get the internal data for implementation specifics of Camera.

const internal::CameraNodeImpl &impl() const

Get the internal data for implementation specifics of Camera.

Friends

friend class internal::SceneObjectRegistry
class ClientObject : public ramses::RamsesObject
#include <ClientObject.h>

The ClientObject is a base class for all client API objects owned by a RamsesClient.

Subclassed by ramses::Scene, ramses::SceneObject

Public Functions

internal::ClientObjectImpl &impl()

Get the internal data for implementation specifics of ClientObject.

const internal::ClientObjectImpl &impl() const

Get the internal data for implementation specifics of ClientObject.

class DataObject : public ramses::SceneObject
#include <DataObject.h>

The DataObject is a data container for storing data within a scene.

The DataObject can be bound to some inputs of some object types (e.g. ramses::Appearance::bindInput or ramses::Camera::bindViewportOffset). When a data object is bound to an input the data object value overrides whatever was previously set to that input using its direct setter. A single DataObject can be bound to multiple inputs (also to other ramses::RamsesObject types where applicable) providing a way to distribute a value across instances/inputs. Using DataObject also allows use of data linking across scenes between data object provider and consumer (ramses::Scene::createDataProvider and ramses::Scene::createDataConsumer) see SDK examples for typical use cases. A value set to a DataObject is then propagated everywhere it is bound to and it is linked to.

Public Functions

EDataType getDataType() const

Returns the data type this DataObject holds.

Returns:

data type held in this DataObject

internal::DataObjectImpl &impl()

Get the internal data for implementation specifics of DataObject.

const internal::DataObjectImpl &impl() const

Get the internal data for implementation specifics of DataObject.

template<typename T>
bool setValue(T &&value)

Sets/updates the stored value.

Type of value must match getDataType (see ramses::GetEDataType).

Parameters:

value[in] new value.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

template<typename T>
bool getValue(T &value) const

Gets the stored value.

Type of value must match getDataType (see ramses::GetEDataType).

Parameters:

value[out] stored value.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

Friends

friend class internal::SceneObjectRegistry
class Effect : public ramses::Resource
#include <Effect.h>

An effect describes how an object will be rendered to the screen.

Public Functions

size_t getUniformInputCount() const

Gets number of uniform inputs.

Returns:

Number of uniform inputs

size_t getAttributeInputCount() const

Gets number of attribute inputs.

Returns:

Number of attribute inputs

std::optional<UniformInput> getUniformInput(size_t index) const

Gets uniform input at given index.

Parameters:

index[in] Index of uniform input to retrieve

Returns:

ramses::UniformInput if the index is valid, otherwise, std::nullopt

std::optional<AttributeInput> getAttributeInput(size_t index) const

Gets attribute input at given index.

Parameters:

index[in] Index of attribute input to retrieve

Returns:

ramses::AttributeInput if the index is valid, otherwise, std::nullopt

std::optional<UniformInput> findUniformInput(std::string_view inputName) const

Finds uniform input by input name.

Parameters:

inputName[in] Name of uniform input to retrieve

Returns:

ramses::UniformInput if successful, otherwise, std::nullopt

std::optional<AttributeInput> findAttributeInput(std::string_view inputName) const

Finds attribute input by input name.

Parameters:

inputName[in] Name of attribute input to retrieve

Returns:

ramses::AttributeInput if successful, otherwise, std::nullopt

std::optional<UniformInput> findUniformInput(EEffectUniformSemantic uniformSemantic) const

Finds uniform input that represents a semantic input (if existing).

Parameters:

uniformSemantic[in] Semantic of uniform input to retrieve

Returns:

ramses::UniformInput if successful, otherwise, std::nullopt

std::optional<AttributeInput> findAttributeInput(EEffectAttributeSemantic attributeSemantic) const

Finds attribute input that represents a semantic input (if existing).

Parameters:

attributeSemantic[in] Semantic of attribute input to retrieve

Returns:

ramses::AttributeInput if successful, otherwise, std::nullopt

bool hasGeometryShader() const

Checks if the effect has a geometry shader attached to it.

Returns:

true if the effect has a geometry shader attached to it, false otherwise

bool getGeometryShaderInputType(EDrawMode &expectedGeometryInputType) const

If the effect has a geometry shader attached to it (see hasGeometryShader) this method can be used to check the expected primitive type of the geometry shader. Use this to make sure that geometry-based effects get only paired with geometry which matches their expected type!

See also ramses::Appearance::setDrawMode().

Parameters:

expectedGeometryInputType[out] geometry type expected by the geometry shader of /p effect

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

internal::EffectImpl &impl()

Get the internal data for implementation specifics of Effect.

const internal::EffectImpl &impl() const

Get the internal data for implementation specifics of Effect.

Friends

friend class internal::SceneObjectRegistry
class EffectDescription
#include <EffectDescription.h>

An effect description holds all necessary information for an effect to be created.

Public Functions

EffectDescription()

Constructor of EffectDescription.

~EffectDescription()

Destructor of EffectDescription.

bool setVertexShader(std::string_view shaderSource)

Sets vertex shader source from string.

Parameters:

shaderSource[in] Vertex shader source code.

Returns:

true on success, false if an error occurred (error is logged)

bool setFragmentShader(std::string_view shaderSource)

Sets fragment shader source from string.

Parameters:

shaderSource[in] Fragment shader source code.

Returns:

true on success, false if an error occurred (error is logged)

bool setGeometryShader(std::string_view shaderSource)

Sets geometry shader source from string.

Parameters:

shaderSource[in] Geometry shader source code.

Returns:

true on success, false if an error occurred (error is logged)

bool setVertexShaderFromFile(std::string_view shaderSourceFileName)

Reads and sets vertex shader source from file.

Parameters:

shaderSourceFileName[in] File with vertex shader source code.

Returns:

true on success, false if an error occurred (error is logged)

bool setFragmentShaderFromFile(std::string_view shaderSourceFileName)

Reads and sets fragment shader source from file.

Parameters:

shaderSourceFileName[in] File with fragment shader source code.

Returns:

true on success, false if an error occurred (error is logged)

bool setGeometryShaderFromFile(std::string_view shaderSourceFileName)

Reads and sets geometry shader source from file.

Parameters:

shaderSourceFileName[in] File with geometry shader source code.

Returns:

true on success, false if an error occurred (error is logged)

bool addCompilerDefine(std::string_view define)

Adds a compiler define. The define string will be injected as defined into the final shader code.

Parameters:

define[in] Definition name to be set at compilation time.

Returns:

true on success, false if an error occurred (error is logged)

bool setUniformSemantic(std::string_view inputName, EEffectUniformSemantic semanticType)

Sets an uniform semantic. Used for uniforms which are not locally available on the client, such as projection matrix, framebuffer resolution etc. Value of an uniform corresponding to the given semantic name will be automatically set based on its semantic type.

Parameters:
  • inputName[in] Name of the effect input as used in the shader source code.

  • semanticType[in] Semantic type to be used for given input.

Returns:

true on success, false if an error occurred (error is logged)

bool setAttributeSemantic(std::string_view inputName, EEffectAttributeSemantic semanticType)

Sets an attribute semantic. Used to mark attributes as special inputs (eg. text specific inputs). These attributes are then set to use data provided by Ramses, not user.

Parameters:
  • inputName[in] Name of the effect input as used in the shader source code.

  • semanticType[in] Semantic type to be used for given input.

Returns:

true on success, false if an error occurred (error is logged)

const char *getVertexShader() const

Gets vertex shader code.

Returns:

Vertex shader source code. Empty string if not previously set.

const char *getFragmentShader() const

Gets fragment shader code that is currently set.

Returns:

Fragment shader source code. Empty string if not previously set.

const char *getGeometryShader() const

Gets geometry shader code that is currently set.

Returns:

Geometry shader source code. Empty string if not previously set.

size_t getNumberOfCompilerDefines() const

Gets number of compiler defines.

Returns:

Number of compiler defines that were previously added.

const char *getCompilerDefine(size_t index) const

Gets compiler define.

Parameters:

index[in] Index of define to retrieve.

Returns:

Compiler define for given index. nullptr if not previously set.

EffectDescription(const EffectDescription &other)

Copy constructor.

Parameters:

other – source to copy from

EffectDescription(EffectDescription &&other) noexcept

Move constructor.

Parameters:

other – source to move from

EffectDescription &operator=(const EffectDescription &other)

Copy assignment.

Parameters:

other – source to copy from

Returns:

this instance

EffectDescription &operator=(EffectDescription &&other) noexcept

Move assignment.

Parameters:

other – source to move from

Returns:

this instance

internal::EffectDescriptionImpl &impl()

Get the internal data for implementation specifics of EffectDescription.

const internal::EffectDescriptionImpl &impl() const

Get the internal data for implementation specifics of EffectDescription.

class EffectInput
#include <EffectInput.h>

The EffectInput is a description of an effect input.

Subclassed by ramses::AttributeInput, ramses::UniformInput

Public Functions

~EffectInput()

Destructor of EffectInput.

EffectInput(const EffectInput &other)

Copy constructor.

Parameters:

other – source to copy from

EffectInput(EffectInput &&other) noexcept

Move constructor.

Parameters:

other – source to move from

EffectInput &operator=(const EffectInput &other)

Copy assignment.

Parameters:

other – source to copy from

Returns:

this instance

EffectInput &operator=(EffectInput &&other) noexcept

Move assignment.

Parameters:

other – source to move from

Returns:

this instance

const char *getName() const

Returns the name of the effect input.

Returns:

Name of the effect input

EDataType getDataType() const

Returns the effect input data type.

Returns:

Effect input data type

internal::EffectInputImpl &impl()

Get the internal data for implementation specifics of EffectInput.

const internal::EffectInputImpl &impl() const

Get the internal data for implementation specifics of EffectInput.

class Geometry : public ramses::SceneObject
#include <Geometry.h>

A geometry binding together with an appearance describe how an object will be rendered to the screen.

Public Functions

bool setIndices(const ArrayResource &indicesResource)

Assign a data array with data type UInt16 or UInt32 to be used when accessing vertex data.

Indices are optional, when not provided rendering uses sequential attribute elements.

Parameters:

indicesResource[in] An array resource carrying indices data.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setIndices(const ArrayBuffer &arrayBuffer)

Assign indices (using index data buffer) to be used when accessing vertex data.

Indices are optional, when not provided rendering uses sequential attribute elements.

Parameters:

arrayBuffer[in] Indices data buffer.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setInputBuffer(const AttributeInput &attributeInput, const ArrayResource &arrayResource, uint32_t instancingDivisor = 0)

Assign a data array resource to a given effect attribute input.

Parameters:
  • attributeInput[in] The effect attribute input to set the buffer to

  • arrayResource[in] An array resource carrying vertex data.

  • instancingDivisor[in] The vertex attribute divisor used during instanced rendering. Default is 0, which means no instancing.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setInputBuffer(const AttributeInput &attributeInput, const ArrayResource &arrayResource, uint16_t offset, uint16_t stride)

Assign a data array resource to a given effect attribute input with offset and stride.

Custom offset and/or stride can be only used with array buffers of data type ramses::EDataType::ByteBlob.

Parameters:
  • attributeInput[in] The effect attribute input to set the buffer to

  • arrayResource[in] The vertex attribute buffer.

  • offset[in] Offset in bytes for where the attribute data is starting within the data blob.

  • stride[in] Stride of the interleaved vertex attribute.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setInputBuffer(const AttributeInput &attributeInput, const ArrayBuffer &arrayBuffer, uint32_t instancingDivisor = 0)

Assign a vertex attribute buffer to a given effect attribute input.

Parameters:
  • attributeInput[in] The effect attribute input to set the buffer to

  • arrayBuffer[in] The vertex attribute buffer.

  • instancingDivisor[in] The vertex attribute divisor used during instanced rendering. Default is 0, which means no instancing.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setInputBuffer(const AttributeInput &attributeInput, const ArrayBuffer &arrayBuffer, uint16_t offset, uint16_t stride)

Assign vertex attribute buffer with offset and stride.

Custom offset and/or stride can be only used with array buffers of data type ramses::EDataType::ByteBlob.

Parameters:
  • attributeInput[in] The effect attribute input to set the buffer to

  • arrayBuffer[in] The vertex attribute buffer.

  • offset[in] Offset in bytes for where the attribute data is starting within the data blob.

  • stride[in] Stride of the interleaved vertex attribute.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

const Effect &getEffect() const

Gets the effect used to create this geometry binding.

Returns:

The effect used to create the geometry binding.

internal::GeometryImpl &impl()

Get the internal data for implementation specifics of Geometry.

const internal::GeometryImpl &impl() const

Get the internal data for implementation specifics of Geometry.

Friends

friend class internal::SceneObjectRegistry
class IClientEventHandler
#include <IClientEventHandler.h>

Provides an interface for handling the result of client events. Implementation of this interface must be passed to RamsesClient::dispatchEvents which will in return invoke methods of the interface according to events that occurred since last dispatching.

Public Functions

virtual void sceneFileLoadFailed(std::string_view filename) = 0

This method will be called when asynchronous loading of a scene or one of its associated resource files failed. There will also be events generated for the resource files provided to loadSceneFromFileAsync().

Parameters:

filename – The filename of the scene file that failed to load.

virtual void sceneFileLoadSucceeded(std::string_view filename, Scene *loadedScene) = 0

This method will be called when asynchronous loading of a scene file and its associated resource files successfully finished. There will also be events generated for the resource files provided to loadSceneFromFileAsync().

Parameters:
  • filename – The filename of the scene file that finished loading.

  • loadedScene – Pointer to the newly loaded scene.

virtual void sceneReferenceStateChanged(SceneReference &sceneRef, RendererSceneState state) = 0

This method will be called when state on renderer side of a scene referenced using ramses::SceneReference changed.

Typically this is a result of ramses::SceneReference::requestState call but can be also triggered externally (e.g. scene was unpublished by client). Note that there can be multiple state change callbacks in a row depending on number of state transitions needed between the previous state and target state when calling ramses::SceneReference::requestState.

Parameters:
  • sceneRef – Instance of ramses::SceneReference that references the scene with changed state

  • state – New renderer state of the referenced scene

virtual void sceneReferenceFlushed(SceneReference &sceneRef, sceneVersionTag_t versionTag) = 0

This method will be called after a flush with version tag (ramses::Scene::flush) has been applied and there is a ramses::SceneReference with enabled version tag notifications (ramses::SceneReference::requestNotificationsForSceneVersionTags). It will also be called once right after enabling notifications (after they were previously disabled) with the last applied valid version tag. Notifications will only be sent if the scene reference state is Ready.

Parameters:
  • sceneRef – Instance of ramses::SceneReference that references the scene which the versioned flush belongs to

  • versionTag – Version tag of the scene flush

virtual void dataLinked(sceneId_t providerScene, dataProviderId_t providerId, sceneId_t consumerScene, dataConsumerId_t consumerId, bool success) = 0

This method will be called when the data link between a data provider and data consumer is established (or failed to be established) on renderer side.

This callback is response to ramses::Scene::linkData call on a scene that belongs to this ramses::RamsesClient, not by data link initiated from other clients’ scenes or renderer.

Parameters:
  • providerScene – The ID of scene where the data provider slot is, can be either a ramses::Scene from this ramses::RamsesClient or another scene referenced via ramses::SceneReference

  • providerId – The ID of data provider which was linked

  • consumerScene – The ID of scene where the data consumer slot is, can be either a ramses::Scene from this ramses::RamsesClient or another scene referenced via ramses::SceneReference

  • consumerId – The ID of data consumer which was linked

  • success – True if succeeded, false otherwise - check renderer logs for concrete error message.

virtual void dataUnlinked(sceneId_t consumerScene, dataConsumerId_t consumerId, bool success) = 0

This method will be called when the data link between a data provider and data consumer is destroyed (or failed to be destroyed) on renderer side.

This callback is response to ramses::Scene::unlinkData call on a scene that belongs to this ramses::RamsesClient, not by data unlink initiated from other clients’ scenes or renderer.

Parameters:
  • consumerScene – The ID of scene where the data consumer slot is, can be either a ramses::Scene from this ramses::RamsesClient or another scene referenced via ramses::SceneReference

  • consumerId – The ID of data consumer which was unlinked

  • success – True if succeeded, false otherwise - check renderer logs for concrete error message.

virtual ~IClientEventHandler() = default

Empty destructor.

class MeshNode : public ramses::Node
#include <MeshNode.h>

The MeshNode holds all information which is needed to render an object to the screen.

Public Functions

bool setAppearance(Appearance &appearance)

Sets the Appearance of the MeshNode.

Parameters:

appearance – The Appearance for the MeshNode.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setGeometry(Geometry &geometry)

Sets the Geometry of the MeshNode.

When the given Geometry has indices set, also sets start index to 0 and index count to the number of indices of geometry. When the Geometry does not provide indices, the index count has to be set by setIndexCount in addition.

Parameters:

geometry – The Geometry for the MeshNode.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setStartIndex(uint32_t startIndex)

Sets the first index of indices array that will be used for rendering.

Parameters:

startIndex[in] First index of indices to be used (default: 0).

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

uint32_t getStartIndex() const

Gets the first index of indices array that will be used for rendering.

Returns:

the first index of indices array that will be used for rendering.

bool setStartVertex(uint32_t startVertex)

Sets the offset of the first vertex to use from each vertex array that will be used for rendering the mesh.

Parameters:

startVertex[in] First vertex of vertex arrays to be used (default: 0).

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

uint32_t getStartVertex() const

Gets the first vertex of vertex arrays that will be used for rendering.

Returns:

the first index of indices array that will be used for rendering.

bool setIndexCount(uint32_t indexCount)

Sets the number of indices that will be used for rendering.

Parameters:

indexCount[in] Number of indices to be used. Default value is set from geometry binding, see setGeometry.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

uint32_t getIndexCount() const

Gets the number of indices that will be used for rendering.

Returns:

the number of indices that will be used for rendering.

const Appearance *getAppearance() const

Returns the appearance.

Returns:

The appearance, null on failure or if none is set.

bool removeAppearanceAndGeometry()

Removes the Appearance and Geometry previously set to the MeshNode.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

Appearance *getAppearance()

Returns the appearance.

Returns:

The appearance, null on failure or if none is set.

const Geometry *getGeometry() const

Returns the geometry binding.

Returns:

The geometry binding, null on failure or if none is set.

Geometry *getGeometry()

Returns the geometry binding.

Returns:

The geometry binding, null on failure or if none is set.

bool setInstanceCount(uint32_t instanceCount)

Sets the number of instances that will be drawn for this mesh by the renderer.

Parameters:

instanceCount[in] Number of instances to be drawn (default: 1)

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

uint32_t getInstanceCount() const

Gets the number of instance that will be drawn for this mesh by the renderer.

Returns:

the number of instances of this mesh drawn on rendering.

internal::MeshNodeImpl &impl()

Get the internal data for implementation specifics of MeshNode.

const internal::MeshNodeImpl &impl() const

Get the internal data for implementation specifics of MeshNode.

Friends

friend class internal::SceneObjectRegistry
struct CubeMipLevelData
#include <MipLevelData.h>

Struct containing information about one mip-map level of a cube texture. All faces of the cube texture must have the same size!

Public Members

MipLevelData m_dataPX

Data for face in positive X direction.

MipLevelData m_dataNX

Data for face in negative X direction.

MipLevelData m_dataPY

Data for face in positive Y direction.

MipLevelData m_dataNY

Data for face in negative Y direction.

MipLevelData m_dataPZ

Data for face in positive Z direction.

MipLevelData m_dataNZ

Data for face in negative Z direction.

class Node : public ramses::SceneObject
#include <Node.h>

The Node is the base class of all nodes and provides scene graph functionality which propagates to its children.

Subclassed by ramses::Camera, ramses::MeshNode, ramses::PickableObject

Public Functions

bool hasChild() const

Returns if node has at least one child Node.

Returns:

true if this Node has at least one child Node, false otherwise.

size_t getChildCount() const

Gets the number of child Nodes of this node.

Returns:

Number of child Nodes of this Node.

Node *getChild(size_t index)

Gets child node at provided index.

Parameters:

index[in] Index of the child Node to be returned. Index range is [0..getChildCount()-1].

Returns:

Pointer to Node, if child at index exists.

Returns:

nullptr if child at index does not exist.

const Node *getChild(size_t index) const

Gets child node at provided index.

Parameters:

index[in] Index of the child Node to be returned. Index range is [0..getChildCount()-1].

Returns:

Pointer to Node, if child at index exists.

Returns:

nullptr if child at index does not exist.

bool addChild(Node &node)

Adds child Node to this node.

Parameters:

node[in] Node to be set as child for this Node.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool removeChild(Node &node)

Removes a child Node from this node.

Parameters:

node[in] Node to be removed as child from this Node.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool removeAllChildren()

Removes all child Nodes from this node.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool hasParent() const

Returns if Node has a parent Node.

Returns:

true if Node has a parent Node, false otherwise.

Node *getParent()

Gets parent Node of this Node.

Returns:

Pointer to parent Node, if parent exists, nullptr otherwise.

const Node *getParent() const

Gets parent Node of this Node.

Returns:

Pointer to parent Node, if parent exists, nullptr otherwise.

bool setParent(Node &node)

Sets parent Node for this node.

Parameters:

node[in] Node to be set as parent for this Node.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool removeParent()

Removes the parent Node from this Node.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getModelMatrix(matrix44f &modelMatrix) const

Gets model (world in scene space) matrix computed from the scene graph. Performance note: this call will cause computation of a transformation chain, however the result is cached therefore subsequent calls will have little to none performance overhead as long as topology or transformation in the chain does not change.

Parameters:

modelMatrix[out] Will be filled with the model matrix 4x4 column-major

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getInverseModelMatrix(matrix44f &inverseModelMatrix) const

Gets inverse model (world in scene space) matrix computed from the scene graph. Performance note: this call will cause computation of a transformation chain, however the result is cached therefore subsequent calls will have little to none performance overhead as long as topology or transformation in the chain does not change.

Parameters:

inverseModelMatrix[out] Will be filled with the inverse model matrix 4x4 column-major

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setRotation(const vec3f &rotation, ERotationType rotationType)

Sets the absolute rotation in all three directions for right-handed rotation using the chosen Euler angles rotation convention. If this function is used to set, then only ramses::Node::getRotation(vec3f&)const can be used to get node rotation. Will return an error if the given rotationType is not an Euler convention.

Parameters:
  • rotation[in] Euler angles in degrees

  • rotationType[in] The rotation convention to use for calculation of rotation matrix.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setRotation(const quat &rotation)

Sets the absolute rotation defined by a quaternion. If this function is used to set, then only ramses::Node::getRotation(quat&)const can be used to get the node rotation.

Parameters:

rotation[in] a normalized quaternion

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

ERotationType getRotationType() const

Returns the current rotation type applied to the node The value is modified by ramses::Node::setRotation(). Default rotation type is ramses::ERotationType::Euler_XYZ.

Returns:

rotation type

bool getRotation(vec3f &rotation) const

Retrieves the absolute rotation for right-handed rotation in all three directions for the used Euler angles rotation convention. This function will return an error if no Euler rotation convention is set (check ramses::Node::getRotationType() before)

Default value is 0 for all components.

Parameters:

rotation[out] Euler angles in degrees

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getRotation(quat &rotation) const

Retrieves the absolute rotation defined by a quaternion. This function will return an error if ramses::Node::getRotationType() != ramses::ERotationType::Quaternion Default value is an identity quaternion: glm::identity<quat>()

Parameters:

rotation[out] quaternion

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool translate(const vec3f &translation)

Translates in all three directions with the given values.

Parameters:

translation[in] relative translation from origin.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setTranslation(const vec3f &translation)

Sets the absolute translation the absolute values.

Parameters:

translation[in] absolute translation value

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getTranslation(vec3f &translation) const

Retrieves the current absolute translation.

Parameters:

translation[out] Current translation

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool scale(const vec3f &scaling)

Scales in all three directions with the given values.

Parameters:

scaling[in] The relative scaling factor.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setScaling(const vec3f &scaling)

Sets the absolute scale in all three dimensions.

Parameters:

scaling[in] scaling factor.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool getScaling(vec3f &scaling) const

Retrieves the current absolute scale in all three dimensions.

Parameters:

scaling[out] The current scaling factor.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setVisibility(EVisibilityMode mode)

Sets the visibility of the Node. Visibility of a node determines if a renderable is rendered or not and if its resources are loaded. See EVisibilityMode for more details. Those attributes are propagated down to the node’s children recursively. A node can only be rendered, if none of its parents are Invisible or Off, the node’s resources are only loaded if none of its parents are Off.

Parameters:

mode[in] Visibility mode for this node (default is Visible)

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

EVisibilityMode getVisibility() const

Gets the visibility property of the Node. This is just the visibility state of this node object, NOT the hierarchically accumulated visibility of its parents.

Returns:

visibility mode of this Node.

internal::NodeImpl &impl()

Get the internal data for implementation specifics of Node.

const internal::NodeImpl &impl() const

Get the internal data for implementation specifics of Node.

Friends

friend class internal::SceneObjectRegistry
class OrthographicCamera : public ramses::Camera
#include <OrthographicCamera.h>

The OrthographicCamera is a local camera which defines an orthographic view into the scene.

A valid camera for rendering must have viewport and frustum set, see ramses::Camera for ways to set these parameters.

Friends

friend class internal::SceneObjectRegistry
class PerspectiveCamera : public ramses::Camera
#include <PerspectiveCamera.h>

The PerspectiveCamera is a local camera which defines a perspective view into the scene.

A valid camera for rendering must have viewport and frustum set. Frustum planes can be set using ramses::Camera::setFrustum or ramses::PerspectiveCamera::setFrustum, depending if the inputs are concrete frustum planes or field of view and aspect ratio.

Public Functions

bool setFrustum(float fov, float aspectRatio, float nearPlane, float farPlane)

An alternative method (see ramses::Camera::setFrustum) to set the perspective view frustum of the camera by providing opening angle and aspect ratio.

When using this method the field of view and aspect ratio are internally converted to six frustum planes, therefore this is just a convenience wrapper for ramses::Camera::setFrustum.

Important note: if frustum planes data is bound (see ramses::Camera::bindFrustumPlanes) the values set here will not be effective until unbound again, bound values are always overridden by values from bound data object. Bound values can only be modified via the ramses::DataObject bound to them. See ramses::RamsesUtils::SetPerspectiveCameraFrustumToDataObjects providing way to conveniently set perspective frustum on data objects also with basic validity checking.

Parameters:
  • fov[in] The vertical field of view to be set, must be > 0. This is the full vertical opening angle in degrees.

  • aspectRatio[in] Ratio between frustum width and height, must be > 0. This value is generally independent from the viewport width and height but typically matches the viewport aspect ratio.

  • nearPlane[in] Near plane of the camera frustum, must be > 0.

  • farPlane[in] Far plane of the camera frustum, must be > nearPlane.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

float getVerticalFieldOfView() const

Gets the vertical field of view opening angle in degrees.

If frustum planes data is bound (ramses::Camera::bindFrustumPlanes) the value returned here represents the effective value used, i.e. the one from bound ramses::DataObject, not the one set via setFrustum.

Returns:

Vertical field of view of this camera.

float getAspectRatio() const

Gets the aspect ratio between camera frustum width and height (set via setFrustum, not viewport).

If frustum planes data is bound (ramses::Camera::bindFrustumPlanes) the value returned here represents the effective value used, i.e. the one from bound ramses::DataObject, not the one set via setFrustum.

Returns:

Aspect ratio of this camera.

bool setFrustum(float leftPlane, float rightPlane, float bottomPlane, float topPlane, float nearPlane, float farPlane)

Sets camera frustum planes of the Camera.

It is mandatory to set frustum planes using either this method or ramses::PerspectiveCamera::setFrustum in order to have a valid camera for rendering.

In order to set valid frustum, all these must be true: leftPlane < rightPlane & bottomPlane < topPlane & 0 < nearPlane < farPlane.

Important note: if frustum planes data is bound (see bindFrustumPlanes) the values set here will not be effective until unbound again, bound values are always overridden by values from bound data object. Bound values can only be modified via the ramses::DataObject bound to them.

Parameters:
  • leftPlane[in] Left plane of the camera frustum. Left opening angle if camera is perspective.

  • rightPlane[in] Right plane of the camera frustum. Right opening angle if camera is perspective.

  • bottomPlane[in] Bottom plane of the camera frustum. Bottom opening angle if camera is perspective.

  • topPlane[in] Top plane of the camera frustum. Top opening angle if camera is perspective.

  • nearPlane[in] Near plane of the camera frustum.

  • farPlane[in] Far plane of the camera frustum.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

Friends

friend class internal::SceneObjectRegistry
class PickableObject : public ramses::Node
#include <PickableObject.h>

PickableObject provides a way to specify a ‘pickable’ area.

The purpose of the PickableObject is to enable the user to add ‘pickable’ components to a scene. When this area is picked (see ramses::RamsesRenderer API) a message is sent to RamsesClient with the list of picked objects, these can be dispatched and handled using ramses::IRendererEventHandler::objectsPicked. Geometry specifies a triangle list (see ramses::Scene::createPickableObject for geometry requirements). PickableObject is a ramses::Node and as such can be placed in scene transformation topology, transformations will then be applied accordingly to the geometry when calculating picking. Geometry is defined in 3D coordinates but does not have to be volumetric, in fact when combined with the right camera it can represent a screen space area. In order to create a valid PickableObject it is mandatory to set a Camera. This is needed for the intersection algorithm to determine whether it was picked, the camera is needed to unproject the rasterized triangles. Typically the camera will be same as the one used to render the actual renderable but in some cases it makes sense to have different cameras for rendering and picking.

Usage example: we have a Ramses scene with a 3D car made of multiple MeshNodes within a transformation node topology, we want to make the car pickable: 1) Precompute a simplified geometry representation of the car (e.g. a bounding box) so that it can be represented as a single geometry with a minimum number of triangles (reduce overhead of intersection computation). 2) Create a PickableObject with the simplified geometry. 3) Set the PickableObject’s parent node to be the 3D car’s root node. This way the pickable geometry will always be transformed together with the car. 4) Assign the camera used to render the car to our PickableObject - the pickable geometry was computed from the car’s geometry and therefore should use the same camera for both rendering and picking.

Public Functions

const ArrayBuffer &getGeometryBuffer() const

Get the geometry buffer assigned to this PickableObject.

Returns:

The geometry buffer.

const Camera *getCamera() const

Get the camera currently set to the PickableObject.

Returns:

The PickableObject’s camera, nullptr if no camera assigned.

bool setCamera(const Camera &camera)

Set the camera to be used to unproject geometry.

Camera has to be valid (see ramses::PerspectiveCamera or ramses::OrthographicCamera) in order to be assigned to a PickableObject. See ramses::PickableObject for more details.

Parameters:

camera[in] Camera to be used to unproject geometry.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

pickableObjectId_t getPickableObjectId() const

Get the currently set PickableObject’s user ID.

Returns:

The PickableObject’s user ID

bool setPickableObjectId(pickableObjectId_t id)

Set PickableObject’s user ID.

Parameters:

id[in] User ID assigned to PickableObject, it will be used in callback ramses::IRendererEventHandler::objectsPicked when this PickableObject is picked.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setEnabled(bool enabled)

Enable/Disable PickableObject.

If a PickableObject is disabled it cannot be picked. PickableObject is enabled when created.

Parameters:

enabled[in] The enable flag which indicates if the PickableObject is enabled

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool isEnabled() const

Get the enabled state of the PickableObject.

Returns:

Indicates if the PickableObject is enabled

internal::PickableObjectImpl &impl()

Get the internal data for implementation specifics of PickableObject.

const internal::PickableObjectImpl &impl() const

Get the internal data for implementation specifics of PickableObject.

Friends

friend class internal::SceneObjectRegistry
class RamsesClient : public ramses::RamsesObject
#include <RamsesClient.h>

Entry point of RAMSES client API.

The RAMSES client class handles application state and and is a factory for scenes and client resources.

Public Functions

Scene *createScene(sceneId_t sceneId, std::string_view name = {})

Create a new empty Scene. The scene is published local-only (ramses::EScenePublicationMode::LocalOnly)

Parameters:
  • sceneId[in] The scene id for global identification of the Scene (is used for scene mapping on renderer side).

  • name[in] The optional name of the created Scene.

Returns:

A pointer to the created Scene, null on failure

Scene *createScene(const SceneConfig &sceneConfig, std::string_view name = {})

Create a new empty Scene.

Parameters:
  • sceneConfig[in] The scene configuration, see ramses::SceneConfig for details. A unique sceneId must be provided.

  • name[in] The optional name of the created Scene.

Returns:

A pointer to the created Scene, null on failure

Scene *loadSceneFromFile(std::string_view fileName, const SceneConfig &config = {})

Loads scene contents and resources from a file.

The file format has to match current Ramses SDK version in major and minor version number. This method is not back compatible and will fail if trying to load scene files saved using older Ramses SDK version.

Parameters:
  • fileName[in] File name to load the scene from.

  • config[in] optional configuration object to override default behavior, see ramses::SceneConfig for details

Returns:

New instance of scene with contents loaded from a file.

Scene *loadSceneFromMemory(std::unique_ptr<std::byte[], void (*)(const std::byte*)> data, size_t size, const SceneConfig &config = {})

Loads scene contents and resources from a memory buffer.

The file format has to match current Ramses SDK version in major and minor version number. This method is not back compatible and will fail if trying to load scene files saved using older Ramses SDK version.

Ramses takes ownership of the memory buffer passed in via data and will delete it via the provided deleter from unique_ptr when not used anymore. The caller may not modify the referenced memory anymore after this call. The behavior is undefined if data does not contain a complete serialized ramses scene or if size does not match the size of the scene data in bytes.

The deleter on data allows safe memory ownership passing on windows when ramses is used as dll. For more details and a convenience wrapper see ramses::RamsesUtils::LoadSceneFromMemory.

Parameters:
  • data[in] Memory buffer to load the scene from.

  • size[in] The size in bytes of the data memory.

  • config[in] optional configuration object to override default behavior, see ramses::SceneConfig for details

Returns:

New instance of scene with contents loaded from a file.

Scene *loadSceneFromFileDescriptor(int fd, size_t offset, size_t length, const SceneConfig &config = {})

Loads scene contents and resources from an open file descriptor.

The file format has to match current Ramses SDK version in major and minor version number. This method is not back compatible and will fail if trying to load scene files saved using older Ramses SDK version.

The ramses scene must be in the already opened filedescriptor at absolute position offset within the file. The filedescriptor must be opened for read access and may not be modified anymore after this call. The filedescriptor must support seeking. Ramses takes ownership of the filedescriptor and will close it when not needed anymore.

The behavior is undefined if the filedescriptor does not contain a complete serialized ramses scene at offset.

Parameters:
  • fd[in] Open and readable filedescriptor.

  • offset[in] Absolute starting position of ramses scene within fd.

  • length[in] Size of the scene data within fd.

  • config[in] optional configuration object to override default behavior, see ramses::SceneConfig for details

Returns:

New instance of scene with contents loaded from a file.

bool loadSceneFromFileAsync(std::string_view fileName, const SceneConfig &config = {})

Loads scene contents and resources asynchronously from a file. The file format has to match current Ramses SDK version in major and minor version number. This method is not backwards compatible and will fail if trying to load scene files saved using older Ramses SDK version.

This method does not directly return a scene but provides its results after loading is finished when calling dispatchEvents(). There will be one event for each loaded resource file followed by an event for the scene file.

Parameters:
  • fileName[in] File name to load the scene from.

  • config[in] optional configuration object to override default behavior, see ramses::SceneConfig for details

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool destroy(Scene &scene)

Destroys the given Scene. The reference of Scene is invalid after this call.

Parameters:

scene[in] The Scene to destroy

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

const Scene *findSceneByName(std::string_view name) const

Find a scene from the client by name.

Parameters:

name[in] The name of the scene to find.

Returns:

Pointer to the scene if found, nullptr otherwise.

Scene *findSceneByName(std::string_view name)

Find a scene from the client by name.

Parameters:

name[in] The name of the scene to find.

Returns:

Pointer to the scene if found, nullptr otherwise.

const Scene *getScene(sceneId_t sceneId) const

Get a scene from the client by scene id.

Parameters:

sceneId[in] The id of the scene to get.

Returns:

Pointer to the scene if found, nullptr otherwise.

Scene *getScene(sceneId_t sceneId)

Get a scene from the client by scene id.

Parameters:

sceneId[in] The id of the scene to get.

Returns:

Pointer to the scene if found, nullptr otherwise.

bool dispatchEvents(IClientEventHandler &clientEventHandler)

Some methods on the client provide asynchronous results. These can be synchronously received by calling this functions at regular intervals.

The point in time and the ordering of asynchronous events from different calls is unspecified. The ordering of events from one asynchronous load call is as specified in the documentation for that call.

Parameters:

clientEventHandler[in] User class that implements the callbacks that can be triggered if a corresponding event happened. Check IClientEventHandler documentation for more details.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

const RamsesFramework &getRamsesFramework() const

Get ramses::RamsesFramework which was used to create this ramses::RamsesClient instance.

Returns:

Reference to ramses::RamsesFramework which was used to create this ramses::RamsesClient instance.

RamsesFramework &getRamsesFramework()

Get ramses::RamsesFramework which was used to create this ramses::RamsesClient instance.

Returns:

Reference to ramses::RamsesFramework which was used to create this ramses::RamsesClient instance.

internal::RamsesClientImpl &impl()

Get the internal data for implementation specifics of RamsesClient.

const internal::RamsesClientImpl &impl() const

Get the internal data for implementation specifics of RamsesClient.

Public Static Functions

static bool GetFeatureLevelFromFile(std::string_view fileName, EFeatureLevel &detectedFeatureLevel)

Attempts to parse feature level from a Ramses scene file.

Parameters:
  • fileName[in] file path to Ramses scene file

  • detectedFeatureLevel[out] feature level detected in given file (valid only if parsing successful!)

Returns:

true if parsing was successful, false otherwise.

static bool GetFeatureLevelFromFile(int fd, size_t offset, size_t length, EFeatureLevel &detectedFeatureLevel)

Attempts to parse feature level from a Ramses scene file.

Parameters:
  • fd[in] open and readable file descriptor

  • offset[in] absolute starting position of ramses scene within fd

  • length[in] size of the scene data within fd

  • detectedFeatureLevel[out] feature level detected in given file (valid only if parsing successful!)

Returns:

true if parsing was successful, false otherwise.

Friends

friend class internal::ClientFactory
class RenderBuffer : public ramses::SceneObject
#include <RenderBuffer.h>

RenderBuffer can be used with RenderTarget as buffer for writing or with TextureSampler as buffer for reading.

A RenderBuffer can be used by one or more RenderTargets for rendering content into it. There are two basic types of RenderBuffers - color and depth, depth buffer can additionally have stencil data. A RenderBuffer can be used by one or more TextureSamplers for sampling data from it in a shader.

Public Functions

uint32_t getWidth() const

Returns the width of the RenderBuffer in pixels.

Returns:

width in pixels

uint32_t getHeight() const

Returns the height of the RenderBuffer in pixels.

Returns:

height in pixels

ERenderBufferFormat getBufferFormat() const

Returns the data format of the RenderBuffer.

Returns:

RenderBuffer data format

ERenderBufferAccessMode getAccessMode() const

Returns the read/write access mode of the RenderBuffer.

Returns:

RenderBuffer access mode

uint32_t getSampleCount() const

Returns the sample count used for MSAA.

Returns:

RenderBuffer sample count

internal::RenderBufferImpl &impl()

Get the internal data for implementation specifics of RenderBuffer.

const internal::RenderBufferImpl &impl() const

Get the internal data for implementation specifics of RenderBuffer.

Friends

friend class internal::SceneObjectRegistry
class RenderGroup : public ramses::SceneObject
#include <RenderGroup.h>

The RenderGroup is a container used to collect renderables which are supposed to be rendered together.

Renderables added to it can be ordered within the RenderGroup so that they will be rendered in given order. RenderGroup can then be added to a RenderPass (again with optional order of RenderGroup within the RenderPass) so a hierarchical ordering of renderables can be achieved. The RenderGroup can also contain other nested RenderGroups ordered together with the renderables. If a RenderGroup with nested RenderGroups is added to a RenderPass, all renderables in all nested RenderGroups will be rendered within the RenderPass as well. The order inside a nested RenderGroup is local, i.e. all its renderables/RenderGroups are rendered before the next renderable/RenderGroup of its parent RenderGroup.

Public Functions

bool addMeshNode(const MeshNode &mesh, int32_t orderWithinGroup = 0)

Add a mesh to this RenderGroup. If a mesh is already contained in this RenderGroup only its render order is updated. Mesh can be added to multiple RenderGroup instances.

Parameters:
  • mesh[in] The mesh to add to this RenderGroup.

  • orderWithinGroup[in] Order within the RenderGroup that will be used for rendering. Mesh with lower number will be rendered before a mesh with higher number.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool removeMeshNode(const MeshNode &mesh)

Remove a mesh from this RenderGroup.

Parameters:

mesh[in] The mesh to remove from this RenderGroup.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool containsMeshNode(const MeshNode &mesh) const

Checks whether a mesh was added to this RenderGroup.

Parameters:

mesh[in] The mesh to query

Returns:

true if the mesh is contained in this RenderGroup false otherwise

bool getMeshNodeOrder(const MeshNode &mesh, int32_t &orderWithinGroup) const

Gets a render order of given MeshNode within this RenderGroup.

Parameters:
Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool addRenderGroup(const RenderGroup &renderGroup, int32_t orderWithinGroup = 0)

Add a RenderGroup to this RenderGroup. If a RenderGroup is already contained in this RenderGroup only its render order is updated. RenderGroup can be added to multiple RenderGroup instances.

Parameters:
Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool removeRenderGroup(const RenderGroup &renderGroup)

Remove a RenderGroup from this RenderGroup.

Parameters:

renderGroup[in] The RenderGroup to remove from this RenderGroup.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool containsRenderGroup(const RenderGroup &renderGroup) const

Checks whether a RenderGroup was added to this RenderGroup.

Parameters:

renderGroup[in] The RenderGroup to query

Returns:

true if the RenderGroup is contained in this RenderGroup false otherwise

bool getRenderGroupOrder(const RenderGroup &renderGroup, int32_t &orderWithinGroup) const

Gets a render order of given RenderGroup within this RenderGroup.

Parameters:
Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool removeAllRenderables()

Will remove all renderables from this RenderGroup. Renderables in nested RenderGroups will stay.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool removeAllRenderGroups()

Will remove all RenderGroups from this RenderGroup. This is done NON-recursively, i.e. the RenderGroups themselves stay untouched.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

internal::RenderGroupImpl &impl()

Get the internal data for implementation specifics of RenderGroup.

const internal::RenderGroupImpl &impl() const

Get the internal data for implementation specifics of RenderGroup.

Friends

friend class internal::SceneObjectRegistry
class RenderGroupMeshIterator
#include <RenderGroupMeshIterator.h>

The RenderGroupMeshIterator traverses MeshNodes in a RenderGroup.

Public Functions

explicit RenderGroupMeshIterator(const RenderGroup &renderGroup)

RenderGroupMeshIterator constructor.

Parameters:

renderGroup[in] RenderGroup whose MeshNodes to iterate through

~RenderGroupMeshIterator()

Destructor.

const MeshNode *getNext()

Iterate through all MeshNodes. MeshNodes will be iterated over in order of adding, not in render order. Render order of a MeshNode within RenderGroup can be retrieved from its RenderGroup.

Iterator is invalid and may no longer be used if any objects are added or removed.

Returns:

Next MeshNode, null if no more MeshNodes available

class RenderPass : public ramses::SceneObject
#include <RenderPass.h>

The RenderPass is a container used to collect meshes which are supposed to be rendered together.

A RenderPass has a Camera which is used for all MeshNodes rendered in the RenderPass. A MeshNode is rendered only if added to a RenderPass. The RenderPass can optionally have a RenderTarget used to redirect the output of the RenderPass. RenderPass objects are ordered together using a render order, which is also shared with BlitPass objects, i.e, RenderPass and BlitPass objects can all be ordered relative to each other.

Public Functions

bool setCamera(const Camera &camera)

Set the camera to use for rendering the objects of this renderpass.

Parameters:

camera – The camera to use.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

const Camera *getCamera() const

Get the camera of this RenderPass.

Returns:

The camera or null if Camera has not been set.

Camera *getCamera()

Get the camera of this RenderPass.

Returns:

The camera or null if Camera has not been set.

bool addRenderGroup(const RenderGroup &renderGroup, int32_t orderWithinPass = 0)

Add a RenderGroup to this RenderPass for rendering.

RenderGroup can be added to multiple RenderPass instances but cannot be added multiple times to the same instance.

Parameters:
  • renderGroup[in] The RenderGroup to be added.

  • orderWithinPass[in] Order within the RenderPass that will be used for rendering. RenderGroup with lower number will be rendered before a RenderGroup with higher number.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool removeRenderGroup(const RenderGroup &renderGroup)

Remove a RenderGroup from this RenderPass.

Parameters:

renderGroup[in] The RenderGroup to be removed.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool containsRenderGroup(const RenderGroup &renderGroup) const

Checks whether a RenderGroup is part of the RenderPass.

Parameters:

renderGroup[in] The RenderGroup to look for

Returns:

true if the mesh is used in this RenderPass false otherwise

bool getRenderGroupOrder(const RenderGroup &renderGroup, int32_t &orderWithinPass) const

Gets a render order of given RenderGroup within this RenderPass.

Parameters:
Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool removeAllRenderGroups()

Will make the RenderPass empty.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setRenderTarget(RenderTarget *renderTarget)

Set the render target for the render pass to render into.

Parameters:

renderTarget – The render target to render into, set to null for direct framebuffer rendering

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

const RenderTarget *getRenderTarget() const

Get the render target of this render pass.

Returns:

The render target or null if render target has not been set.

bool setRenderOrder(int32_t renderOrder)

Set the render order for the render pass.

This order defines the order in which the render pass is executed relative to other render and blit passes. Render and blit passes with lower render order are executed first. Render and blit passes with same render order might be executed by the renderer in any order.

The default render order is Zero.

Parameters:

renderOrder – Render order used for ordering the render pass

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

int32_t getRenderOrder() const

Get the render order of this render pass.

Returns:

The render order of this render pass.

bool setClearColor(const vec4f &color)

Set the clear color for the RenderPass (default: [0,0,0,1])

The clear color will be used to clear a render target assigned to this RenderPass if clear flag is enabled, see setClearFlag.

Parameters:

color – color channels of clear color (RGBA in 0-1 range)

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

vec4f getClearColor() const

Returns the clear color of the RenderPass.

Returns:

color channels of clear color

bool setClearFlags(ClearFlags clearFlags)

Set the clear flags which enable/disable the clearing of the render target assigned to this RenderPass(default: ramses::EClearFlag::All)

The clear flags have no effect on render passes with no render target assigned, i.e. it is not allowed to control clearing of display buffer (whether it is framebuffer or offscreen buffer) on renderer side from within scene’s render pass.

Parameters:

clearFlags – clear flags, which is a bitmask of the ramses::EClearFlag enum

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

ClearFlags getClearFlags() const

Returns the clear flags of the RenderPass.

Returns:

clear flags, which is a bitmask of the ramses::EClearFlag enum

bool setEnabled(bool enable)

Enable/Disable render pass.

Parameters:

enable – The enable flag which indicates if the render pass is rendered (Default:true)

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool isEnabled() const

Get the enable state of the render pass.

Returns:

Indicates if the render pass is enabled

bool setRenderOnce(bool enable)

Set/unset render once flag - rendering of the render pass only once.

By default render pass is rendered every frame, the render once flag can be used to tell the renderer to render the render pass just once. This can be useful for pre-rendering of heavy content into render targets, etc.

This flag is orthogonal to all the other states of render pass, e.g. render pass is not rendered at all if it is disabled (see setEnabled) regardless of render once flag set or unset.

When render pass is enabled and render once set it is guaranteed to be rendered at least once (can be more if scene is unmapped/mapped on renderer side).

Parameters:

enable – The flag which indicates if the render pass is to be rendered only once (Default:false)

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool isRenderOnce() const

Get the render once state of the render pass.

Returns:

Indicates if the render pass is to be rendered only once

bool retriggerRenderOnce()

Will re-render a render once pass.

If content of the render once pass changes and needs to be rendered once more this method will guarantee the render pass to be rendered once more with the state of the scene flushed together with this command.

Note that Ramses does not track changes of render pass content and will not automatically re-render a render once pass if its content changed.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

internal::RenderPassImpl &impl()

Get the internal data for implementation specifics of RenderPass.

const internal::RenderPassImpl &impl() const

Get the internal data for implementation specifics of RenderPass.

Friends

friend class internal::SceneObjectRegistry
class RenderPassGroupIterator
#include <RenderPassGroupIterator.h>

The RenderPassGroupIterator traverses RenderGroups in a RenderPass.

Public Functions

explicit RenderPassGroupIterator(const RenderPass &renderPass)

RenderPassGroupIterator constructor.

Parameters:

renderPass[in] RenderPass whose RenderGroups to iterate through

~RenderPassGroupIterator()

Destructor.

const RenderGroup *getNext()

Iterate through all RenderGroups. RenderGroups will be iterated over in order of adding, not in render order. Render order of a RenderGroup within RenderPass can be retrieved from its RenderPass.

Iterator is invalid and may no longer be used if any objects are added or removed.

Returns:

Next RenderGroup, null if no more RenderGroups available

class RenderTarget : public ramses::SceneObject
#include <RenderTarget.h>

The RenderTarget can be used as an output for a RenderPass.

Public Functions

uint32_t getWidth() const

Returns the width of the RenderTarget in pixels.

Returns:

width in pixels

uint32_t getHeight() const

Returns the height of the RenderTarget in pixels.

Returns:

height in pixels

internal::RenderTargetImpl &impl()

Get the internal data for implementation specifics of RenderTarget.

const internal::RenderTargetImpl &impl() const

Get the internal data for implementation specifics of RenderTarget.

Friends

friend class internal::SceneObjectRegistry
class RenderTargetDescription
#include <RenderTargetDescription.h>

RenderTargetDescription holds all necessary information for a RenderTarget to be created.

Public Functions

RenderTargetDescription()

Constructor of RenderTargetDescription.

~RenderTargetDescription()

Destructor of RenderTargetDescription.

void validate(ValidationReport &report) const

Performs a (potentially slow!) validation of this object and its dependencies.

validate() may append issues to the provided report object, classified by warning or error:

  • errors need to be fixed, otherwise the object’s behaviour will be undefined

  • warnings indicate issues that are undesirable, but not necessarily cause problems (e.g. unused resources, performance issues)

Note

validate() will skip objects that are already part of the provided report. (Provide an empty report to force re-validation)

Parameters:

report – The report that the object writes to

bool addRenderBuffer(const RenderBuffer &renderBuffer, std::string *errorMsg = nullptr)

Adds a RenderBuffer to the RenderTargetDescription.

Multiple color RenderBuffers and at most one depth/stencil RenderBuffer can be added. The layout of multiple color RenderBuffers corresponds to the order of adding them (first RenderBuffer added has location 0, second added has location 1, etc.). Depth/stencil RenderBuffer is a special case and its relative order to the color buffer(s) irrelevant. All added render buffers must have same MSAA sample count. Trying to add render buffers with different sample count values will fail and generate error.

Parameters:
  • renderBuffer[in] RenderBuffer to be added to the RenderTargetDescription.

  • errorMsg[out] In case of an error this string will be filled with description of the error. In case of success it will be empty.

Returns:

true on success, false if an error occurred. Pass the optional errorMsg argument to get human readable description of the error, the error is also logged.

RenderTargetDescription(const RenderTargetDescription &other)

Copy constructor.

Parameters:

other – source to copy from

RenderTargetDescription(RenderTargetDescription &&other) noexcept

Move constructor.

Parameters:

other – source to move from

RenderTargetDescription &operator=(const RenderTargetDescription &other)

Copy assignment.

Parameters:

other – source to copy from

Returns:

this instance

RenderTargetDescription &operator=(RenderTargetDescription &&other) noexcept

Move assignment.

Parameters:

other – source to move from

Returns:

this instance

internal::RenderTargetDescriptionImpl &impl()

Get the internal data for implementation specifics of RenderTargetDescription.

const internal::RenderTargetDescriptionImpl &impl() const

Get the internal data for implementation specifics of RenderTargetDescription.

class Resource : public ramses::SceneObject
#include <Resource.h>

The Resource is the base class of all resources, such as arrays and textures.

Subclassed by ramses::ArrayResource, ramses::Effect, ramses::Texture2D, ramses::Texture3D, ramses::TextureCube

Public Functions

resourceId_t getResourceId() const

Get resource Id.

Returns:

the Id of the resource.

internal::ResourceImpl &impl()

Get the internal data for implementation specifics of Resource.

const internal::ResourceImpl &impl() const

Get the internal data for implementation specifics of Resource.

class SaveFileConfig
#include <SaveFileConfig.h>

Holds configuration settings for saving ramses::Scene instances into a file. This config file is designed to work with the Ramses Composer editor, but you can use the metadata to store version and export information from any exporter (or script). Use the config to trace the origin and export environment of assets during runtime.

Public Functions

void setMetadataString(std::string_view metadata)

Adds custom string metadata to the binary file saved by ramses::Scene. Can be any string. It is not used by anything other than logging info, particularly when loading a file and when errors occur.

Parameters:

metadata – the string to be written together with the saved binary data

void setExporterVersion(uint32_t major, uint32_t minor, uint32_t patch, uint32_t fileFormatVersion)

Specifies the semantic version of the exporter (binary, or script, or runtime logic). Use this to match a given asset later (e.g. when used in runtime) to the originating export tool to verify compatibility or diagnose errors and issues easier.

Parameters:
  • major – the major version number

  • minor – the minor version number

  • patch – the patch version number

  • fileFormatVersion – the file format used by the exporter itself (use 0 if not applicable)

void setLuaSavingMode(ELuaSavingMode mode)

Sets saving mode for all ramses::LuaScript and/or ramses::LuaModule instances. See ramses::ELuaSavingMode for the available options and their implications. Note that this is just a hint and the export logic will decide what to actually export, depending on availability of Lua source code or bytecode:

  • if only source code is available then only source code is exported regardless of the selected saving mode

  • if only byte code is available then only bytecode is exported regardless of the selected saving mode

  • if both source and bytecode are available then the selected saving mode is applied There will be no error produced if selected saving mode cannot be respected.

Parameters:

mode – selected saving mode, default is ramses::ELuaSavingMode::SourceAndByteCode

void setCompressionEnabled(bool compressionEnabled)

By default, ramses resources (Textures, Shaders) will be stored uncompressed This avoids some extra processing when loading resources, but causes larger asset files.

Parameters:

compressionEnabled – flag to disable/enable resource compression

~SaveFileConfig() noexcept

Destructor of SaveFileConfig

SaveFileConfig(const SaveFileConfig &other)

Copy Constructor of SaveFileConfig

Parameters:

other – the other SaveFileConfig to copy from

SaveFileConfig(SaveFileConfig &&other) noexcept

Move Constructor of SaveFileConfig

Parameters:

other – the other SaveFileConfig to move from

SaveFileConfig &operator=(const SaveFileConfig &other)

Assignment operator of SaveFileConfig

Parameters:

other – the other SaveFileConfig to copy from

Returns:

self

SaveFileConfig &operator=(SaveFileConfig &&other) noexcept

Move assignment operator of SaveFileConfig

Parameters:

other – the other SaveFileConfig to move from

Returns:

self

internal::SaveFileConfigImpl &impl()

Get the internal data for implementation specifics of SaveFileConfig.

const internal::SaveFileConfigImpl &impl() const

Get the internal data for implementation specifics of SaveFileConfig.

class Scene : public ramses::ClientObject
#include <Scene.h>

The Scene holds a scene graph. It is the essential class for distributing content to the ramses system.

Public Functions

bool publish(EScenePublicationMode publicationMode = EScenePublicationMode::LocalOnly)

Publishes the scene to the ramses system.

Other ramses system participants will be informed about the existence of the scene and can subscribe to it. The scene content is then sent to all subscribers and following flushes will send scene updates to them.

Parameters:

publicationMode[in] A flag to signal if a scene should be only available to local renderer(s) and not published to remote renderer(s), this is default.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool unpublish()

Unpublish the scene from the ramses system.

The scene will be removed from the ramses system. Subsequent changes to the scene will therefore not be propagated to the system.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool isPublished() const

Returns whether scene is currently published to the ramses system.

Returns:

true, if scene is currently published.

Returns:

false, if scene is currently not published.

sceneId_t getSceneId() const

Returns scene id defined at scene creation time.

Returns:

Scene id.

bool saveToFile(std::string_view fileName, const SaveFileConfig &config = {})

Saves all scene contents to a file.

Note that all ramses::LogicEngine instances in the scene will be updated (ramses::LogicEngine::update) and the scene will be flushed (flush) before saving.

Parameters:
  • fileName[in] File name to save the scene to.

  • config[in] optional configuration object with exporter and asset metadata info, see ramses::SaveFileConfig for details

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

LogicEngine *createLogicEngine(std::string_view name = {})

Creates a ramses::LogicEngine instance.

Logic is a crucial Ramses component and can be created from a Scene, all its bindings (e.g. ramses::NodeBinding, etc.) must be from this Scene - the scene that owns the ramses::LogicEngine instance. Like other scene objects ramses::LogicEngine can be destroyed using destroy and will be automatically destroyed when Scene is destroyed.

Note that multiple instances of ramses::LogicEngine can be created for single Scene but generally this is only meant for special usecases and not recommended.

Parameters:

name[in] The optional name of the ramses::LogicEngine

Returns:

A pointer to the created ramses::LogicEngine instance.

PerspectiveCamera *createPerspectiveCamera(std::string_view name = {})

Creates a Perspective Camera in this Scene.

Parameters:

name[in] The optional name of the Camera

Returns:

Pointer to the created Camera, null on failure

OrthographicCamera *createOrthographicCamera(std::string_view name = {})

Creates a Orthographic Camera in this Scene.

Parameters:

name[in] The optional name of the Camera

Returns:

Pointer to the created Camera, null on failure

Appearance *createAppearance(const Effect &effect, std::string_view name = {})

Creates a new Appearance.

Parameters:
  • effect[in] The effect from which this appearance takes its parameters

  • name[in] The optional name of the created Appearance.

Returns:

A pointer to the created Appearance, null on failure

Geometry *createGeometry(const Effect &effect, std::string_view name = {})

Creates a new Geometry.

Parameters:
  • effect[in] The effect which is used to create the Geometry.

  • name[in] The optional name of the created Geometry.

Returns:

A pointer to the created Geometry, null on failure

Node *createNode(std::string_view name = {})

Creates a scene graph node. The basic purpose of Node is to define topology in scene graph by links to parent and children nodes. Node can also hold transformation which is then propagated to children, thus defining a transformation topology. By default Node has identity transformation. Node can also hold visibility information which is propagated to children, thus defining a visibility topology. By default Node is visible, making a Node invisible makes also its whole subgraph invisible regardless of sub-nodes’ visibility state.

Parameters:

name[in] Optional name of the object.

Returns:

Pointer to the created Node, nullptr on failure.

MeshNode *createMeshNode(std::string_view name = {})

Creates a scene graph MeshNode. MeshNode is a Node with additional properties and bindings that represent a renderable geometry with appearance.

Parameters:

name[in] The optional name of the MeshNode.

Returns:

Pointer to the created MeshNode, null on failure.

bool destroy(SceneObject &object)

Destroys a previously created object using this scene The object must be owned by this scene in order to be destroyed. The reference to the object is no longer valid after it is destroyed. SceneObjects will automatically be destroyed once the scene is destroyed.

Parameters:

object – The object of the Scene to destroy

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setExpirationTimestamp(uint64_t ptpExpirationTimestampInMilliseconds)

Expiration timestamp is a point in time till which the scene is considered to be up-to-date.

Logic on renderer side will check the time every frame and in case it detects the scene to be rendered after its expiration timestamp it will generate an event (ramses::IRendererSceneControlEventHandler::sceneExpired).

IMPORTANT: Expiration timestamp value is bound to current state of scene (once it is flushed) and for all subsequent flushes until changed again or disabled. Once expiration timestamp is set to non-zero all subscribed renderers will periodically check it from that point on. User is responsible for calling this method to keep the expiration up-to-date during the lifecycle of the scene.

Setting the expiration timestamp to non-zero value enables the monitoring (ramses::IRendererSceneControlEventHandler::sceneExpirationMonitoringEnabled), to disable the expiration monitoring set expiration timestamp to 0 followed by a flush. By default the expiration checking is disabled. If an expired scene recovers while monitoring is disabled, there will be no event of recovery after monitoring re-enabled. If scene is expired at the moment monitoring is enabled, there will be event of expiration (after ramses::IRendererSceneControlEventHandler::sceneExpirationMonitoringEnabled).

Parameters:

ptpExpirationTimestampInMilliseconds[in] Expiration timestamp in milliseconds from synchronized clock. To avoid issues, keep this up-to-date reasonably enough in future.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool flush(sceneVersionTag_t sceneVersionTag = InvalidSceneVersionTag)

Commits all changes done to the scene since the last flush or since scene creation.

Flush also makes a new valid scene state available to all local and remote renderers. Flush will fail if a pending change makes the scene invalid to a degree that renderer would fail in attempt to render it, e.g. there is missing resource or a wrong configuration of ramses::RenderTarget. Note that successful flush still does not guarantee a full validity of a scene, see ramses::RamsesObject::validate to make a more thorough check of a scene or a particular object.

Parameters:

sceneVersionTag[in] updates the version tag of the scene along with the flushed scene updates. If set to a valid value, a subscribed renderer will generate a sceneFlushed() event when the scene update has been applied. Invalid scene version ids are ignored. Defaults to InvalidSceneVersionTag.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool resetUniformTimeMs()

resets the semantic uniform ramses::EEffectUniformSemantic::TimeMs The uniform value will contain the time elapsed since this method was called for the last time. Use this method to avoid possible overflow issues. The reset will be applied to the rendered scene with the next flush.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

int32_t getUniformTimeMs() const

Gets the current value used for the semantic uniform ramses::EEffectUniformSemantic::TimeMs Value wraps to 0 every ~24 days, measured from the beginning of synchronized clock epoch.

In order to avoid handling the wrap in the shader code or potential overflow issues the value should be reset using ramses::Scene::resetUniformTimeMs() The value is not reset automatically at startup.

Returns:

time in milliseconds, value range is 0 .. std::numeric_limits<int32_t>::max() (~24 days)

template<typename T = SceneObject>
T *findObject(std::string_view name)

Get an object from the scene by name This will also search for logic objects in all existing ramses::LogicEngine instances if used with ramses::SceneObject or ramses::LogicObject template type, however to search for a concrete logic type (e.g. ramses::LuaScript) use ramses::LogicEngine::findObject instead. Note that giving a concrete object template type might result in faster search because it is limited to only objects of that type.

Parameters:

name[in] The name of the object to get.

Returns:

Pointer to the object if found and convertible to the demanded type, nullptr otherwise.

template<typename T = SceneObject>
const T *findObject(std::string_view name) const

Get an object from the scene by name This will also search for logic objects in all existing ramses::LogicEngine instances if used with ramses::SceneObject or ramses::LogicObject template type, however to search for a concrete logic type (e.g. ramses::LuaScript) use ramses::LogicEngine::findObject instead. Note that giving a concrete object template type might result in faster search because it is limited to only objects of that type.

Parameters:

name[in] The name of the object to get.

Returns:

Pointer to the object if found and convertible to the demanded type, nullptr otherwise.

template<typename T = SceneObject>
T *findObject(sceneObjectId_t id)

Get an object from the scene by id This will also search for logic objects in all existing ramses::LogicEngine instances if used with ramses::SceneObject or ramses::LogicObject template type, however to search for a concrete logic type (e.g. ramses::LuaScript) use ramses::LogicEngine::findObject instead.

Parameters:

id[in] The id of the object to get.

Returns:

Pointer to the object if found and convertible to the demanded type, nullptr otherwise.

template<typename T = SceneObject>
const T *findObject(sceneObjectId_t id) const

Get an object from the scene by id This will also search for logic objects in all existing ramses::LogicEngine instances if used with ramses::SceneObject or ramses::LogicObject template type, however to search for a concrete logic type (e.g. ramses::LuaScript) use ramses::LogicEngine::findObject instead.

Parameters:

id[in] The id of the object to get.

Returns:

Pointer to the object if found and convertible to the demanded type, nullptr otherwise.

RenderGroup *createRenderGroup(std::string_view name = {})

Create a RenderGroup instance in the scene.

Parameters:

name[in] The optional name of the created RenderGroup instance.

Returns:

A pointer to the created RenderGroup, null on failure

RenderPass *createRenderPass(std::string_view name = {})

Create a render pass in the scene.

Parameters:

name[in] The optional name of the created render pass.

Returns:

A render pass.

BlitPass *createBlitPass(const RenderBuffer &sourceRenderBuffer, const RenderBuffer &destinationRenderBuffer, std::string_view name = {})

Create a blit pass in the scene. Source and destination render buffers must have same type, format and dimensions. By default the blitting region is set to the whole render buffers.

Parameters:
  • sourceRenderBuffer[in] Render buffer used as source to blit from

  • destinationRenderBuffer[in] Render buffer used as destination to blit to

  • name[in] The optional name of the created blit pass.

Returns:

A pointer to a BlitPass if successful or nullptr on failure.

RenderBuffer *createRenderBuffer(uint32_t width, uint32_t height, ERenderBufferFormat bufferFormat, ERenderBufferAccessMode accessMode, uint32_t sampleCount = 0u, std::string_view name = {})

Create a RenderBuffer to be used with RenderTarget for rendering into and TextureSampler for sampling from.

A multisampled buffer will be created if sampleCount greater than 0, note that the value is just a hint for the device, the actual number of samples might be different depending on device driver implementation. If the number of samples exceeds device capabilities the number of samples it will be clamped to its maximum supported (creation will succeeded with a warning log).

Parameters:
  • width[in] The width of the RenderBuffer in pixel.

  • height[in] The height of the RenderBuffer in pixel.

  • bufferFormat[in] Data format to use for the RenderBuffer to be created.

  • accessMode[in] Read/Write access mode of render buffer

  • sampleCount[in] Optional sample count for MSAA number of samples. Default value is 0 for no MSAA.

  • name[in] Optional name of the object.

Returns:

Pointer to the created RenderBuffer, null on failure.

PickableObject *createPickableObject(const ArrayBuffer &geometryBuffer, const pickableObjectId_t id, std::string_view name = {})

Create a PickableObject.

PickableObject provides a way to specify a ‘pickable’ area, when this area is picked (see ramses::RamsesRenderer API) a message is sent to RamsesClient with list of picked objects, these can be dispatched and handled using ramses::IRendererEventHandler::objectsPicked. Geometry to specify PickableObject has to be of data type ramses::EDataType::Vector3F and every 3 elements are vertices forming a triangle. Geometry will be interpreted as triangle list (no indices used) - it should be a simplified representation of the actual renderable geometry that it is assigned to, typically a bounding box. PickableObject is a ramses::Node and as such can be placed in scene transformation topology, the vertices should therefore be in local (model) space and transformations will be applied according node topology when calculating picking. Geometry is defined in 3D coordinates but does not have to be volumetric, in fact when combined with the right camera (ramses::PickableObject::setCamera) it can represent a screen space area.

Parameters:
  • geometryBuffer[in] Vertex buffer containing triangles defining geometry of PickableObject.

  • id[in] User ID assigned to PickableObject, it will be used in callback ramses::IRendererEventHandler::objectsPicked when this PickableObject is picked.

  • name[in] Name of the PickableObject.

Returns:

Pointer to the created PickableObject, nullptr on failure.

RenderTarget *createRenderTarget(const RenderTargetDescription &rtDesc, std::string_view name = {})

Create a render target providing a set of RenderBuffers.

Parameters:
Returns:

Pointer to the created RenderTarget, null on failure.

TextureSampler *createTextureSampler(ETextureAddressMode wrapUMode, ETextureAddressMode wrapVMode, ETextureSamplingMethod minSamplingMethod, ETextureSamplingMethod magSamplingMethod, const Texture2D &texture, uint32_t anisotropyLevel = 1, std::string_view name = {})

Creates a texture sampler object.

Parameters:
  • wrapUMode[in] texture wrap mode for u axis.

  • wrapVMode[in] texture wrap mode for v axis.

  • minSamplingMethod[in] texture min sampling method.

  • magSamplingMethod[in] texture mag sampling method. Must be set to either Nearest or Linear.

  • texture[in] Texture to be used with this sampler object.

  • anisotropyLevel[in] Texture sampling anisotropy level. 1: isotropic sampling, >1: anisotropic sampling usual values: 1, 2, 4, 8, 16 (depending on graphics platform)

  • name[in] Optional name of the object.

Returns:

Pointer to the created TextureSampler, null on failure.

TextureSampler *createTextureSampler(ETextureAddressMode wrapUMode, ETextureAddressMode wrapVMode, ETextureAddressMode wrapRMode, ETextureSamplingMethod minSamplingMethod, ETextureSamplingMethod magSamplingMethod, const Texture3D &texture, std::string_view name = {})

Creates a texture sampler object.

Parameters:
  • wrapUMode[in] texture wrap mode for u axis.

  • wrapVMode[in] texture wrap mode for v axis.

  • wrapRMode[in] texture wrap mode for r axis.

  • minSamplingMethod[in] texture min sampling method.

  • magSamplingMethod[in] texture mag sampling method. Must be set to either Nearest or Linear.

  • texture[in] Texture to be used with this sampler object.

  • name[in] Optional name of the object.

Returns:

Pointer to the created TextureSampler, null on failure.

TextureSampler *createTextureSampler(ETextureAddressMode wrapUMode, ETextureAddressMode wrapVMode, ETextureSamplingMethod minSamplingMethod, ETextureSamplingMethod magSamplingMethod, const TextureCube &texture, uint32_t anisotropyLevel = 1, std::string_view name = {})

Creates a texture sampler object.

Parameters:
  • wrapUMode[in] texture wrap mode for u axis.

  • wrapVMode[in] texture wrap mode for v axis.

  • minSamplingMethod[in] texture min sampling method.

  • magSamplingMethod[in] texture mag sampling method. Must be set to either Nearest or Linear.

  • texture[in] Texture to be used with this sampler object.

  • anisotropyLevel[in] Texture sampling anisotropy level. 1: isotropic sampling, >1: anisotropic sampling usual values: 1, 2, 4, 8, 16 (dependent on graphics platform)

  • name[in] Optional name of the object.

Returns:

Pointer to the created TextureSampler, null on failure.

TextureSampler *createTextureSampler(ETextureAddressMode wrapUMode, ETextureAddressMode wrapVMode, ETextureSamplingMethod minSamplingMethod, ETextureSamplingMethod magSamplingMethod, const RenderBuffer &renderBuffer, uint32_t anisotropyLevel = 1, std::string_view name = {})

Creates a texture sampler object.

Parameters:
  • wrapUMode[in] texture wrap mode for u axis.

  • wrapVMode[in] texture wrap mode for v axis.

  • minSamplingMethod[in] texture min sampling method.

  • magSamplingMethod[in] texture mag sampling method. Must be set to either Nearest or Linear.

  • renderBuffer[in] RenderBuffer to be used with this sampler object. The render buffer must have access mode of read/write and 0 samples (ramses::RenderBuffer::getSampleCount).

  • anisotropyLevel[in] Texture sampling anisotropy level. 1: isotropic sampling, >1: anisotropic sampling usual values: 1, 2, 4, 8, 16 (dependent on graphics platform)

  • name[in] Optional name of the object.

Returns:

Pointer to the created TextureSampler, null on failure.

TextureSampler *createTextureSampler(ETextureAddressMode wrapUMode, ETextureAddressMode wrapVMode, ETextureSamplingMethod minSamplingMethod, ETextureSamplingMethod magSamplingMethod, const Texture2DBuffer &texture2DBuffer, uint32_t anisotropyLevel = 1, std::string_view name = {})

Creates a texture sampler object for mutable texture.

Parameters:
  • wrapUMode[in] texture wrap mode for u axis.

  • wrapVMode[in] texture wrap mode for v axis.

  • minSamplingMethod[in] texture min sampling method.

  • magSamplingMethod[in] texture mag sampling method. Must be set to either Nearest or Linear.

  • texture2DBuffer[in] Texture2DBuffer to be used with this sampler object.

  • anisotropyLevel[in] Texture sampling anisotropy level. 1: isotropic sampling, >1: anisotropic sampling usual values: 1, 2, 4, 8, 16 (dependent on graphics platform)

  • name[in] Optional name of the object.

Returns:

Pointer to the created TextureSampler, null on failure.

TextureSamplerMS *createTextureSamplerMS(const RenderBuffer &renderBuffer, std::string_view name)

Creates a multisampled texture sampler object.

Parameters:
  • renderBuffer[in] RenderBuffer to be used with this sampler object. The render buffer must be multisampled and have access mode of read/write.

  • name[in] Optional name of the object.

Returns:

Pointer to the created ramses::TextureSamplerMS, null on failure.

TextureSamplerExternal *createTextureSamplerExternal(ETextureSamplingMethod minSamplingMethod, ETextureSamplingMethod magSamplingMethod, std::string_view name = {})

Creates a texture sampler object that can sample from external textures.

Provides support for sampling from samplers represented by variables of type “samplerExternalOES” in GLSL shaders, according to OpenGL extension “OES_EGL_image_external”. According to the spec, external texture samplers must have “clamp to edge” for the wrap mode, and are not allowed to have mip maps so minification filtering must be set to either linear or nearest.

Since it is not possible to directly provide content to external textures similar to conventional 2D textures, external textures can get their content only through the platform specific mechanisms. This can be done by creating a texture consumer from the sampler object and linking it to an external buffer created on the renderer.

Note: external texture sampler can only be used with external textures, i.e., it is not possible to use the same sampler variable in the shader to sample from conventional 2D textures as sort of fallback textures for example.

Parameters:
  • minSamplingMethod[in] texture min sampling method. Must be set to either Nearest or Linear.

  • magSamplingMethod[in] texture mag sampling method. Must be set to either Nearest or Linear.

  • name[in] Optional name of the object.

Returns:

Pointer to the created TextureSampler, null on failure.

template<typename T>
ArrayResource *createArrayResource(size_t numElements, const T *arrayData, std::string_view name = {})

Create a new ramses::ArrayResource. It makes a copy of the given data of a certain type as a resource, an immutable data object. Data type must be a type that passes ramses::IsArrayResourceDataType, i.e. one of ramses::EDataType. See ramses::ArrayResource for more details.

If an ramses::ArrayResource object is created with type std::byte (ramses::EDataType::ByteBlob) then an element is defined as one byte, rather than a logical vertex element. Hence, functions of the class ramses::ArrayResource referring to element refer to a single byte within byte array, element size is 1 byte and number of elements is the same as max size in bytes.

Parameters:
  • numElements[in] The number of elements of the given data type to use for the resource.

  • arrayData[in] Pointer to the data to be used to create the array from.

  • name[in] The optional name of the ArrayResource.

Returns:

A pointer to the created ArrayResource, null on failure

Texture2D *createTexture2D(ETextureFormat format, uint32_t width, uint32_t height, const std::vector<MipLevelData> &mipLevelData, bool generateMipChain = false, const TextureSwizzle &swizzle = {}, std::string_view name = {})

Create a new Texture2D. It makes a copy of the given data of a certain type as a resource, an immutable data object. See ramses::Texture2D for more details. See ramses::MipLevelData for more details on expected texel alignment.

Parameters:
  • format[in] Pixel format of the Texture2D data.

  • width[in] Width of the texture (mipmap level 0).

  • height[in] Height of the texture (mipmap level 0).

  • mipLevelData[in] Vector of ramses::MipLevelData structs defining mipmap levels to use. Amount and sizes of supplied mipmap levels have to conform to GL specification. Order is lowest level (biggest resolution) to highest level (smallest resolution).

  • swizzle[in] Describes how RGBA channels of the texture are swizzled, where each member of the struct represents one destination channel that the source channel should get sampled from.

  • generateMipChain[in] Auto generate mipmap levels. Cannot be used if custom data for lower mipmap levels provided.

  • name[in] The name of the Texture2D.

Returns:

A pointer to the created Texture2D, null on failure. Will fail with data == nullptr and/or width/height == 0.

Texture3D *createTexture3D(ETextureFormat format, uint32_t width, uint32_t height, uint32_t depth, const std::vector<MipLevelData> &mipLevelData, bool generateMipChain = false, std::string_view name = {})

Create a new Texture3D. It makes a copy of the given data of a certain type as a resource, an immutable data object. See ramses::Texture3D for more details. See ramses::MipLevelData for more details on expected texel alignment.

Parameters:
  • format[in] Pixel format of the Texture3D data.

  • width[in] Width of the texture (mipmap level 0).

  • height[in] Height of the texture (mipmap level 0).

  • depth[in] Depth of the texture.

  • mipLevelData[in] Vector of ramses::MipLevelData structs defining mipmap levels to use. Amount and sizes of supplied mipmap levels have to conform to GL specification. Order is lowest level (biggest resolution) to highest level (smallest resolution).

  • generateMipChain[in] Auto generate mipmap levels. Cannot be used if custom data for lower mipmap levels provided.

  • name[in] The name of the Texture3D.

Returns:

A pointer to the created Texture3D, null on failure. Will fail with data == nullptr and/or width/height/depth == 0.

TextureCube *createTextureCube(ETextureFormat format, uint32_t size, const std::vector<CubeMipLevelData> &mipLevelData, bool generateMipChain = false, const TextureSwizzle &swizzle = {}, std::string_view name = {})

Create a new Cube Texture. It makes a copy of the given data of a certain type as a resource, an immutable data object. All texel values are initially initialized to 0. See ramses::TextureCube for more details. See ramses::CubeMipLevelData for more details on expected texel alignment.

Parameters:
  • format[in] Pixel format of the Cube Texture data.

  • size[in] edge length of one quadratic cube face, belonging to the texture.

  • mipLevelData[in] Vector of MipLevelData structs defining mipmap levels to use. Amount and sizes of supplied mipmap levels have to conform to GL specification. Order ist lowest level (biggest resolution) to highest level (smallest resolution).

  • generateMipChain[in] Auto generate mipmap levels. Cannot be used if custom data for lower mipmap levels provided.

  • swizzle[in] Describes how RGBA channels of the texture are swizzled,

  • name[in] The name of the Cube Texture.

Returns:

A pointer to the created Cube Texture, null on failure. Will fail with any face-data == nullptr and/or size == 0.

Effect *createEffect(const EffectDescription &effectDesc, std::string_view name = {})

Create a new Effect by parsing a GLSL shader described by an EffectDescription instance. Refer to RamsesClient::getLastEffectErrorMessages in case of parsing error. See ramses::Effect for more details.

Parameters:
  • effectDesc[in] Effect description.

  • name[in] The name of the created Effect.

Returns:

A pointer to the created Effect, null on failure

std::string getLastEffectErrorMessages() const

Get the GLSL error messages that were produced at the creation of the last Effect.

Returns:

A string containing the GLSL error messages of the last effect

ArrayBuffer *createArrayBuffer(EDataType dataType, size_t maxNumElements, std::string_view name = {})

Create a new ramses::ArrayBuffer. The created object is a mutable buffer object that can be used as index or as vertex buffer in ramses::Geometry.

The created object has mutable contents and immutable size that has to be specified at creation time. Upon creation the contents are undefined. The contents of the object can be (partially) updated, the change to the object data is transferred to renderer on next flush.

Note: if an ramses::ArrayBuffer object is created with type ramses::EDataType::ByteBlob then an element is defined as one byte, rather than a logical vertex element. Hence, all functions of the class ramses::ArrayBuffer referring to element refer to a single byte within byte array, element size is 1 byte and max number of elements is the same as max size in bytes.

Parameters:
  • dataType[in] Data type of the array data. See ramses::GetEDataType to get ramses::EDataType from static type.

  • maxNumElements[in] The maximum number of data elements this buffer can hold.

  • name[in] The optional name of the created array buffer.

Returns:

A pointer to the created array buffer.

Texture2DBuffer *createTexture2DBuffer(ETextureFormat textureFormat, uint32_t width, uint32_t height, size_t mipLevelCount, std::string_view name = {})

Create a new Texture2DBuffer. The created object is a mutable buffer object that can be used as a texture in TextureSampler. The created object has mutable contents and immutable size that has to be specified at creation time. Upon creation the contents are undefined. The contents of the object can be (partially) updated, the change to the object data is transferred to renderer on next flush.

The sizes of mipmap levels are computed according to OpenGL specification (see documentation of glTexStorage2D). The mipLevelCount has to be consistent with the width and height, so that no mipMap will have size zero.

Parameters:
  • textureFormat[in] texture format. Only uncompressed texture formats are supported

  • width[in] width of the first and largest mipmap level.

  • height[in] height of the first and largest mipmap level.

  • mipLevelCount[in] Number of mipmap levels created for the Texture2DBuffer.

  • name[in] The optional name of the created Texture2DBuffer.

Returns:

A pointer to the created Texture2DBuffer.

DataObject *createDataObject(EDataType dataType, std::string_view name = {})

Creates a ramses::DataObject within the scene, which holds a data value of given type.

For supported data types see ramses::IsDataObjectDataType.

Parameters:
  • dataType[in] data type that this ramses::DataObject will hold.

  • name[in] optional name of the object.

Returns:

Pointer to the created ramses::DataObject, null on failure.

bool createTransformationDataProvider(const Node &node, dataProviderId_t dataId)

Annotates a Node as a transformation data provider. Data provider and data consumer can be linked on Ramses Renderer side. Linking data means that the consumer’s data property will be overridden by provider’s data property.

Parameters:
  • node[in] from which transformation data shall be provided.

  • dataId[in] id to reference the provider node in this scene

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool createTransformationDataConsumer(const Node &node, dataConsumerId_t dataId)

Annotates a Node as a transformation data consumer. Data provider and data consumer can be linked on Ramses Renderer side. Linking data means that the consumer’s data property will be overridden by provider’s data property.

Parameters:
  • node[in] which shall consume data from another node.

  • dataId[in] id to reference the consumer node in this scene

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool createDataProvider(const DataObject &dataObject, dataProviderId_t dataId)

Annotates a DataObject as a data provider. Data provider and data consumer can be linked on Ramses Renderer side. Linking data means that the consumer’s data property will be overridden by provider’s data property.

Parameters:
  • dataObject[in] from which data shall be provided.

  • dataId[in] id to reference the provider in this scene

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool createDataConsumer(const DataObject &dataObject, dataConsumerId_t dataId)

Annotates a DataObject as a data consumer. Data provider and data consumer can be linked on Ramses Renderer side. Linking data means that the consumer’s data property will be overridden by provider’s data property.

Parameters:
  • dataObject[in] which shall consume data from another DataObject.

  • dataId[in] id to reference the consumer in this scene

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool createTextureProvider(const Texture2D &texture, dataProviderId_t dataId)

Annotates a Texture2D as a content provider. Texture provider and texture consumer can be linked on Ramses Renderer side. Linking textures means that the consumer’s sampler will use provider’s texture as content.

Parameters:
  • texture[in] from which content shall be provided.

  • dataId[in] id to reference the provider in this scene

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool updateTextureProvider(const Texture2D &texture, dataProviderId_t dataId)

Sets a new texture to an existing provider. This allows the provider to change the provided content which is then automatically applied to all linked consumers on the renderer side without the need to recreate or relink any provider/consumer.

Parameters:
  • texture[in] from which content shall be provided.

  • dataId[in] id to reference the provider in this scene

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool createTextureConsumer(const TextureSampler &sampler, dataConsumerId_t dataId)

Annotates a ramses::TextureSampler as a content consumer. Texture provider and texture consumer can be linked on Ramses Renderer side. Linking textures means that the consumer’s sampler will use provider’s texture as content.

Parameters:
  • sampler[in] which shall consume texture content from provider texture.

  • dataId[in] id to reference the consumer in this scene

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool createTextureConsumer(const TextureSamplerMS &sampler, dataConsumerId_t dataId)

Annotates a ramses::TextureSamplerMS as a content consumer. Texture provider and texture consumer can be linked on Ramses Renderer side. Linking textures means that the consumer’s sampler will use provider’s texture as content.

Parameters:
  • sampler[in] which shall consume texture content from provider texture.

  • dataId[in] id to reference the consumer in this scene

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool createTextureConsumer(const TextureSamplerExternal &sampler, dataConsumerId_t dataId)

Annotates a ramses::TextureSamplerExternal as a content consumer. Texture provider and texture consumer can be linked on Ramses Renderer side. Linking textures means that the consumer’s sampler will use provider’s texture as content.

Sampler for external texture can only be linked to an external buffer on Ramses Renderer side (ramses::RamsesRenderer::createExternalBuffer).

Parameters:
  • sampler[in] which shall consume texture content from provider texture.

  • dataId[in] id to reference the consumer in this scene

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

SceneReference *createSceneReference(sceneId_t referencedScene, std::string_view name = {})

Creates a new SceneReference object.

The SceneReference object references a scene, which might be unknown to this RamsesClient, but is or expected to be known to the RamsesRenderer subscribed to this scene. It allows to remotely change limited set of states of the referenced scene on renderer side. There can be only one instance of ramses::SceneReference referring to a sceneId across all RamsesClients connected to a RamsesRenderer. Creating more than one instance referring to the same sceneId in one RamsesClient will result in an error, multiple instances referring to the same sceneId across different RamsesClients results in undefined behavior. ramses::SceneReference can be destroyed and re-created but there are certain aspects to consider, see ramses::SceneReference for details. More than one level of referencing, i.e. a master scene being also a scene reference for another master scene, is currently not supported.

Parameters:
  • referencedScene[in] A scene id of a scene known to the RamsesRenderer.

  • name[in] The optional name of the created SceneReference.

Returns:

A pointer to the created SceneReference.

bool linkData(SceneReference *providerReference, dataProviderId_t providerId, SceneReference *consumerReference, dataConsumerId_t consumerId)

Tell the RamsesRenderer to link a data provider to a data consumer across two scenes.

Data provider and data consumer must be created via client scene API and their data type must match. Linking data means that the consumer’s data property will be overridden by provider’s data property. A consumer within a scene can be linked to exactly one provider.

A link between provider and consumer is possible, if they are either part of the this scene or one of its scene references.

If the function returns true, ramses::IClientEventHandler::dataLinked will be emitted after the link is processed by renderer. The link will fail (reported via callback result argument) if either the data provider or data consumer does not exist or their data type does not match.

Scene reference must be known to renderer side before attempting to make a data link. Make sure any involved ramses::SceneReference was reported to be in state Ready or higher (see ramses::IClientEventHandler::sceneReferenceStateChanged).

Should one of the scene references of the data link go to state Available or Unavailable while the data link is active, the link will implicitly be destroyed and needs to be rerequested again.

If successful the operation can be assumed to be effective in the next frame consumer scene is rendered after flushed. If the data consumer is already linked to a provider (data or offscreen buffer), the old link will be discarded, however if the new link fails it is undefined whether previous link was discarded or not.

Parameters:
  • providerReference – A pointer to a SceneReference created by this scene, or nullptr to use this scene.

  • providerId – The id of the data provider within the providerScene or providerReference.

  • consumerReference – A pointer to the SceneReference which consumes the data, or nullptr to use this scene.

  • consumerId – The id of the data consumer within the consumerScene or consumerReference.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool unlinkData(SceneReference *consumerReference, dataConsumerId_t consumerId)

Removes an existing link between two scenes (see ramses::Scene::linkData).

If the function returns true, ramses::IClientEventHandler::dataUnlinked will be emitted after it is processed by renderer. If successful the operation can be assumed to be effective in the next frame consumer scene is rendered after flushed.

Parameters:
  • consumerReference – The pointer to the SceneReference which consumes the data, or nullptr to use this scene.

  • consumerId – The id of the data consumer within the consumerReference.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

RamsesClient &getRamsesClient()

Getter for ramses::RamsesClient this Scene was created from.

Returns:

the parent RamsesCLient

const Resource *getResource(resourceId_t id) const

Get a resource which is owned by the scene by id.

Parameters:

id[in] The resource id of the resource to get.

Returns:

Pointer to the resource if found, nullptr otherwise.

Resource *getResource(resourceId_t id)

Get a resource which is owned by the scene by id.

Parameters:

id[in] The resource id of the resource to get.

Returns:

Pointer to the resource if found, nullptr otherwise.

internal::SceneImpl &impl()

Get the internal data for implementation specifics of Scene.

const internal::SceneImpl &impl() const

Get the internal data for implementation specifics of Scene.

Friends

friend class internal::RamsesClientImpl
class SceneConfig
#include <SceneConfig.h>

The SceneConfig holds a set of parameters to be used when creating a scene or loading a scene from file/memory. Some parameters are only relevant for loading a scene.

Public Functions

SceneConfig()

default constructor

explicit SceneConfig(sceneId_t sceneId, EScenePublicationMode publicationMode = EScenePublicationMode::LocalOnly)

constructor of SceneConfig

Parameters:
  • sceneId – Each scene requires a sceneId for global identification (sceneId is used for scene mapping on renderer side). If no sceneId is provided Ramses will use the sceneId stored in the serialized file or raise an error if the scene is created at runtime.

  • publicationMode – see ramses::SceneConfig::setPublicationMode for details

~SceneConfig()

Destructor of SceneConfig.

void setPublicationMode(EScenePublicationMode publicationMode)

Set the publication mode that will be used for this scene.

Later calls to publish must use the same value as given here. Setting this to ramses::EScenePublicationMode::LocalOnly for scenes that will never be published remotely enables optimization possibilities.

Parameters:

publicationMode – Publication mode to use with scene. ramses::EScenePublicationMode::LocalOnly is default.

void setSceneId(sceneId_t sceneId)

Sets the sceneId for the loaded/created scene. By default the id stored in the binary will be used.

Parameters:

sceneId – The sceneId for the loaded scene

void setMemoryVerificationEnabled(bool enabled)

By default, ramses performs sanity checks on the binary data when the scene is loaded from file. This behavior can be disabled here (not recommended unless there are other measures to ensure valid binary data).

Parameters:

enabled – flag to disable/enable memory verification when loading the scene

SceneConfig(const SceneConfig &other)

Copy constructor.

Parameters:

other – source to copy from

SceneConfig(SceneConfig &&other) noexcept

Move constructor.

Parameters:

other – source to move from

SceneConfig &operator=(const SceneConfig &other)

Copy assignment.

Parameters:

other – source to copy from

Returns:

this instance

SceneConfig &operator=(SceneConfig &&other) noexcept

Move assignment.

Parameters:

other – source to move from

Returns:

this instance

internal::SceneConfigImpl &impl()

Get the internal data for implementation specifics of SceneConfig.

const internal::SceneConfigImpl &impl() const

Get the internal data for implementation specifics of SceneConfig.

class SceneGraphIterator
#include <SceneGraphIterator.h>

A SceneObjectIterator can iterate through the nodes in the scene graph with the order specified as the traversal style.

Public Functions

SceneGraphIterator(Node &startNode, ETreeTraversalStyle traversalStyle, ERamsesObjectType objectType = ERamsesObjectType::Node)

Constructor for SceneGraphIterator. A SceneObjectIterator can iterate through the nodes in the scene graph with the order specified as traversal style.

Parameters:
  • startNode[in] root node of the (sub)tree that should be traversed

  • traversalStyle[in] traversal style that should be used

  • objectType[in] Type of objects to iterate through

~SceneGraphIterator()

Destructor.

Node *getNext()

Returns the next node while iterating.

Iterator is invalid and may no longer be used if any nodes are added or removed.

Returns:

next node, null if no more objects available

class SceneIterator
#include <SceneIterator.h>

The SceneIterator traverses scenes in a RamsesClient.

SceneIterator provides a way to traverse all scenes created with a given client.

Public Functions

explicit SceneIterator(const RamsesClient &client)

A SceneIterator can iterate through scenes of the given client.

Parameters:

client[in] RamsesClient whose scenes to iterate through

~SceneIterator()

Destructor

Scene *getNext()

Returns the next scene while iterating.

Returns:

The next scene, null when no more scenes are available. The iterator is invalid and may not be used after any scenes are added or removed.

class SceneObject : public ramses::ClientObject
#include <SceneObject.h>

The SceneObject is a base class for all client API objects owned by a Scene.

Subclassed by ramses::Appearance, ramses::ArrayBuffer, ramses::BlitPass, ramses::DataObject, ramses::Geometry, ramses::LogicEngine, ramses::LogicObject, ramses::Node, ramses::RenderBuffer, ramses::RenderGroup, ramses::RenderPass, ramses::RenderTarget, ramses::Resource, ramses::SceneReference, ramses::Texture2DBuffer, ramses::TextureSampler, ramses::TextureSamplerExternal, ramses::TextureSamplerMS

Public Functions

sceneObjectId_t getSceneObjectId() const

Returns scene object id which is automatically assigned at creation time of object and is unique within scope of one scene.

Returns:

Scene object id.

const Scene &getScene() const

Get the owning ramses::Scene.

Returns:

owning ramses::Scene

Scene &getScene()

Get the owning ramses::Scene.

Returns:

owning ramses::Scene

internal::SceneObjectImpl &impl()

Get the internal data for implementation specifics of SceneObject.

const internal::SceneObjectImpl &impl() const

Get the internal data for implementation specifics of SceneObject.

Friends

friend class internal::SceneObjectRegistry
class SceneObjectIterator
#include <SceneObjectIterator.h>

The SceneObjectIterator traverses objects in a Scene.

SceneObjectIterator provides a way to traverse all objects owned by a given scene.

Public Functions

explicit SceneObjectIterator(const Scene &scene, ERamsesObjectType objectType = ERamsesObjectType::RamsesObject)

A SceneObjectIterator can iterate through objects of given type within a scene. Note that this will not iterate over ramses::LogicObject instances created from ramses::LogicEngine, use ramses::LogicEngine::getCollection for those.

Parameters:
  • scene[in] Scene whose objects to iterate through

  • objectType[in] Optional type of objects to iterate through.

~SceneObjectIterator()

Destructor.

RamsesObject *getNext()

Iterate through all objects of given type.

Iterator is invalid and may no longer be used if any objects are added or removed.

Returns:

next object, null if no more objects available

class SceneReference : public ramses::SceneObject
#include <SceneReference.h>

The SceneReference object refers to another ramses scene using its sceneId.

The SceneReference object references a scene, which might be otherwise unknown to this RamsesClient, but is or expected to be known to a RamsesRenderer subscribed to its master scene (scene in which the reference was created using ramses::Scene::createSceneReference). The SceneReference allows to remotely change limited set of states of the referenced scene on renderer side, results of those requests are reported asynchronously in form of event callbacks, see ramses::IClientEventHandler.

There cannot be multiple instances of SceneReference referring to the same sceneId, however SceneReference can be destroyed using ramses::Scene::destroy and re-created with the same sceneId in another scene, i.e. change its ‘master’ scene. It is recommended to get SceneReference to ramses::RendererSceneState::Available state and wait for confirmation (ramses::IClientEventHandler::sceneReferenceStateChanged) before destroying it, otherwise the scene remains on renderer side with no owner, potentially consuming resources and causing undesired results if shown, also any pending requests, events or actions will either fail or get lost (no master scene to report to). Even though recommended, setting referenced scene to Available before destroying is not strictly required, so it is possible to change its master scene regardless of its actual state on renderer side (even if actively rendered) but this should be done only with extra caution and understanding of the consequences mentioned above.

Public Functions

bool requestState(RendererSceneState requestedState)

Set a requested state for this scene reference.

The ramses::RamsesRenderer will bring the referenced scene to this state, if preconditions are met. When requesting ramses::RendererSceneState::Ready or higher the referenced scene will inherit display mapping from the master scene (ramses::Scene where this reference was created), that implies that the mapping of master scene has to be set on renderer side first (ramses::RendererSceneControl::setSceneMapping).

Whenever a state of the referenced scene changes on renderer side, there will be a callback ramses::IClientEventHandler::sceneReferenceStateChanged. Note that scene state on renderer side can also change due to reasons not controlled from client side (e.g. referenced scene is unpublished).

This is just a request to the renderer to change the scene state, there are requirements that have to be met for every scene state change. The renderer waits with the scene state change till all the conditions are met, therefore the request cannot fail but it might never happen. It is application’s responsibility to implement a timeout logic if needed.

It is not allowed to request state Unavailable, as this state can only be the result of external conditions.

Parameters:

requestedState[in]

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

RendererSceneState getRequestedState() const

Get the currently requested state for this scene reference.

Returns:

The state of the reference.

sceneId_t getReferencedSceneId() const

Get the sceneId of the referenced scene.

Returns:

The scene id of the referenced scene

bool requestNotificationsForSceneVersionTags(bool flag)

Request callbacks (ramses::IClientEventHandler::sceneReferenceFlushed) to be triggered whenever a flush with valid version tag (ramses::Scene::flush) has been applied to the referenced scene on the renderer. Enabling notifications after they were previously disabled will also trigger said event once with the last applied valid version tag (i.e. version tag last applied before notifications were enabled). Note that in case there is flush with version applied and notifications enabled within the same renderer update loop the ramses::IClientEventHandler::sceneReferenceFlushed callback might be triggered twice reporting the same version, however the order of reporting is always strictly kept and matching order of flushes applied.

Scene reference has to be in Ready state to be able to receive scene version tag notifications.

Parameters:

flag[in] enable/disable notifications for this scene

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setRenderOrder(int32_t renderOrder)

Set scene render order.

Scenes are rendered one after each other on renderer side, lower number means scene will be rendered before all scenes with higher number. The render order specified here is relative to its master scene render order, master scene render order is set on renderer side (ramses::RendererSceneControl::setSceneDisplayBufferAssignment).

Parameters:

renderOrder[in] Lower value means that a scene is rendered before a scene with higher value. Default is 0.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

internal::SceneReferenceImpl &impl()

Get the internal data for implementation specifics of SceneReference.

const internal::SceneReferenceImpl &impl() const

Get the internal data for implementation specifics of SceneReference.

Friends

friend class internal::SceneObjectRegistry
class Texture2D : public ramses::Resource
#include <Texture2D.h>

Texture represents a 2-D texture resource.

Public Functions

uint32_t getWidth() const

Gets texture width.

Returns:

Texture width

uint32_t getHeight() const

Gets texture height.

Returns:

Texture height

ETextureFormat getTextureFormat() const

Gets texture format.

Returns:

Texture format

const TextureSwizzle &getTextureSwizzle() const

Gets swizzle description.

Returns:

Swizzle Description

internal::Texture2DImpl &impl()

Get the internal data for implementation specifics of Texture.

const internal::Texture2DImpl &impl() const

Get the internal data for implementation specifics of Texture.

Friends

friend class internal::SceneObjectRegistry
class Texture2DBuffer : public ramses::SceneObject
#include <Texture2DBuffer.h>

The Texture2DBuffer is a mutable texture buffer used to hold texture data with the possibility to perform partial updates.

This object must be initialized with data, otherwise the contents of it are not specified (garbage data or black, depending on driver behavior). The number of mipmap levels is user given value and the size of the mipchain is computed according to OpenGL specification (each further mipMap level has half the size of the previous mipMap level). Refer to the documentation of glTexStorage2D for more details.

Public Functions

bool updateData(size_t mipLevel, uint32_t offsetX, uint32_t offsetY, uint32_t width, uint32_t height, const std::byte *data)

Update a subregion of the data of Texture2DBuffer. The caller is responsible to check that the data has the correct size, i.e. the size of a texel times the number of texels specified in the subregion of the texture face. Returns error if the specified subregion exceeds the size of the target mipmap level.

Parameters:
  • mipLevel – The level of the mipMap level which will receive the data. First mipMap is 0, second is 1 and so on

  • offsetX – The horizontal texel offset into the texture data

  • offsetY – The vertical texel offset into the texture data

  • width – The horizontal subregion size in texels

  • height – The vertical subregion size in texels

  • data – Texel data provided for update. The data must be in row-major order wrt. provided width/height. Data will be copied internally and no longer needed after this call returns.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

size_t getMipLevelCount() const

Returns the number of mipmap levels created for the Texture2DBuffer (same as provided in ramses::Scene::createTexture2DBuffer() )

Returns:

number of mipmap levels

bool getMipLevelSize(size_t mipLevel, uint32_t &widthOut, uint32_t &heightOut) const

Returns the size of a specific mipmap level in texels.

Parameters:
  • mipLevel[in] The mipMap level of which the size will be returned

  • widthOut[out] the width of the mipMap level which was specified

  • heightOut[out] the height of the mipMap level which was specified

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

size_t getMipLevelDataSizeInBytes(size_t mipLevel) const

Returns the size of a specific mipmap level in bytes.

Parameters:

mipLevel[in] The mipMap level of which the size will be returned

Returns:

Size of data in bytes for given mip level, 0 if mipLevel invalid

ETextureFormat getTexelFormat() const

Returns the texel format provided at creation.

Returns:

The texel format provided at creation

bool getMipLevelData(size_t mipLevel, void *buffer, size_t bufferSize) const

Copies the data of a single mip-level into a user-provided buffer. The amount of data copied is bufferSize or getMipLevelDataSizeInBytes, whichever is smaller.

Parameters:
  • mipLevel[in] The mipMap level of which the data will be returned

  • buffer[out] The buffer where the mip data will be copied into

  • bufferSize[in] The size of given buffer in bytes

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

internal::Texture2DBufferImpl &impl()

Get the internal data for implementation specifics of Texture2DBuffer.

const internal::Texture2DBufferImpl &impl() const

Get the internal data for implementation specifics of Texture2DBuffer.

Friends

friend class internal::SceneObjectRegistry
class Texture3D : public ramses::Resource
#include <Texture3D.h>

Texture represents a texture resource.

Public Functions

uint32_t getWidth() const

Gets texture width.

Returns:

Texture width

uint32_t getHeight() const

Gets texture height.

Returns:

Texture height

uint32_t getDepth() const

Gets texture depth.

Returns:

Texture depth

ETextureFormat getTextureFormat() const

Gets texture format.

Returns:

Texture format

internal::Texture3DImpl &impl()

Get the internal data for implementation specifics of Texture.

const internal::Texture3DImpl &impl() const

Get the internal data for implementation specifics of Texture.

Friends

friend class internal::SceneObjectRegistry
class TextureCube : public ramses::Resource
#include <TextureCube.h>

TextureCube stores pixel data with 6 equally sized quadratic faces.

Public Functions

uint32_t getSize() const

Gets cube texture edge length.

Returns:

Texture cube edge length

ETextureFormat getTextureFormat() const

Gets texture format.

Returns:

Texture format

const TextureSwizzle &getTextureSwizzle() const

Gets swizzle description.

Returns:

Swizzle Description

internal::TextureCubeImpl &impl()

Get the internal data for implementation specifics of TextureCube.

const internal::TextureCubeImpl &impl() const

Get the internal data for implementation specifics of TextureCube.

Friends

friend class internal::SceneObjectRegistry
class TextureSampler : public ramses::SceneObject
#include <TextureSampler.h>

The TextureSampler holds a texture and its sampling parameters.

Public Functions

ETextureAddressMode getWrapUMode() const

Gets the texture wrap mode for the u axis.

Returns:

ETextureAddressMode wrap mode for u axis

ETextureAddressMode getWrapVMode() const

Gets the texture wrap mode for the v axis.

Returns:

ETextureAddressMode wrap mode for v axis

ETextureAddressMode getWrapRMode() const

Gets the texture wrap mode for the r axis.

Returns:

ETextureAddressMode wrap mode for r axis

ETextureSamplingMethod getMinSamplingMethod() const

Gets the texture min sampling method.

Returns:

ETextureSamplingMethod min sampling method

ETextureSamplingMethod getMagSamplingMethod() const

Gets the texture mag sampling method.

Returns:

ETextureSamplingMethod mag sampling method

uint32_t getAnisotropyLevel() const

Gets the texture sampling anisotropy level.

Returns:

The texture sampling anisotropy level.

ERamsesObjectType getTextureType() const

Gets the type of the texture.

Returns:

Type of the texture, see ERamsesObjectType enum for possible values.

bool setTextureData(const Texture2D &dataSource)

Replaces current texture content source with a new one. Texture data can be changed from/to any type/format with these exceptions:

Parameters:

dataSource[in] Texture data source to be used with this sampler.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool setTextureData(const Texture3D &dataSource)

Replaces current texture content source with a new one. Texture data can be changed from/to any type/format with these exceptions:

bool setTextureData(const TextureCube &dataSource)

Replaces current texture content source with a new one. Texture data can be changed from/to any type/format with these exceptions:

bool setTextureData(const Texture2DBuffer &dataSource)

Replaces current texture content source with a new one. Texture data can be changed from/to any type/format with these exceptions:

bool setTextureData(const RenderBuffer &dataSource)

Replaces current texture content source with a new one. Texture data can be changed from/to any type/format with these exceptions:

internal::TextureSamplerImpl &impl()

Get the internal data for implementation specifics of TextureSampler.

const internal::TextureSamplerImpl &impl() const

Get the internal data for implementation specifics of TextureSampler.

Friends

friend class internal::SceneObjectRegistry
class TextureSamplerExternal : public ramses::SceneObject
#include <TextureSamplerExternal.h>

ramses::TextureSamplerExternal is used to sample from external textures data when bound to a ramses::Appearance uniform input (ramses::Appearance::setInputTexture called with ramses::TextureSamplerExternal).

Public Functions

internal::TextureSamplerImpl &impl()

Get the internal data for implementation specifics of TextureSamplerExternal.

const internal::TextureSamplerImpl &impl() const

Get the internal data for implementation specifics of TextureSamplerExternal.

Friends

friend class internal::SceneObjectRegistry
class TextureSamplerMS : public ramses::SceneObject
#include <TextureSamplerMS.h>

ramses::TextureSamplerMS is used to sample multisampled data when bound to a ramses::Appearance uniform input (ramses::Appearance::setInputTexture called with ramses::TextureSamplerMS).

Public Functions

internal::TextureSamplerImpl &impl()

Get the internal data for implementation specifics of TextureSamplerMS.

const internal::TextureSamplerImpl &impl() const

Get the internal data for implementation specifics of TextureSamplerMS.

Friends

friend class internal::SceneObjectRegistry
struct TextureSwizzle
#include <TextureSwizzle.h>

Information of how color channels of a texture are reordered or set to fixed value (one, zero). For example swizzling a texture with a red triangle (R:1, G:0, B:0, A:1) to TextureSwizzle(Blue, Green, Red, Alpha) would turn the triangle blue. The resulting color channels would be: (R:0, G:0, B:1, A:1). The red input color channel was basically rerouted to the blue output color channel. The color channels can also be fully overridden with a value of 0 (ETextureChannelColor::Zero) or 1 (ETextureChannelColor::One).

Public Members

ETextureChannelColor channelRed = ETextureChannelColor::Red

The red color channel of texture that can be swizzled to any of ETextureChannelColor.

ETextureChannelColor channelGreen = ETextureChannelColor::Green

The green color channel of texture that can be swizzled to any of ETextureChannelColor.

ETextureChannelColor channelBlue = ETextureChannelColor::Blue

The blue color channel of texture that can be swizzled to any of ETextureChannelColor.

ETextureChannelColor channelAlpha = ETextureChannelColor::Alpha

The alpha color channel of texture that can be swizzled to any of ETextureChannelColor.

class UniformInput : public ramses::EffectInput
#include <UniformInput.h>

The UniformInput is a description of an uniform effect input.

Public Functions

EEffectUniformSemantic getSemantics() const

Returns the effect input semantics.

Returns:

Effect input semantics

size_t getElementCount() const

Returns the number of elements that are assigned to this effect input.

Returns:

the element count or 0 if not initialized

~UniformInput()

Destructor of UniformInput.

UniformInput(const UniformInput &other)

Copy constructor.

Parameters:

other – source to copy from

UniformInput(UniformInput &&other) noexcept

Move constructor.

Parameters:

other – source to move from

UniformInput &operator=(const UniformInput &other)

Assignment operator.

Parameters:

other – source to assign from

UniformInput &operator=(UniformInput &&other) noexcept

Move assignment operator.

Parameters:

other – source to move assign from

class IRamshCommand
#include <IRamshCommand.h>

Class representing a ramses ramsh command.

These commands can be registered with ramses::RamsesFramework::addRamshCommand and will receive callbacks triggered via console input or DLT injection.

Public Functions

virtual ~IRamshCommand() = default

Destructor of IRamshCommand.

virtual const std::string &keyword() const = 0

Keyword of this ramsh command. The keyword can be an alphanumeric string. Ramsh inputs having this keyword as first token will call this commands execute method.

Returns:

the keyword string

virtual const std::string &help() const = 0

Helptext for this ramsh command. It will be displayed when the user invokes the ‘help’ command. It should be a short description of the command and its expected arguments.

Returns:

the help text

virtual bool execute(const std::vector<std::string> &input) = 0

The command handler. It will be invoked with all ramsh command tokens.

Ramsh commands are separated by spaces and each resulting token will be passed as input. The command keyword itself is the first token.

Caution: This method will be invoked asynchronously from another thread. Blocking calls during execution can lead to unpredictable behavior.

Parameters:

input[in] The command tokens including keyword

Returns:

true if the command was successful, false if not

class IThreadWatchdogNotification
#include <IThreadWatchdogNotification.h>

Users can implement this callback to receive alive notifications about ramses threads.

In order to receive alive notification of ramses threads, one must provide a pointer to an implementation of this interface to RamsesFrameworkConfig::setWatchdogNotificationCallBack. Before calling notifyThread with a certain threadID a registerThread call for that id will be invoked. Before stopping notifications of a certain threadID the unregisterThread method will be invoked - therefore do not expect alive messages for a certain threadID after an unregisterThread call for that threadID.

Public Functions

virtual ~IThreadWatchdogNotification() = default

Virtual destructor of IThreadWatchdogNotification

virtual void notifyThread(ERamsesThreadIdentifier threadID) = 0

This method is invoked cyclic with threadID of alive threads.

The method is invoked from the actual thread context in question, therefore users must take care not to call long operations in this callback, or ramses processing will be blocked.

Parameters:

threadID[in] ID of thread reporting it being alive.

virtual void registerThread(ERamsesThreadIdentifier threadID) = 0

Before reporting alive messages of a certain threadID, this method will be called with that specific threadID. Do not expect notifyThread calls for threadID before this method was invoked.

Parameters:

threadID[in] ID of thread that will be reported.

virtual void unregisterThread(ERamsesThreadIdentifier threadID) = 0

Before stopping to report alive messages of a certain threadID, this method will be called with that specific threadID. Do not expect notifyThread calls for threadID after this method was invoked.

Parameters:

threadID[in] ID of thread that will not report anymore.

class RamsesFramework
#include <RamsesFramework.h>

Class representing ramses framework components that are needed to initialize an instance of ramses client and renderer.

Public Functions

explicit RamsesFramework(const RamsesFrameworkConfig &config)

Constructor of RamsesFramework.

Parameters:

config[in] Configuration object

bool connect()

Tries to establish a connection to the RAMSES system.

If only local rendering is desired this does not need to be called - but all scenes must be published in ramses::EScenePublicationMode::LocalOnly.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool isConnected() const

Check if the RamsesClient is connected or not.

Returns:

true if connected, false otherwise.

bool disconnect()

Disconnects the RamsesClient from the system.

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

EFeatureLevel getFeatureLevel() const

Returns the feature level this RamsesFramework instance was configured to use when created. See ramses::RamsesFrameworkConfig::setFeatureLevel and ramses::EFeatureLevel for more details.

Returns:

feature level this RamsesFramework instance was configured to use

RamsesClient *createClient(std::string_view applicationName)

Create a new ramses::RamsesClient linked to this framework. Creation of multiple clients is supported. It might be disallowed to create any client depending on internal policy. Ownership of the client will remain with the framework.

Must create all client instances before calling connect().

The created instance is valid until destroyClient() is called or it will be automatically deleted in the RamsesFramework destructor.

Parameters:

applicationName – a name for the ramses client application

Returns:

The new ramses::RamsesClient object or nullptr if the creation failed or was denied.

bool destroyClient(RamsesClient &client)

Destroy a ramses::RamsesClient created with this framework. This method will fail when handed an object created with another RamsesFramework.

May not be called when connected.

Parameters:

client – the object to destroy

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

RamsesRenderer *createRenderer(const RendererConfig &config)

Create a new ramses::RamsesRenderer linked to this framework. Only one RamsesRenderer can exist per RamsesFramework instance. It might be disallowed to create any renderer depending on internal policy. Ownership of the renderer will remain with the framework.

Must create the renderer object before calling connect().

The created instance is valid until destroyRenderer() is called or it will be automatically deleted in the RamsesFramework destructor.

Parameters:

config – Set of configuration flags and attributes for the ramses renderer

Returns:

The new ramses::RamsesRenderer object or nullptr if the creation failed or was denied.

bool destroyRenderer(RamsesRenderer &renderer)

Destroy a ramses::RamsesRenderer created with this framework. This method will fail when handed an object created with another RamsesFramework.

May not be called when connected.

Parameters:

renderer – the object to destroy

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

std::optional<Issue> getLastError()

Returns the last error which occurred during an API call within the Ramses SDK and clears it. Subsequent calls to this method will return std:nullopt until some API call produces a new error.

It is highly recommended to always check return value from all Ramses API (typically bool or pointer to object) and in case there is problem (returned false or nullptr) use this method to get more details about what happened. Note that all errors are also logged regardless if using this method or not.

Returns:

last error if any occurred and not already cleared by calling this method, std::nullopt otherwise

bool addRamshCommand(const std::shared_ptr<IRamshCommand> &command)

Register a ramsh command that can be invoked via console and DLT injection.

This is for testing and debugging purpose only. Command injection is not guaranteed to work in production.

The command has to be provided via shared_ptr to avoid lifetime issues. Internally ramses will only store a std::weak_ptr to the command. Therefore it is valid to let go of the shared_ptr on caller side and expect that no calls will happen in the command anymore. This allows to have user object references in the command implementation with a shorter lifetime than RamsesFramework.

It is not possible to delete commands. They are expected to be long-living and are bound to the lifetime of the RamsesFramework object.

Parameters:

command[in] the ramsh command

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

bool executeRamshCommand(const std::string &input)

Execute a ramsh command programmatically.

Instead of typing the command in ramsh console or using DLT injection this function enables the user to execute a ramsh command in code. The input is a string that contains the command and args. For setting the consoleLogLevel the input string with command and argument would be: “setLogLevelConsole trace”.

Parameters:

input[in] a a string containing the ramsh command and args

Returns:

true for success, false otherwise (check log or ramses::RamsesFramework::getLastError for details).

~RamsesFramework()

Destructor of RamsesFramework.

This will destroy all objects created with this RamsesFramework instance (ramses::RamsesRenderer, ramses::RamsesClient), so there is no general need to explicitly destroy these objects individually, if not specifically intended to do so.

RamsesFramework(const RamsesFramework&) = delete

Deleted copy constructor.

RamsesFramework(RamsesFramework&&) = delete

Deleted move constructor.

RamsesFramework &operator=(const RamsesFramework&) = delete

Deleted copy assignment.

Returns:

unused

RamsesFramework &operator=(RamsesFramework&&) = delete

Deleted move assignment.

Returns:

unused

internal::RamsesFrameworkImpl &impl()

Get the internal data for implementation specifics of RamsesFramework.

const internal::RamsesFrameworkImpl &impl() const

Get the internal data for implementation specifics of RamsesFramework.

Public Static Functions

static void SetLogHandler(const LogHandlerFunc &logHandlerFunc)

Sets a custom log handler function, which is called each time a log message occurs. All messages will still be logged to the regular sinks (dlt, console)

@ param logHandlerFunc function which is called for each log message Set to nullptr to delete the handler

Note: the logHandlerFunc will be called from inside ramses internal code, and it must return quickly and not block, otherwise it will break the ramses internal rendering or distribution logic.

Additional restrictions:

  1. logHandlerFunc will be called from multiple threads and has to be thread safe

  2. logHandlerFunc may never call back into ramses code

  3. this method should not be used in target code, it is only for testing and tooling

static uint64_t GetSynchronizedClockMilliseconds()

Gets the current value of the synchronized clock in milliseconds

The synchronized clock is a common time source shared between ramses client and renderer. Its implementation is system dependent. In the simplest case it refers to the system clock. On systems with different ECUs it may refer to an external time source (ptp time). Both renderer and client ECUs need to be built with the same type of synchronized clock.

The synchronized clock is used for the scene expiration mechanism (ramses::Scene::setExpirationTimestamp)

Returns:

current time point of synchronized clock in milliseconds

class RamsesFrameworkConfig
#include <RamsesFrameworkConfig.h>

RamsesFrameworkConfig holds a set of parameters to be used to initialize ramses.

Public Functions

explicit RamsesFrameworkConfig(EFeatureLevel featureLevel)

Constructor of RamsesFrameworkConfig.

Parameters:

featureLevel[in] feature level to use (See ramses::EFeatureLevel for more details)

~RamsesFrameworkConfig()

Destructor of RamsesFrameworkConfig.

bool setFeatureLevel(EFeatureLevel featureLevel)

Set feature level.

Sets feature level that will be used when creating ramses::RamsesFramework. ramses::RamsesClient and ramses::RamsesRenderer created from this framework will only be able to connect to client/renderer using a compatible feature level. Only files exported using the exact same feature level can be loaded into ramses::RamsesClient created from this framework. See ramses::EFeatureLevel for more details.

Parameters:

featureLevel[in] feature level to use

Returns:

true on success, false if an error occurred (error is logged)

EFeatureLevel getFeatureLevel() const

Get feature level.

Gets feature level that was set using setFeatureLevel.

Returns:

currently set feature level.

bool setRequestedRamsesShellType(ERamsesShellType requestedShellType)

Request a certain type of ramses shell.

Parameters:

requestedShellType[in] type of ramses shell

Returns:

true on success, false if an error occurred (error is logged)

bool setWatchdogNotificationInterval(ERamsesThreadIdentifier thread, uint32_t interval)

Set watchdog notification interval of ramses threads.

Parameters:
  • thread[in] which thread identifier to set the interval for

  • interval[in] interval in ms which is used to call given callback

Returns:

true on success, false if an error occurred (error is logged)

bool setWatchdogNotificationCallBack(IThreadWatchdogNotification *callback)

Set watchdog callback.

notifyThread Method will be called in the interval specified registerThread and unregisterThread are called to signal which threads will be calling the callback, and should be ‘monitored’ by user code in an appropriate way.

Parameters:

callback[in] callback class to use for watchdog reporting

Returns:

true on success, false if an error occurred (error is logged)

bool disableDLTApplicationRegistration()

Disable DLT application registration.

When set and DLT is enabled ramses expects DLT_REGISTER_APP being called before RamsesFramework construction and DLT_UNREGISTER_APP after RamsesFramework destruction. Ramses will add its context to the existing application.

When not disabled, ramses will manage DLT application registration itself.

Returns:

true on success, false if an error occurred (error is logged)

void setDLTApplicationID(std::string_view id)

Set the application ID name for DLT (4 chars)

Parameters:

id[in] to use as DLT application id

std::string_view getDLTApplicationID() const

Return the DLT application id value set in configuration object.

Returns:

DLT application id value set in this configuration object

void setDLTApplicationDescription(std::string_view description)

Set the application description for DLT.

Parameters:

description[in] to use as DLT application description

std::string_view getDLTApplicationDescription() const

Return the DLT application description set in configuration object.

Returns:

DLT application description set in this configuration object

void setLogLevel(ELogLevel logLevel)

Sets the log level for all contexts.

Parameters:

logLevel[in] the log level to be applied

bool setLogLevel(std::string_view context, ELogLevel logLevel)

Sets the log level for the provided context.

Parameters:
  • context[in] the log context to modify

  • logLevel[in] the log level to be applied

Returns:

true on success, false if an error occurred (error is logged)

void setLogLevelConsole(ELogLevel logLevel)

Sets the maximum log level for all contexts on console output.

Other outputs are not affected.

Parameters:

logLevel[in] the log level to be applied

void setPeriodicLogInterval(std::chrono::seconds interval)

Sets the logging interval for the periodic log messages.

The Ramses framework periodically logs information about the Ramses version, connected participants, scene states etc. Please leave unchanged in a production environment as the provided information is important for error analysis.

Default value is 2 seconds. A value of 0 disables logging.

Parameters:

interval[in] logging interval in seconds.

void setLoggingInstanceName(std::string_view instanceName)

Sets the logging instance name. All logs produced by Ramses have this format: “$instanceName.$threadName[.$additionalId]: $logMessage” The instance name can be set to an arbitrary name using this method, this can be useful to distinguish logs when running multiple instances of Ramses framework in same process, thus sharing the logging system. Note that this will only work when multiple Ramses framework instances run in separate threads.

Parameters:

instanceName[in] logging instance name, default is “R”.

bool setParticipantGuid(uint64_t guid)

Sets the participant identifier.

The guid identifies the ramses participant in a distributed rendering setup. It is auto-generated by default. Guid values < 256 are reserved and may not be used (an error will be returned)

Parameters:

guid[in] participant identifier

Returns:

true on success, false if an error occurred (error is logged)

bool setParticipantName(std::string_view name)

Sets the participant name in a distributed rendering setup.

Default value is an empty string.

Parameters:

name[in] human readable participant name

Returns:

true on success, false if an error occurred (error is logged)

bool setConnectionSystem(EConnectionSystem connectionSystem)

Sets the connection system for a distributed setup.

Parameters:

connectionSystem[in] the connection system to use (default: TCP)

Returns:

true on success, false if an error occurred (error is logged)

void setInterfaceSelectionIPForTCPCommunication(std::string_view ip)

Sets the IP address that is used to select the local network interface.

Parameters:

ip[in] IP to use

void setInterfaceSelectionPortForTCPCommunication(uint16_t port)

Sets the port that is used to select the local network interface.

Parameters:

port[in] Port to use

void setDaemonIPForTCPCommunication(std::string_view ip)

Sets the IP address of the communication daemon.

Parameters:

ip[in] IP to use

void setDaemonPortForTCPCommunication(uint16_t port)

Sets the port of the communication daemon.

Parameters:

port[in] Port to use

bool setConnectionKeepaliveSettings(std::chrono::milliseconds interval, std::chrono::milliseconds timeout)

Configures the network connection monitoring.

In a distributed setup ramses participants repeatedly send keepalive messages to other participants within the given time interval. If no keepalive is received for the given timeout, the remote will be considered stalled and disconnected. This prevents ramses renderers from showing old content from stalled clients.

Parameters:
  • interval – time interval for sending keepalive messages

  • timeout – maximum time to tolerate a missing keepalive message

Returns:

true on success, false if an error occurred (error is logged)

RamsesFrameworkConfig(const RamsesFrameworkConfig &other)

Copy constructor.

Parameters:

other – source to copy from

RamsesFrameworkConfig(RamsesFrameworkConfig &&other) noexcept

Move constructor.

Parameters:

other – source to move from

RamsesFrameworkConfig &operator=(const RamsesFrameworkConfig &other)

Copy assignment.

Parameters:

other – source to copy from

Returns:

this instance

RamsesFrameworkConfig &operator=(RamsesFrameworkConfig &&other) noexcept

Move assignment.

Parameters:

other – source to move from

Returns:

this instance

internal::RamsesFrameworkConfigImpl &impl()

Get the internal data for implementation specifics of RamsesFrameworkConfig.

const internal::RamsesFrameworkConfigImpl &impl() const

Get the internal data for implementation specifics of RamsesFrameworkConfig.

class RamsesObject
#include <RamsesObject.h>

The RamsesObject is a base class for all client API objects owned by the framework.

Subclassed by ramses::ClientObject, ramses::RamsesClient

Public Functions

std::string_view getName() const

Returns the name of the object.

Returns:

Name of the object

bool setName(std::string_view name)

Changes the name of the object.

Parameters:

name – New name of the object

Returns:

true for success, false otherwise

ERamsesObjectType getType() const

Gets type of the object.

Returns:

Type of the object, see ERamsesObjectType enum for possible values.

bool isOfType(ERamsesObjectType type) const

Checks if the object is of given type.

Parameters:

type[in] Type to check against.

Returns:

True if object is of given type, ie. it can be converted to given type.

bool setUserId(uint64_t highId, uint64_t lowId)

Set user ID for this object. User ID is an optional identifier of RamsesObject stored as number of up to 128 bits. User ID is often logged together with name (getName) when referring to this object and is serialized, thus persistent. Note that user IDs do not have to be unique, it is user’s choice and responsibility if uniqueness is desired. User ID is logged only if other than [0,0] was set and the format is hexadecimal ‘highId|lowId’ with all digits printed.

Parameters:
  • highId – high 64 bits of user ID to set

  • lowId – low 64 bits of user ID to set

Returns:

true if successful, false if failed

std::pair<uint64_t, uint64_t> getUserId() const

Returns the user ID set using setUserId.

Returns:

the user ID [highId, lowId] or [0, 0] if no user ID was set

void validate(ValidationReport &report) const

Performs a (potentially slow!) validation of this object and its dependencies.

validate() may append issues to the provided report object, classified by warning or error:

  • errors need to be fixed, otherwise the object’s behaviour will be undefined

  • warnings indicate issues that are undesirable, but not necessarily cause problems (e.g. unused resources, performance issues)

Note

validate() will skip objects that are already part of the provided report. (Provide an empty report to force re-validation)

Parameters:

report – The report that the object writes to

template<typename T>
const T *as() const

Casts this object to given type. Has same behavior as dynamic_cast, will return nullptr (without error) if given type does not match this object.

Returns:

ramses object cast to given type or nullptr if wrong type provided

template<typename T>
T *as()

Casts this object to given type. Has same behavior as dynamic_cast, will return nullptr (without error) if given type does not match this object.

Returns:

ramses object cast to given type or nullptr if wrong type provided

internal::RamsesObjectImpl &impl()

Get the internal data for implementation specifics of RamsesObject.

const internal::RamsesObjectImpl &impl() const

Get the internal data for implementation specifics of RamsesObject.

RamsesObject(const RamsesObject&) = delete

Deleted copy constructor.

RamsesObject(RamsesObject&&) = delete

Deleted move constructor.

RamsesObject &operator=(const RamsesObject&) = delete

Deleted copy assignment.

Returns:

unused

RamsesObject &operator=(RamsesObject&&) = delete

Deleted move assignment.

Returns:

unused

class ValidationReport
#include <ValidationReport.h>

ValidationReport contains a list of issues that is reported by ramses::RamsesObject::validate().

Public Functions

ValidationReport()

Creates an empty report.

~ValidationReport()

Destructor.

ValidationReport(const ValidationReport &other)

Deleted copy constructor.

ValidationReport(ValidationReport &&other) noexcept

Move constructor.

Parameters:

other – source to move from

ValidationReport &operator=(const ValidationReport &other)

Deleted copy assignment.

ValidationReport &operator=(ValidationReport &&other) noexcept

Move assignment.

Parameters:

other – source to move from

Returns:

this instance

void clear()

Erases all issues from the report. After this call getIssues() returns an empty vector.

bool hasError() const

Checks whether the report contains an issue that is qualified as an error.

Returns:

true if the report contains an error, false otherwise

bool hasIssue() const

Checks whether the report contains any issues (warnings or errors)

Returns:

true if the report contains any error or warning, false otherwise

const std::vector<Issue> &getIssues() const

Gets all reported issues.

Returns:

vector of issues

internal::ValidationReportImpl &impl()

Get the internal implementation

const internal::ValidationReportImpl &impl() const

Get the internal implementation