View object

Classes

struct UmbraFilterShape
A structure containing the definition of filter shape.
struct UmbraRenderable
A structure containing the definition of renderable.
struct UmbraView
Opaque view object.

Enums

enum UmbraDepthRange { UmbraDepthRange_ZeroToOne = 0, UmbraDepthRange_MinusOneToOne }
An enumeration of depth range conventions.
enum UmbraFilterShapeType { UmbraFilterShapeType_Sphere = 0, UmbraFilterShapeType_Cylinder }
An enumeration of filter shape types.

Functions

UmbraView* UmbraViewCreate(UmbraRuntime* runtime)
Creates a view object.
void UmbraViewUpdateRendering(UmbraView* view, const UmbraFloat4_4* cameraWorldToClip, const UmbraFloat3* cameraPosition, UmbraDepthRange cameraDepthRange, UmbraMatrixFormat cameraMatrixFormat, float quality, const UmbraFloat3* directionalLights, int numDirectionalLights)
Updates the view object for rendering.
void UmbraViewUpdateFilter(UmbraView* view, const UmbraFilterShape* filterShape)
Updates the view object for filtering.
UmbraBool UmbraViewGetCompleted(const UmbraView* view)
int UmbraViewNextRenderables(UmbraView* view, UmbraRenderable* renderables, int numRenderables)
Returns the next set of renderables.
void UmbraViewResetRenderables(UmbraView* view)
Resets the state of UmbraViewNextRenderables, causing it to start from the first renderable.
void UmbraViewDestroy(UmbraView* view)
Destroys the view object.
UmbraBool UmbraViewRayQuery(UmbraView* view, const UmbraFloat3* rayOrigin, const UmbraFloat3* rayDirection, float maxDistance, UmbraRayQueryFlags flags, UmbraRayQueryResult* result)
Performs a ray query against a view object.

Enum details

enum UmbraDepthRange

An enumeration of depth range conventions.

Enumerators
UmbraDepthRange_ZeroToOne

The D3D convention, where the depth range is between [0,1] after the w division.

UmbraDepthRange_MinusOneToOne

The OpenGL convention, where the depth range is between [-1,1] after the w division.

enum UmbraFilterShapeType

An enumeration of filter shape types.

Enumerators
UmbraFilterShapeType_Sphere

Specifies the filter shape as a sphere, defined by the center and the radius.

UmbraFilterShapeType_Cylinder

Specifies the filter shape as a cylinder, defined by the direction and the radius.

Function details

UmbraView* UmbraViewCreate(UmbraRuntime* runtime)

Creates a view object.

Parameters
runtime in The runtime object used to create the view.
Returns The pointer to the opaque view object.

void UmbraViewUpdateRendering(UmbraView* view, const UmbraFloat4_4* cameraWorldToClip, const UmbraFloat3* cameraPosition, UmbraDepthRange cameraDepthRange, UmbraMatrixFormat cameraMatrixFormat, float quality, const UmbraFloat3* directionalLights, int numDirectionalLights)

Updates the view object for rendering.

Parameters
view in The view object whose rendering state to update.
cameraWorldToClip in The new camera world to clip space transform.
cameraPosition in The new camera position.
cameraDepthRange in The new camera depth range.
cameraMatrixFormat in The new camera matrix format used by the world to clip space transform.
quality in The new quality, between 0.0 (lowest quality) and 1.0 (highest quality). We recommend starting with 0.5 before further adjustments.
directionalLights in The new array of directional lights, or NULL if ignored.
numDirectionalLights in The number of directional lights in directionalLights array (up to 31), or 0 if ignored.

void UmbraViewUpdateFilter(UmbraView* view, const UmbraFilterShape* filterShape)

Updates the view object for filtering.

Parameters
view in The view object whose filter shape to update.
filterShape in The new filter shape.

int UmbraViewNextRenderables(UmbraView* view, UmbraRenderable* renderables, int numRenderables)

Returns the next set of renderables.

Parameters
view in The view object whose renderables to query.
renderables out Where to store the renderables.
numRenderables in The size of the renderables array.
Returns The number of renderables stored.

void UmbraViewResetRenderables(UmbraView* view)

Resets the state of UmbraViewNextRenderables, causing it to start from the first renderable.

Parameters
view in The view object whose renderables to reset.

void UmbraViewDestroy(UmbraView* view)

Destroys the view object.

Parameters
view in The view object to destroy.

UmbraBool UmbraViewRayQuery(UmbraView* view, const UmbraFloat3* rayOrigin, const UmbraFloat3* rayDirection, float maxDistance, UmbraRayQueryFlags flags, UmbraRayQueryResult* result)

Performs a ray query against a view object.

Parameters
view in The view object whose meshes are tested against the ray.
rayOrigin in The ray origin in world space.
rayDirection in The ray direction. Must be unit length.
maxDistance in The maximum distance in world space units. Can be FLT_MAX.
flags in The bitmask of UmbraRayQueryFlagBits specifying ray traversal behaviour. Can be 0.
result out Where to store the UmbraRayQueryResult structure, or NULL if ignored.
Returns Returns whether or not the ray query was successful.