Umbra::View class

View into scenes.

Can be used to report either camera-visible assets for rendering or any assets within a volume for physics.

Public types

enum CullingMode { OcclusionCulling, FrustumCulling, None }

Constructors, destructors, conversion operators

~View() virtual

Public functions

void update(const CameraTransform& camera, float quality, CullingMode mode, const Float3* directionalLights, int numDirectionalLights) pure virtual
Update parameters for next frame.
void updateForPhysics(const CameraTransform& camera, int targetLodLevel, float radius) pure virtual
Set parameters for a physics frame.
void updateForPhysics(const CameraTransform& camera, int targetLodLevel, float cylinderRadius, const Float3& cylinderUpDir) pure virtual
Set parameters for a physics frame.
auto dataComplete() const -> bool pure virtual
True if all data needed for the desired quality was available during the last update.
void resetRenderables() pure virtual
Reset renderable iteration, next call to nextRenderables will return the first Renderable.
auto nextRenderables(Renderable* renderList, int size) -> int pure virtual
Get next batch of renderable.

Enum details

enum Umbra::View::CullingMode

Enumerators
OcclusionCulling

Use Umbra occlusion culling.

Slower but results in fewer meshes to render

FrustumCulling

Regular frustum culling, including shadow caster culling.

None

Level-of-detail remains active but no additional culling takes place.

Function details

void Umbra::View::update(const CameraTransform& camera, float quality, CullingMode mode, const Float3* directionalLights, int numDirectionalLights) pure virtual

Update parameters for next frame.

Parameters
camera View-Projection matrix
quality LOD quality (0: always use worst available, 0.5: regular, 1.0: always use best available). High values ( > 0.9 ) can result in very poor performance on large scenes.
mode Type of culling to use
directionalLights Array of light directions, needed for culling shadow casters
numDirectionalLights Number of light directions

Set view parameters for the next frame. This is a fairly light function with the majority of work deferred to getNextRenderables and Runtime::getNextAssetJob.

void Umbra::View::updateForPhysics(const CameraTransform& camera, int targetLodLevel, float radius) pure virtual

Set parameters for a physics frame.

Parameters
camera Center position for update volume. Other aspects are ignored
targetLodLevel Most detailed LOD level to return. Will only return less detailed LOD levels if the target level data is not loaded
radius Radius of sphere the contents of which should be reported as renderables

Instead of the normal camera update, update parameters for a physics frame. A physics frame will report all data within a volume at a given LOD as renderable. This can be used to query potential collision meshes around an area.

void Umbra::View::updateForPhysics(const CameraTransform& camera, int targetLodLevel, float cylinderRadius, const Float3& cylinderUpDir) pure virtual

Set parameters for a physics frame.

Parameters
camera Center position for update volume. Other aspects are ignored
targetLodLevel Most detailed LOD level to return. Will only return less detailed LOD levels if the target level data is not loaded
cylinderRadius Cylinder radius
cylinderUpDir Direction of primary axis of the cylinder. The cylinder has infinite length along this axis

As updateForPhysics(const CameraTransform&, int, float) but volume is specified as a cylinder with infinite length

bool Umbra::View::dataComplete() const pure virtual

True if all data needed for the desired quality was available during the last update.

Incomplete data appears as missing or low-detail blocks.

int Umbra::View::nextRenderables(Renderable* renderList, int size) pure virtual

Get next batch of renderable.

Parameters
renderList Destination array
size Maximum number of elements in renderList
Returns Number of elements written

Call repeatedly to receive all renderables.