![]() |
RAMSES Documentation
27.0.130
Information for RAMSES users and developers
|
The Scene holds a scene graph. It is the essential class for distributing content to the ramses system. More...
#include <Scene.h>
Public Member Functions | |
status_t | publish (EScenePublicationMode publicationMode=EScenePublicationMode_LocalAndRemote) |
Publishes the scene to the ramses system. More... | |
status_t | unpublish () |
Unpublish the scene from the ramses system. More... | |
bool | isPublished () const |
Returns whether scene is currently published to the ramses system. More... | |
sceneId_t | getSceneId () const |
Returns scene id defined at scene creation time. More... | |
status_t | saveToFile (const char *fileName, bool compress) const |
Saves all scene contents to a file. More... | |
PerspectiveCamera * | createPerspectiveCamera (const char *name=nullptr) |
Creates a Perspective Camera in this Scene. More... | |
OrthographicCamera * | createOrthographicCamera (const char *name=nullptr) |
Creates a Orthographic Camera in this Scene. More... | |
Appearance * | createAppearance (const Effect &effect, const char *name=nullptr) |
Creates a new Appearance. More... | |
GeometryBinding * | createGeometryBinding (const Effect &effect, const char *name=nullptr) |
Creates a new GeometryBinding. More... | |
StreamTexture * | createStreamTexture (const Texture2D &fallbackTexture, waylandIviSurfaceId_t source, const char *name=nullptr) |
Create a Stream Texture. More... | |
Node * | createNode (const char *name=nullptr) |
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. More... | |
MeshNode * | createMeshNode (const char *name=nullptr) |
Creates a scene graph MeshNode. MeshNode is a Node with additional properties and bindings that represent a renderable geometry with appearance. More... | |
status_t | 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. More... | |
status_t | setExpirationTimestamp (uint64_t ptpExpirationTimestampInMilliseconds) |
Expiration timestamp is a point in time till which the scene is considered to be up-to-date. More... | |
status_t | flush (sceneVersionTag_t sceneVersionTag=InvalidSceneVersionTag) |
Commits all changes done to the scene since the last flush or since scene creation. This makes a new valid scene state available to all local and remote renderers. More... | |
status_t | 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. More... | |
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. More... | |
const RamsesObject * | findObjectByName (const char *name) const |
Get an object from the scene by name. More... | |
RamsesObject * | findObjectByName (const char *name) |
Get an object from the scene by name. More... | |
const SceneObject * | findObjectById (sceneObjectId_t id) const |
Get an object from the scene by id. More... | |
SceneObject * | findObjectById (sceneObjectId_t id) |
Get an object from the scene by id. More... | |
RenderGroup * | createRenderGroup (const char *name=nullptr) |
Create a RenderGroup instance in the scene. More... | |
RenderPass * | createRenderPass (const char *name=nullptr) |
Create a render pass in the scene. More... | |
BlitPass * | createBlitPass (const RenderBuffer &sourceRenderBuffer, const RenderBuffer &destinationRenderBuffer, const char *name=nullptr) |
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. More... | |
RenderBuffer * | createRenderBuffer (uint32_t width, uint32_t height, ERenderBufferType bufferType, ERenderBufferFormat bufferFormat, ERenderBufferAccessMode accessMode, uint32_t sampleCount=0u, const char *name=nullptr) |
Create a RenderBuffer to be used with RenderTarget for rendering into and TextureSampler for sampling from. More... | |
PickableObject * | createPickableObject (const ArrayBuffer &geometryBuffer, const pickableObjectId_t id, const char *name=nullptr) |
Create a PickableObject. More... | |
RenderTarget * | createRenderTarget (const RenderTargetDescription &rtDesc, const char *name=nullptr) |
Create a render target providing a set of RenderBuffers. More... | |
TextureSampler * | createTextureSampler (ETextureAddressMode wrapUMode, ETextureAddressMode wrapVMode, ETextureSamplingMethod minSamplingMethod, ETextureSamplingMethod magSamplingMethod, const Texture2D &texture, uint32_t anisotropyLevel=1, const char *name=nullptr) |
Creates a texture sampler object. More... | |
TextureSampler * | createTextureSampler (ETextureAddressMode wrapUMode, ETextureAddressMode wrapVMode, ETextureAddressMode wrapRMode, ETextureSamplingMethod minSamplingMethod, ETextureSamplingMethod magSamplingMethod, const Texture3D &texture, const char *name=nullptr) |
Creates a texture sampler object. More... | |
TextureSampler * | createTextureSampler (ETextureAddressMode wrapUMode, ETextureAddressMode wrapVMode, ETextureSamplingMethod minSamplingMethod, ETextureSamplingMethod magSamplingMethod, const TextureCube &texture, uint32_t anisotropyLevel=1, const char *name=nullptr) |
Creates a texture sampler object. More... | |
TextureSampler * | createTextureSampler (ETextureAddressMode wrapUMode, ETextureAddressMode wrapVMode, ETextureSamplingMethod minSamplingMethod, ETextureSamplingMethod magSamplingMethod, const RenderBuffer &renderBuffer, uint32_t anisotropyLevel=1, const char *name=nullptr) |
Creates a texture sampler object. More... | |
TextureSampler * | createTextureSampler (ETextureAddressMode wrapUMode, ETextureAddressMode wrapVMode, ETextureSamplingMethod minSamplingMethod, ETextureSamplingMethod magSamplingMethod, const Texture2DBuffer &texture2DBuffer, uint32_t anisotropyLevel=1, const char *name=nullptr) |
Creates a texture sampler object for mutable texture. More... | |
TextureSampler * | createTextureSampler (ETextureAddressMode wrapUMode, ETextureAddressMode wrapVMode, ETextureSamplingMethod minSamplingMethod, ETextureSamplingMethod magSamplingMethod, const StreamTexture &streamTexture, const char *name=nullptr) |
Creates a texture sampler object. More... | |
TextureSamplerMS * | createTextureSamplerMS (const RenderBuffer &renderBuffer, const char *name) |
Creates a multisampled texture sampler object. More... | |
TextureSamplerExternal * | createTextureSamplerExternal (ETextureSamplingMethod minSamplingMethod, ETextureSamplingMethod magSamplingMethod, const char *name=nullptr) |
Creates a texture sampler object that can sample from external textures. More... | |
ArrayResource * | createArrayResource (EDataType type, uint32_t numElements, const void *arrayData, resourceCacheFlag_t cacheFlag=ResourceCacheFlag_DoNotCache, const char *name=nullptr) |
Create a new ArrayResource. It makes a copy of the given data of a certain type as a resource, an immutable data object. See ramses::ArrayResource for more details. More... | |
Texture2D * | createTexture2D (ETextureFormat format, uint32_t width, uint32_t height, uint32_t mipMapCount, const MipLevelData mipLevelData[], bool generateMipChain=false, const TextureSwizzle &swizzle={}, resourceCacheFlag_t cacheFlag=ResourceCacheFlag_DoNotCache, const char *name=nullptr) |
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. More... | |
Texture3D * | createTexture3D (ETextureFormat format, uint32_t width, uint32_t height, uint32_t depth, uint32_t mipMapCount, const MipLevelData mipLevelData[], bool generateMipChain=false, resourceCacheFlag_t cacheFlag=ResourceCacheFlag_DoNotCache, const char *name=nullptr) |
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. More... | |
TextureCube * | createTextureCube (ETextureFormat format, uint32_t size, uint32_t mipMapCount, const CubeMipLevelData mipLevelData[], bool generateMipChain=false, const TextureSwizzle &swizzle={}, resourceCacheFlag_t cacheFlag=ResourceCacheFlag_DoNotCache, const char *name=nullptr) |
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. More... | |
Effect * | createEffect (const EffectDescription &effectDesc, resourceCacheFlag_t cacheFlag=ResourceCacheFlag_DoNotCache, const char *name=nullptr) |
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. More... | |
std::string | getLastEffectErrorMessages () const |
Get the GLSL error messages that were produced at the creation of the last Effect. More... | |
ArrayBuffer * | createArrayBuffer (EDataType dataType, uint32_t maxNumElements, const char *name=nullptr) |
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::GeometryBinding. More... | |
Texture2DBuffer * | createTexture2DBuffer (ETextureFormat textureFormat, uint32_t width, uint32_t height, uint32_t mipLevelCount, const char *name=nullptr) |
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. More... | |
DataFloat * | createDataFloat (const char *name=nullptr) |
Creates a data object within the scene, which holds a data value of type float. More... | |
DataVector2f * | createDataVector2f (const char *name=nullptr) |
Creates a data object within the scene, which holds a data value of type Vector2f. More... | |
DataVector3f * | createDataVector3f (const char *name=nullptr) |
Creates a data object within the scene, which holds a data value of type Vector3f. More... | |
DataVector4f * | createDataVector4f (const char *name=nullptr) |
Creates a data object within the scene, which holds a data value of type Vector4f. More... | |
DataMatrix22f * | createDataMatrix22f (const char *name=nullptr) |
Creates a data object within the scene, which holds a data value of type Matrix22f. More... | |
DataMatrix33f * | createDataMatrix33f (const char *name=nullptr) |
Creates a data object within the scene, which holds a data value of type Matrix33f. More... | |
DataMatrix44f * | createDataMatrix44f (const char *name=nullptr) |
Creates a data object within the scene, which holds a data value of type Matrix44f. More... | |
DataInt32 * | createDataInt32 (const char *name=nullptr) |
Creates a data object within the scene, which holds a data value of type int32. More... | |
DataVector2i * | createDataVector2i (const char *name=nullptr) |
Creates a data object within the scene, which holds a data value of type Vector2i. More... | |
DataVector3i * | createDataVector3i (const char *name=nullptr) |
Creates a data object within the scene, which holds a data value of type Vector3i. More... | |
DataVector4i * | createDataVector4i (const char *name=nullptr) |
Creates a data object within the scene, which holds a data value of type Vector4i. More... | |
status_t | 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. More... | |
status_t | 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. More... | |
status_t | 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. More... | |
status_t | 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. More... | |
status_t | 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. More... | |
status_t | 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. More... | |
status_t | 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. More... | |
status_t | 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. More... | |
status_t | 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. More... | |
AnimationSystem * | createAnimationSystem (uint32_t flags=EAnimationSystemFlags_Default, const char *name=nullptr) |
Create a new animation system. The animation system will be updated on renderer side after calls to AnimationSystem::setTime(). The animation system is not automatically updated on client side. If live updates of animated values are needed on client side, provide the creation flag EAnimationSystemFlags_ClientSideProcessing. Calls to AnimationSystem::setTime() then also update the animation systems client side state. More... | |
AnimationSystemRealTime * | createRealTimeAnimationSystem (uint32_t flags=EAnimationSystemFlags_Default, const char *name=nullptr) |
Create a new animation system that is designed to work with system time. The animation system will be updated automatically every frame on renderer side using its system time. The animation system is not automatically updated on client side. If live updates of animated values are needed on client side, provide the creation flag EAnimationSystemFlags_ClientSideProcessing, and make sure to call AnimationSystem::updateLocalTime() before accessing any values. Calls to AnimationSystem::updateLocalTime() are also mandatory before any client side changes to the state of the animation system. More... | |
SceneReference * | createSceneReference (sceneId_t referencedScene, const char *name=nullptr) |
Creates a new SceneReference object. More... | |
status_t | 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. More... | |
status_t | unlinkData (SceneReference *consumerReference, dataConsumerId_t consumerId) |
Removes an existing link between two scenes (see ramses::Scene::linkData). More... | |
RamsesClient & | getRamsesClient () |
Getter for ramses::RamsesClient this Scene was created from. More... | |
const Resource * | getResource (resourceId_t id) const |
Get a resource which is owned by the scene by id. More... | |
Resource * | getResource (resourceId_t id) |
Get a resource which is owned by the scene by id. More... | |
![]() | |
const char * | getName () const |
Returns the name of the object. More... | |
status_t | setName (const char *name) |
Changes the name of the object. More... | |
ERamsesObjectType | getType () const |
Gets type of the object. More... | |
bool | isOfType (ERamsesObjectType type) const |
Checks if the object is of given type. More... | |
![]() | |
status_t | validate () const |
Generates verbose validation of the object. More... | |
const char * | getValidationReport (EValidationSeverity minSeverity=EValidationSeverity_Info) const |
Provides verbose report in human readable form generated by validate. More... | |
const char * | getStatusMessage (status_t status) const |
Get the string description for a status provided by a RAMSES API function. More... | |
StatusObject (const StatusObject &other)=delete | |
Deleted copy constructor. More... | |
StatusObject & | operator= (const StatusObject &other)=delete |
Deleted copy assignment. More... | |
Public Attributes | |
SceneImpl & | impl |
![]() | |
class ClientObjectImpl & | impl |
![]() | |
class RamsesObjectImpl & | impl |
![]() | |
class StatusObjectImpl & | impl |
Protected Member Functions | |
Scene (SceneImpl &pimpl) | |
Constructor of the Scene. More... | |
Scene (const Scene &other) | |
Copy constructor of Scene. More... | |
Scene & | operator= (const Scene &other) |
Assignment operator of Scene. More... | |
virtual | ~Scene () |
Destructor of the Scene. More... | |
![]() | |
ClientObject (ClientObjectImpl &pimpl) | |
Constructor for ClientObject. More... | |
virtual | ~ClientObject () |
Destructor of the ClientObject. More... | |
![]() | |
RamsesObject (RamsesObjectImpl &pimpl) | |
Constructor for RamsesObject. More... | |
virtual | ~RamsesObject () |
Destructor of the RamsesObject. More... | |
![]() | |
StatusObject (StatusObjectImpl &pimpl) | |
Constructor for StatusObject. More... | |
virtual | ~StatusObject () |
Destructor of the StatusObject. More... | |
Friends | |
class | RamsesClientImpl |
RamsesClient is the factory for creating Scene instances. More... | |
The Scene holds a scene graph. It is the essential class for distributing content to the ramses system.
|
explicitprotected |
|
protected |
|
protectedvirtual |
Destructor of the Scene.
AnimationSystem* ramses::Scene::createAnimationSystem | ( | uint32_t | flags = EAnimationSystemFlags_Default , |
const char * | name = nullptr |
||
) |
Create a new animation system. The animation system will be updated on renderer side after calls to AnimationSystem::setTime(). The animation system is not automatically updated on client side. If live updates of animated values are needed on client side, provide the creation flag EAnimationSystemFlags_ClientSideProcessing. Calls to AnimationSystem::setTime() then also update the animation systems client side state.
[in] | flags | Optional creation flags for the animation system. |
[in] | name | The optional name of the created animation system. |
Appearance* ramses::Scene::createAppearance | ( | const Effect & | effect, |
const char * | name = nullptr |
||
) |
Creates a new Appearance.
[in] | effect | The effect from which this appearance takes its parameters |
[in] | name | The optional name of the created Appearance. |
ArrayBuffer* ramses::Scene::createArrayBuffer | ( | EDataType | dataType, |
uint32_t | maxNumElements, | ||
const char * | name = nullptr |
||
) |
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::GeometryBinding.
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.
[in] | dataType | Data type of the array data. |
[in] | maxNumElements | The maximum number of data elements this buffer can hold. |
[in] | name | The optional name of the created array buffer. |
ArrayResource* ramses::Scene::createArrayResource | ( | EDataType | type, |
uint32_t | numElements, | ||
const void * | arrayData, | ||
resourceCacheFlag_t | cacheFlag = ResourceCacheFlag_DoNotCache , |
||
const char * | name = nullptr |
||
) |
Create a new ArrayResource. It makes a copy of the given data of a certain type as a resource, an immutable data object. See ramses::ArrayResource for more details.
If an ramses::ArrayResource object is created with type 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.
[in] | type | The data type of the array elements. |
[in] | numElements | The number of elements of the given data type to use for the resource. |
[in] | arrayData | Pointer to the data to be used to create the array from. |
[in] | cacheFlag | The optional flag sent to the renderer. The value describes how the cache implementation should handle the resource. |
[in] | name | The optional name of the ArrayResource. |
BlitPass* ramses::Scene::createBlitPass | ( | const RenderBuffer & | sourceRenderBuffer, |
const RenderBuffer & | destinationRenderBuffer, | ||
const char * | name = nullptr |
||
) |
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.
[in] | sourceRenderBuffer | Render buffer used as source to blit from |
[in] | destinationRenderBuffer | Render buffer used as destination to blit to |
[in] | name | The optional name of the created blit pass. |
status_t ramses::Scene::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.
[in] | dataObject | which shall consume data from another DataObject. |
[in] | dataId | id to reference the consumer in this scene |
DataFloat* ramses::Scene::createDataFloat | ( | const char * | name = nullptr | ) |
Creates a data object within the scene, which holds a data value of type float.
[in] | name | optional name of the object. |
DataInt32* ramses::Scene::createDataInt32 | ( | const char * | name = nullptr | ) |
Creates a data object within the scene, which holds a data value of type int32.
[in] | name | optional name of the object. |
DataMatrix22f* ramses::Scene::createDataMatrix22f | ( | const char * | name = nullptr | ) |
Creates a data object within the scene, which holds a data value of type Matrix22f.
[in] | name | optional name of the object. |
DataMatrix33f* ramses::Scene::createDataMatrix33f | ( | const char * | name = nullptr | ) |
Creates a data object within the scene, which holds a data value of type Matrix33f.
[in] | name | optional name of the object. |
DataMatrix44f* ramses::Scene::createDataMatrix44f | ( | const char * | name = nullptr | ) |
Creates a data object within the scene, which holds a data value of type Matrix44f.
[in] | name | optional name of the object. |
status_t ramses::Scene::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.
[in] | dataObject | from which data shall be provided. |
[in] | dataId | id to reference the provider in this scene |
DataVector2f* ramses::Scene::createDataVector2f | ( | const char * | name = nullptr | ) |
Creates a data object within the scene, which holds a data value of type Vector2f.
[in] | name | optional name of the object. |
DataVector2i* ramses::Scene::createDataVector2i | ( | const char * | name = nullptr | ) |
Creates a data object within the scene, which holds a data value of type Vector2i.
[in] | name | optional name of the object. |
DataVector3f* ramses::Scene::createDataVector3f | ( | const char * | name = nullptr | ) |
Creates a data object within the scene, which holds a data value of type Vector3f.
[in] | name | optional name of the object. |
DataVector3i* ramses::Scene::createDataVector3i | ( | const char * | name = nullptr | ) |
Creates a data object within the scene, which holds a data value of type Vector3i.
[in] | name | optional name of the object. |
DataVector4f* ramses::Scene::createDataVector4f | ( | const char * | name = nullptr | ) |
Creates a data object within the scene, which holds a data value of type Vector4f.
[in] | name | optional name of the object. |
DataVector4i* ramses::Scene::createDataVector4i | ( | const char * | name = nullptr | ) |
Creates a data object within the scene, which holds a data value of type Vector4i.
[in] | name | optional name of the object. |
Effect* ramses::Scene::createEffect | ( | const EffectDescription & | effectDesc, |
resourceCacheFlag_t | cacheFlag = ResourceCacheFlag_DoNotCache , |
||
const char * | name = nullptr |
||
) |
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.
[in] | effectDesc | Effect description. |
[in] | cacheFlag | The optional flag sent to the renderer. The value describes how the cache implementation should handle the resource. |
[in] | name | The name of the created Effect. |
GeometryBinding* ramses::Scene::createGeometryBinding | ( | const Effect & | effect, |
const char * | name = nullptr |
||
) |
Creates a new GeometryBinding.
[in] | effect | The effect which is used to create the GeometryBinding. |
[in] | name | The optional name of the created GeometryBinding. |
MeshNode* ramses::Scene::createMeshNode | ( | const char * | name = nullptr | ) |
Creates a scene graph MeshNode. MeshNode is a Node with additional properties and bindings that represent a renderable geometry with appearance.
[in] | name | The optional name of the MeshNode. |
Node* ramses::Scene::createNode | ( | const char * | name = nullptr | ) |
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.
[in] | name | Optional name of the object. |
OrthographicCamera* ramses::Scene::createOrthographicCamera | ( | const char * | name = nullptr | ) |
Creates a Orthographic Camera in this Scene.
[in] | name | The optional name of the Camera |
PerspectiveCamera* ramses::Scene::createPerspectiveCamera | ( | const char * | name = nullptr | ) |
Creates a Perspective Camera in this Scene.
[in] | name | The optional name of the Camera |
PickableObject* ramses::Scene::createPickableObject | ( | const ArrayBuffer & | geometryBuffer, |
const pickableObjectId_t | id, | ||
const char * | name = nullptr |
||
) |
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.
[in] | geometryBuffer | Vertex buffer containing triangles defining geometry of PickableObject. |
[in] | id | User ID assigned to PickableObject, it will be used in callback ramses::IRendererEventHandler::objectsPicked when this PickableObject is picked. |
[in] | name | Name of the PickableObject. |
AnimationSystemRealTime* ramses::Scene::createRealTimeAnimationSystem | ( | uint32_t | flags = EAnimationSystemFlags_Default , |
const char * | name = nullptr |
||
) |
Create a new animation system that is designed to work with system time. The animation system will be updated automatically every frame on renderer side using its system time. The animation system is not automatically updated on client side. If live updates of animated values are needed on client side, provide the creation flag EAnimationSystemFlags_ClientSideProcessing, and make sure to call AnimationSystem::updateLocalTime() before accessing any values. Calls to AnimationSystem::updateLocalTime() are also mandatory before any client side changes to the state of the animation system.
[in] | flags | Optional creation flags for the animation system. |
[in] | name | The optional name of the created animation system. |
RenderBuffer* ramses::Scene::createRenderBuffer | ( | uint32_t | width, |
uint32_t | height, | ||
ERenderBufferType | bufferType, | ||
ERenderBufferFormat | bufferFormat, | ||
ERenderBufferAccessMode | accessMode, | ||
uint32_t | sampleCount = 0u , |
||
const char * | name = nullptr |
||
) |
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).
[in] | width | The width of the RenderBuffer in pixel. |
[in] | height | The height of the RenderBuffer in pixel. |
[in] | bufferType | Type of the RenderBuffer to be created (color, depth, depth/stecil). |
[in] | bufferFormat | Data format to use for the RenderBuffer to be created. |
[in] | accessMode | Read/Write access mode of render buffer |
[in] | sampleCount | Optional sample count for MSAA number of samples. Default value is 0 for no MSAA. |
[in] | name | Optional name of the object. |
RenderGroup* ramses::Scene::createRenderGroup | ( | const char * | name = nullptr | ) |
Create a RenderGroup instance in the scene.
[in] | name | The optional name of the created RenderGroup instance. |
RenderPass* ramses::Scene::createRenderPass | ( | const char * | name = nullptr | ) |
Create a render pass in the scene.
[in] | name | The optional name of the created render pass. |
RenderTarget* ramses::Scene::createRenderTarget | ( | const RenderTargetDescription & | rtDesc, |
const char * | name = nullptr |
||
) |
Create a render target providing a set of RenderBuffers.
[in] | rtDesc | Instance of RenderTargetDescription holding all information needed to create a RenderTarget. |
[in] | name | Optional name of the object. |
SceneReference* ramses::Scene::createSceneReference | ( | sceneId_t | referencedScene, |
const char * | name = nullptr |
||
) |
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.
[in] | referencedScene | A scene id of a scene known to the RamsesRenderer. |
[in] | name | The optional name of the created SceneReference. |
StreamTexture* ramses::Scene::createStreamTexture | ( | const Texture2D & | fallbackTexture, |
waylandIviSurfaceId_t | source, | ||
const char * | name = nullptr |
||
) |
Create a Stream Texture.
[in] | fallbackTexture | Texture2D used as a fallback texture. |
[in] | source | Stream source identifier |
[in] | name | The name of the Stream Texture. |
Texture2D* ramses::Scene::createTexture2D | ( | ETextureFormat | format, |
uint32_t | width, | ||
uint32_t | height, | ||
uint32_t | mipMapCount, | ||
const MipLevelData | mipLevelData[], | ||
bool | generateMipChain = false , |
||
const TextureSwizzle & | swizzle = {} , |
||
resourceCacheFlag_t | cacheFlag = ResourceCacheFlag_DoNotCache , |
||
const char * | name = nullptr |
||
) |
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.
[in] | format | Pixel format of the Texture2D data. |
[in] | width | Width of the texture (mipmap level 0). |
[in] | height | Height of the texture (mipmap level 0). |
[in] | mipMapCount | Number of mipmap levels contained in mipLevelData array. |
[in] | mipLevelData | Array 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). |
[in] | swizzle | 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. |
[in] | generateMipChain | Auto generate mipmap levels. Cannot be used if custom data for lower mipmap levels provided. |
[in] | cacheFlag | The optional flag sent to the renderer. The value describes how the cache implementation should handle the resource. |
[in] | name | The name of the Texture2D. |
Texture2DBuffer* ramses::Scene::createTexture2DBuffer | ( | ETextureFormat | textureFormat, |
uint32_t | width, | ||
uint32_t | height, | ||
uint32_t | mipLevelCount, | ||
const char * | name = nullptr |
||
) |
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.
[in] | textureFormat | texture format. Only uncompressed texture formats are supported |
[in] | width | width of the first and largest mipmap level. |
[in] | height | height of the first and largest mipmap level. |
[in] | mipLevelCount | Number of mipmap levels created for the Texture2DBuffer. |
[in] | name | The optional name of the created Texture2DBuffer. |
Texture3D* ramses::Scene::createTexture3D | ( | ETextureFormat | format, |
uint32_t | width, | ||
uint32_t | height, | ||
uint32_t | depth, | ||
uint32_t | mipMapCount, | ||
const MipLevelData | mipLevelData[], | ||
bool | generateMipChain = false , |
||
resourceCacheFlag_t | cacheFlag = ResourceCacheFlag_DoNotCache , |
||
const char * | name = nullptr |
||
) |
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.
[in] | format | Pixel format of the Texture3D data. |
[in] | width | Width of the texture (mipmap level 0). |
[in] | height | Height of the texture (mipmap level 0). |
[in] | depth | Depth of the texture. |
[in] | mipMapCount | Number of mipmap levels contained in mipLevelData array. |
[in] | mipLevelData | Array 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). |
[in] | generateMipChain | Auto generate mipmap levels. Cannot be used if custom data for lower mipmap levels provided. |
[in] | cacheFlag | The optional flag sent to the renderer. The value describes how the cache implementation should handle the resource. |
[in] | name | The name of the Texture3D. |
status_t ramses::Scene::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.
[in] | sampler | which shall consume texture content from provider texture. |
[in] | dataId | id to reference the consumer in this scene |
status_t ramses::Scene::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).
[in] | sampler | which shall consume texture content from provider texture. |
[in] | dataId | id to reference the consumer in this scene |
status_t ramses::Scene::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.
[in] | sampler | which shall consume texture content from provider texture. |
[in] | dataId | id to reference the consumer in this scene |
TextureCube* ramses::Scene::createTextureCube | ( | ETextureFormat | format, |
uint32_t | size, | ||
uint32_t | mipMapCount, | ||
const CubeMipLevelData | mipLevelData[], | ||
bool | generateMipChain = false , |
||
const TextureSwizzle & | swizzle = {} , |
||
resourceCacheFlag_t | cacheFlag = ResourceCacheFlag_DoNotCache , |
||
const char * | name = nullptr |
||
) |
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.
[in] | format | Pixel format of the Cube Texture data. |
[in] | size | edge length of one quadratic cube face, belonging to the texture. |
[in] | mipMapCount | Number of mipmaps contained in mipLevelData array. |
[in] | mipLevelData | Array 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). |
[in] | generateMipChain | Auto generate mipmap levels. Cannot be used if custom data for lower mipmap levels provided. |
[in] | swizzle | Describes how RGBA channels of the texture are swizzled, |
[in] | cacheFlag | The optional flag sent to the renderer. The value describes how the cache implementation should handle the resource. |
[in] | name | The name of the Cube Texture. |
status_t ramses::Scene::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.
[in] | texture | from which content shall be provided. |
[in] | dataId | id to reference the provider in this scene |
TextureSampler* ramses::Scene::createTextureSampler | ( | ETextureAddressMode | wrapUMode, |
ETextureAddressMode | wrapVMode, | ||
ETextureAddressMode | wrapRMode, | ||
ETextureSamplingMethod | minSamplingMethod, | ||
ETextureSamplingMethod | magSamplingMethod, | ||
const Texture3D & | texture, | ||
const char * | name = nullptr |
||
) |
Creates a texture sampler object.
[in] | wrapUMode | texture wrap mode for u axis. |
[in] | wrapVMode | texture wrap mode for v axis. |
[in] | wrapRMode | texture wrap mode for r axis. |
[in] | minSamplingMethod | texture min sampling method. |
[in] | magSamplingMethod | texture mag sampling method. Must be set to either Nearest or Linear. |
[in] | texture | Texture to be used with this sampler object. |
[in] | name | Optional name of the object. |
TextureSampler* ramses::Scene::createTextureSampler | ( | ETextureAddressMode | wrapUMode, |
ETextureAddressMode | wrapVMode, | ||
ETextureSamplingMethod | minSamplingMethod, | ||
ETextureSamplingMethod | magSamplingMethod, | ||
const RenderBuffer & | renderBuffer, | ||
uint32_t | anisotropyLevel = 1 , |
||
const char * | name = nullptr |
||
) |
Creates a texture sampler object.
[in] | wrapUMode | texture wrap mode for u axis. |
[in] | wrapVMode | texture wrap mode for v axis. |
[in] | minSamplingMethod | texture min sampling method. |
[in] | magSamplingMethod | texture mag sampling method. Must be set to either Nearest or Linear. |
[in] | renderBuffer | RenderBuffer to be used with this sampler object. The render buffer must have access mode of read/write and 0 samples (ramses::RenderBuffer::getSampleCount). |
[in] | anisotropyLevel | Texture sampling anisotropy level. 1: isotropic sampling, >1: anisotropic sampling usual values: 1, 2, 4, 8, 16 (dependent on graphics platform) |
[in] | name | Optional name of the object. |
TextureSampler* ramses::Scene::createTextureSampler | ( | ETextureAddressMode | wrapUMode, |
ETextureAddressMode | wrapVMode, | ||
ETextureSamplingMethod | minSamplingMethod, | ||
ETextureSamplingMethod | magSamplingMethod, | ||
const StreamTexture & | streamTexture, | ||
const char * | name = nullptr |
||
) |
Creates a texture sampler object.
[in] | wrapUMode | texture wrap mode for u axis. |
[in] | wrapVMode | texture wrap mode for v axis. |
[in] | minSamplingMethod | texture min sampling method. |
[in] | magSamplingMethod | texture mag sampling method. Must be set to either Nearest or Linear. |
[in] | streamTexture | StreamTexture to be used with this sampler object. |
[in] | name | Optional name of the object. |
TextureSampler* ramses::Scene::createTextureSampler | ( | ETextureAddressMode | wrapUMode, |
ETextureAddressMode | wrapVMode, | ||
ETextureSamplingMethod | minSamplingMethod, | ||
ETextureSamplingMethod | magSamplingMethod, | ||
const Texture2D & | texture, | ||
uint32_t | anisotropyLevel = 1 , |
||
const char * | name = nullptr |
||
) |
Creates a texture sampler object.
[in] | wrapUMode | texture wrap mode for u axis. |
[in] | wrapVMode | texture wrap mode for v axis. |
[in] | minSamplingMethod | texture min sampling method. |
[in] | magSamplingMethod | texture mag sampling method. Must be set to either Nearest or Linear. |
[in] | texture | Texture to be used with this sampler object. |
[in] | anisotropyLevel | Texture sampling anisotropy level. 1: isotropic sampling, >1: anisotropic sampling usual values: 1, 2, 4, 8, 16 (depending on graphics platform) |
[in] | name | Optional name of the object. |
TextureSampler* ramses::Scene::createTextureSampler | ( | ETextureAddressMode | wrapUMode, |
ETextureAddressMode | wrapVMode, | ||
ETextureSamplingMethod | minSamplingMethod, | ||
ETextureSamplingMethod | magSamplingMethod, | ||
const Texture2DBuffer & | texture2DBuffer, | ||
uint32_t | anisotropyLevel = 1 , |
||
const char * | name = nullptr |
||
) |
Creates a texture sampler object for mutable texture.
[in] | wrapUMode | texture wrap mode for u axis. |
[in] | wrapVMode | texture wrap mode for v axis. |
[in] | minSamplingMethod | texture min sampling method. |
[in] | magSamplingMethod | texture mag sampling method. Must be set to either Nearest or Linear. |
[in] | texture2DBuffer | Texture2DBuffer to be used with this sampler object. |
[in] | anisotropyLevel | Texture sampling anisotropy level. 1: isotropic sampling, >1: anisotropic sampling usual values: 1, 2, 4, 8, 16 (dependent on graphics platform) |
[in] | name | Optional name of the object. |
TextureSampler* ramses::Scene::createTextureSampler | ( | ETextureAddressMode | wrapUMode, |
ETextureAddressMode | wrapVMode, | ||
ETextureSamplingMethod | minSamplingMethod, | ||
ETextureSamplingMethod | magSamplingMethod, | ||
const TextureCube & | texture, | ||
uint32_t | anisotropyLevel = 1 , |
||
const char * | name = nullptr |
||
) |
Creates a texture sampler object.
[in] | wrapUMode | texture wrap mode for u axis. |
[in] | wrapVMode | texture wrap mode for v axis. |
[in] | minSamplingMethod | texture min sampling method. |
[in] | magSamplingMethod | texture mag sampling method. Must be set to either Nearest or Linear. |
[in] | texture | Texture to be used with this sampler object. |
[in] | anisotropyLevel | Texture sampling anisotropy level. 1: isotropic sampling, >1: anisotropic sampling usual values: 1, 2, 4, 8, 16 (dependent on graphics platform) |
[in] | name | Optional name of the object. |
TextureSamplerExternal* ramses::Scene::createTextureSamplerExternal | ( | ETextureSamplingMethod | minSamplingMethod, |
ETextureSamplingMethod | magSamplingMethod, | ||
const char * | name = nullptr |
||
) |
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.
[in] | minSamplingMethod | texture min sampling method. Must be set to either Nearest or Linear. |
[in] | magSamplingMethod | texture mag sampling method. Must be set to either Nearest or Linear. |
[in] | name | Optional name of the object. |
TextureSamplerMS* ramses::Scene::createTextureSamplerMS | ( | const RenderBuffer & | renderBuffer, |
const char * | name | ||
) |
Creates a multisampled texture sampler object.
[in] | renderBuffer | RenderBuffer to be used with this sampler object. The render buffer must be multisampled and have access mode of read/write. |
[in] | name | Optional name of the object. |
status_t ramses::Scene::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.
[in] | node | which shall consume data from another node. |
[in] | dataId | id to reference the consumer node in this scene |
status_t ramses::Scene::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.
[in] | node | from which transformation data shall be provided. |
[in] | dataId | id to reference the provider node in this scene |
status_t ramses::Scene::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.
object | The object of the Scene to destroy |
SceneObject* ramses::Scene::findObjectById | ( | sceneObjectId_t | id | ) |
Get an object from the scene by id.
[in] | id | The id of the object to get. |
const SceneObject* ramses::Scene::findObjectById | ( | sceneObjectId_t | id | ) | const |
Get an object from the scene by id.
[in] | id | The id of the object to get. |
RamsesObject* ramses::Scene::findObjectByName | ( | const char * | name | ) |
Get an object from the scene by name.
[in] | name | The name of the object to get. |
const RamsesObject* ramses::Scene::findObjectByName | ( | const char * | name | ) | const |
Get an object from the scene by name.
[in] | name | The name of the object to get. |
status_t ramses::Scene::flush | ( | sceneVersionTag_t | sceneVersionTag = InvalidSceneVersionTag | ) |
Commits all changes done to the scene since the last flush or since scene creation. This makes a new valid scene state available to all local and remote renderers.
[in] | sceneVersionTag | 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. |
std::string ramses::Scene::getLastEffectErrorMessages | ( | ) | const |
Get the GLSL error messages that were produced at the creation of the last Effect.
RamsesClient& ramses::Scene::getRamsesClient | ( | ) |
Getter for ramses::RamsesClient this Scene was created from.
Resource* ramses::Scene::getResource | ( | resourceId_t | id | ) |
Get a resource which is owned by the scene by id.
[in] | id | The resource id of the resource to get. |
const Resource* ramses::Scene::getResource | ( | resourceId_t | id | ) | const |
Get a resource which is owned by the scene by id.
[in] | id | The resource id of the resource to get. |
sceneId_t ramses::Scene::getSceneId | ( | ) | const |
Returns scene id defined at scene creation time.
int32_t ramses::Scene::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.
bool ramses::Scene::isPublished | ( | ) | const |
Returns whether scene is currently published to the ramses system.
status_t ramses::Scene::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 StatusOK, 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.
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. |
status_t ramses::Scene::publish | ( | EScenePublicationMode | publicationMode = EScenePublicationMode_LocalAndRemote | ) |
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.
[in] | publicationMode | A flag to signal if a scene should be only available to local renderer(s) and not published outside of the client. By default, scene is published and everyone in the RAMSES world can subscribe to it |
status_t ramses::Scene::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.
status_t ramses::Scene::saveToFile | ( | const char * | fileName, |
bool | compress | ||
) | const |
Saves all scene contents to a file.
[in] | fileName | File name to save the scene to. |
[in] | compress | if set to true, resources might be compressed before saving otherwise, uncompressed data will be saved |
status_t ramses::Scene::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).
[in] | ptpExpirationTimestampInMilliseconds | Expiration timestamp in milliseconds from synchronized clock. To avoid issues, keep this up-to-date reasonably enough in future. |
status_t ramses::Scene::unlinkData | ( | SceneReference * | consumerReference, |
dataConsumerId_t | consumerId | ||
) |
Removes an existing link between two scenes (see ramses::Scene::linkData).
If the function returns StatusOK, 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.
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. |
status_t ramses::Scene::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.
status_t ramses::Scene::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.
[in] | texture | from which content shall be provided. |
[in] | dataId | id to reference the provider in this scene |
|
friend |
RamsesClient is the factory for creating Scene instances.
SceneImpl& ramses::Scene::impl |
Stores internal data for implementation specifics of Scene.