Varjo Native Experimental SDK
Varjo_mr_experimental.h
Go to the documentation of this file.
1 // Copyright 2020-2021 Varjo Technologies Oy. All rights reserved.
2 
3 #ifndef VARJO_MR_EXPERIMENTAL_H
4 #define VARJO_MR_EXPERIMENTAL_H
5 
6 #include "Varjo_export.h"
7 #include "Varjo_types.h"
8 #include "Varjo_types_mr.h"
10 
11 #if defined __cplusplus
12 extern "C" {
13 #endif
14 
15 // =======================================================
16 // ============= Global Video Depth Test API =============
17 // =======================================================
18 
32 VARJO_EXPERIMENTAL_API void varjo_MRResetVideoDepthTest(struct varjo_Session* session);
33 
54 
72 VARJO_EXPERIMENTAL_API void varjo_MRSetVideoDepthTestRange(struct varjo_Session* session, double nearZ, double farZ);
73 
74 
75 // =========================================================
76 // ============= Video Post Process Shader API =============
77 // =========================================================
78 
94 VARJO_EXPERIMENTAL_API void varjo_MRSetShader(struct varjo_Session* session, varjo_ShaderType shaderType, varjo_Bool enabled);
95 
115 VARJO_EXPERIMENTAL_API void varjo_MRD3D11ConfigureShader(struct varjo_Session* session, struct ID3D11Device* device, varjo_ShaderType shaderType,
116  const struct varjo_ShaderConfig* config, const char* shaderData, int32_t shaderSize);
117 
137 VARJO_EXPERIMENTAL_API void varjo_MRD3D12ConfigureShader(struct varjo_Session* session, struct ID3D12CommandQueue* commandQueue, varjo_ShaderType shaderType,
138  const struct varjo_ShaderConfig* config, const char* shaderData, int32_t shaderSize);
139 
159  struct varjo_Session* session, varjo_ShaderType shaderType, const struct varjo_ShaderConfig* config, const char* shaderData, int32_t shaderSize);
160 
180 VARJO_EXPERIMENTAL_API struct varjo_Texture varjo_MRAcquireShaderTexture(struct varjo_Session* session, varjo_ShaderType shaderType, int32_t index);
181 
197 VARJO_EXPERIMENTAL_API void varjo_MRReleaseShaderTexture(struct varjo_Session* session, varjo_ShaderType shaderType, int32_t index);
198 
224 VARJO_EXPERIMENTAL_API void varjo_MRSubmitShaderInputs(struct varjo_Session* session, varjo_ShaderType shaderType, const int32_t* textureIndices,
225  int32_t numTextureIndices, const char* constantBufferData, int32_t constantBufferSize);
226 
238  struct varjo_Session* session, varjo_RenderAPI renderAPI, varjo_ShaderType shaderType);
239 
255  struct varjo_Session* session, varjo_RenderAPI renderAPI, varjo_ShaderType shaderType, varjo_TextureFormat* formats, int32_t maxSize);
256 
267 
278 
279 // =====================================================================
280 // ================= 3D reconstruction point cloud API =================
281 // =====================================================================
282 
293 VARJO_EXPERIMENTAL_API void varjo_MRSetReconstruction(struct varjo_Session* session, varjo_Bool enabled);
294 
303 
312 
322 
333  struct varjo_Session* session, varjo_PointCloudSnapshotId id, struct varjo_PointCloudSnapshotContent* content);
334 
344 
354 
366  struct varjo_Session* session, varjo_PointCloudSnapshotId id, struct varjo_PointCloudDeltaContent* content);
367 
377 
378 // =================================================================
379 // ================= 3D reconstruction meshing API =================
380 // =================================================================
381 
392 VARJO_EXPERIMENTAL_API void varjo_MRSetMeshReconstruction(struct varjo_Session* session, varjo_Bool enabled);
393 
402 
421  struct varjo_Session* session, varjo_Nanoseconds updatedAfter, struct varjo_MeshChunkDescription* buffer, int32_t bufferSize, int32_t* chunkCount);
422 
436  struct varjo_Session* session, const struct varjo_Vector3Di* positions, int32_t count);
437 
452  struct varjo_Session* session, varjo_MeshChunkContentsBufferId id, struct varjo_MeshChunkContent* chunkContents);
453 
465 
466 #if defined __cplusplus
467 }
468 #endif
469 #endif // VARJO_MR_EXPERIMENTAL_H
varjo_MRReleasePointCloudSnapshot
VARJO_EXPERIMENTAL_API void varjo_MRReleasePointCloudSnapshot(struct varjo_Session *session, varjo_PointCloudSnapshotId id)
Release snapshot.
varjo_MeshReconstructionConfig
Environment 3D reconstruction mesh configuration parameters.
Definition: Varjo_types_mr_experimental.h:363
varjo_VideoDepthTestMode
int64_t varjo_VideoDepthTestMode
Video depth test mode constants.
Definition: Varjo_types_mr_experimental.h:72
varjo_MeshChunkContent
Contents of a 3D reconstruction chunks.
Definition: Varjo_types_mr_experimental.h:411
varjo_MRSetShader
VARJO_EXPERIMENTAL_API void varjo_MRSetShader(struct varjo_Session *session, varjo_ShaderType shaderType, varjo_Bool enabled)
Turn shader on/off.
varjo_Nanoseconds
int64_t varjo_Nanoseconds
Time in nanoseconds.
Definition: Varjo_types.h:147
varjo_ReconstructionConfig
Environment 3D reconstruction configuration parameters.
Definition: Varjo_types_mr_experimental.h:286
varjo_MRGetMeshReconstructionConfig
VARJO_EXPERIMENTAL_API struct varjo_MeshReconstructionConfig varjo_MRGetMeshReconstructionConfig(struct varjo_Session *session)
Get currently applied 3D reconstruction meshing configuration.
Varjo_export.h
varjo_MRGetPointCloudDelta
VARJO_EXPERIMENTAL_API varjo_Bool varjo_MRGetPointCloudDelta(struct varjo_Session *session, varjo_PointCloudSnapshotId id, struct varjo_PointCloudDeltaContent *content)
Get the oldest delta that is built on top of the given snapshot and that has not yet been released.
varjo_MRUnlockMeshChunkContentsBuffer
VARJO_EXPERIMENTAL_API void varjo_MRUnlockMeshChunkContentsBuffer(struct varjo_Session *session, varjo_MeshChunkContentsBufferId id)
Unlock already locked chunk contents buffer.
varjo_MRGLConfigureShader
VARJO_EXPERIMENTAL_API void varjo_MRGLConfigureShader(struct varjo_Session *session, varjo_ShaderType shaderType, const struct varjo_ShaderConfig *config, const char *shaderData, int32_t shaderSize)
Configure the shader and the input layout with OpenGL texture support.
varjo_MRGetMeshChunkDescriptions
VARJO_EXPERIMENTAL_API void varjo_MRGetMeshChunkDescriptions(struct varjo_Session *session, varjo_Nanoseconds updatedAfter, struct varjo_MeshChunkDescription *buffer, int32_t bufferSize, int32_t *chunkCount)
Get all reconstruction mesh chunks updated after a given timestamp.
varjo_VideoDepthTestBehavior
int64_t varjo_VideoDepthTestBehavior
Video depth test behavior constants.
Definition: Varjo_types_mr_experimental.h:94
varjo_RenderAPI
int64_t varjo_RenderAPI
Render API flags.
Definition: Varjo_types.h:238
varjo_Bool
int32_t varjo_Bool
Definition: Varjo_types.h:140
varjo_MRD3D12ConfigureShader
VARJO_EXPERIMENTAL_API void varjo_MRD3D12ConfigureShader(struct varjo_Session *session, struct ID3D12CommandQueue *commandQueue, varjo_ShaderType shaderType, const struct varjo_ShaderConfig *config, const char *shaderData, int32_t shaderSize)
Configure the shader and the input layout with D3D12 texture support.
varjo_MRSetVideoDepthTestRange
VARJO_EXPERIMENTAL_API void varjo_MRSetVideoDepthTestRange(struct varjo_Session *session, double nearZ, double farZ)
Set video pass-through layer depth test range.
varjo_MeshChunkContentsBufferId
int64_t varjo_MeshChunkContentsBufferId
3D reconstruction mesh constants.
Definition: Varjo_types_mr_experimental.h:340
varjo_MeshChunkDescription
Environment 3D reconstruction mesh chunk description.
Definition: Varjo_types_mr_experimental.h:379
varjo_MREndPointCloudSnapshot
VARJO_EXPERIMENTAL_API void varjo_MREndPointCloudSnapshot(struct varjo_Session *session, varjo_PointCloudSnapshotId id)
Ends the snapshot, deltas will no longer be saved.
VARJO_EXPERIMENTAL_API
#define VARJO_EXPERIMENTAL_API
Definition: Varjo_export.h:45
varjo_MRSubmitShaderInputs
VARJO_EXPERIMENTAL_API void varjo_MRSubmitShaderInputs(struct varjo_Session *session, varjo_ShaderType shaderType, const int32_t *textureIndices, int32_t numTextureIndices, const char *constantBufferData, int32_t constantBufferSize)
Submits updates made to input textures and/or constant buffer.
varjo_MRGetMeshChunkContentsBufferData
VARJO_EXPERIMENTAL_API void varjo_MRGetMeshChunkContentsBufferData(struct varjo_Session *session, varjo_MeshChunkContentsBufferId id, struct varjo_MeshChunkContent *chunkContents)
Get mesh chunk contents from mesh chunk contents buffer.
Varjo_types_mr.h
Varjo_types_mr_experimental.h
varjo_MRGetPointCloudSnapshotStatus
VARJO_EXPERIMENTAL_API varjo_PointCloudSnapshotStatus varjo_MRGetPointCloudSnapshotStatus(struct varjo_Session *session, varjo_PointCloudSnapshotId id)
Poll snapshot computation status.
varjo_TextureFormat
int64_t varjo_TextureFormat
Definition: Varjo_types.h:216
varjo_PointCloudSnapshotStatus
int64_t varjo_PointCloudSnapshotStatus
Point cloud snapshot computation status.
Definition: Varjo_types_mr_experimental.h:278
varjo_MRD3D11ConfigureShader
VARJO_EXPERIMENTAL_API void varjo_MRD3D11ConfigureShader(struct varjo_Session *session, struct ID3D11Device *device, varjo_ShaderType shaderType, const struct varjo_ShaderConfig *config, const char *shaderData, int32_t shaderSize)
Configure the shader and the input layout with D3D11 texture support.
varjo_MRResetVideoDepthTest
VARJO_EXPERIMENTAL_API void varjo_MRResetVideoDepthTest(struct varjo_Session *session)
Reset video pass-through layer depth test mode and range to defaults.
varjo_Texture
API-agnostic texture handle.
Definition: Varjo_types.h:512
varjo_MRBeginPointCloudSnapshot
VARJO_EXPERIMENTAL_API varjo_PointCloudSnapshotId varjo_MRBeginPointCloudSnapshot(struct varjo_Session *session)
Schedule a snapshot to be captured the next time point cloud is updated and start saving deltas.
varjo_MRSetVideoDepthTestMode
VARJO_EXPERIMENTAL_API void varjo_MRSetVideoDepthTestMode(struct varjo_Session *session, varjo_VideoDepthTestMode mode, varjo_VideoDepthTestBehavior behavior)
Set video pass-through layer depth test mode.
varjo_MRSetReconstruction
VARJO_EXPERIMENTAL_API void varjo_MRSetReconstruction(struct varjo_Session *session, varjo_Bool enabled)
Start or stop 3D reconstruction.
Varjo_types.h
varjo_MRLockMeshChunkContentsBuffer
VARJO_EXPERIMENTAL_API varjo_MeshChunkContentsBufferId varjo_MRLockMeshChunkContentsBuffer(struct varjo_Session *session, const struct varjo_Vector3Di *positions, int32_t count)
Lock mesh chunk contents buffer for reading.
varjo_PointCloudDeltaContent
Point cloud delta content.
Definition: Varjo_types_mr_experimental.h:323
varjo_MRGetPointCloudSnapshotContent
VARJO_EXPERIMENTAL_API void varjo_MRGetPointCloudSnapshotContent(struct varjo_Session *session, varjo_PointCloudSnapshotId id, struct varjo_PointCloudSnapshotContent *content)
Get pointer to snapshot content.
varjo_PointCloudSnapshotId
int64_t varjo_PointCloudSnapshotId
Point cloud snapshot id.
Definition: Varjo_types_mr_experimental.h:272
varjo_MRAcquireShaderTexture
VARJO_EXPERIMENTAL_API struct varjo_Texture varjo_MRAcquireShaderTexture(struct varjo_Session *session, varjo_ShaderType shaderType, int32_t index)
Acquires write lock of a shader input texture.
varjo_MRGetReconstructionConfig
VARJO_EXPERIMENTAL_API struct varjo_ReconstructionConfig varjo_MRGetReconstructionConfig(struct varjo_Session *session)
Get currently applied 3D reconstruction configuration.
varjo_ShaderType
int64_t varjo_ShaderType
Post process shader type constants.
Definition: Varjo_types_mr_experimental.h:121
varjo_Vector3Di
Definition: Varjo_types.h:379
varjo_MRGetSupportedShaderTextureFormats
VARJO_EXPERIMENTAL_API void varjo_MRGetSupportedShaderTextureFormats(struct varjo_Session *session, varjo_RenderAPI renderAPI, varjo_ShaderType shaderType, varjo_TextureFormat *formats, int32_t maxSize)
Get supported texture formats.
varjo_ShaderConfig
Shader configuration structure.
Definition: Varjo_types_mr_experimental.h:235
varjo_MRSetMeshReconstruction
VARJO_EXPERIMENTAL_API void varjo_MRSetMeshReconstruction(struct varjo_Session *session, varjo_Bool enabled)
Start or stop 3D reconstruction meshing.
varjo_DXGITextureFormat
uint32_t varjo_DXGITextureFormat
Definition: Varjo_types_mr_experimental.h:244
varjo_PointCloudSnapshotContent
Point cloud snapshot content.
Definition: Varjo_types_mr_experimental.h:313
varjo_MRReleaseShaderTexture
VARJO_EXPERIMENTAL_API void varjo_MRReleaseShaderTexture(struct varjo_Session *session, varjo_ShaderType shaderType, int32_t index)
Releases the acquired input texture (varjo_MRAcquireShaderTexture).
varjo_ToGLFormat
VARJO_EXPERIMENTAL_API struct varjo_GLTextureFormat varjo_ToGLFormat(struct varjo_Session *session, varjo_TextureFormat format)
Converts varjo_TextureFormat to GL format.
varjo_MRGetSupportedShaderTextureFormatCount
VARJO_EXPERIMENTAL_API int32_t varjo_MRGetSupportedShaderTextureFormatCount(struct varjo_Session *session, varjo_RenderAPI renderAPI, varjo_ShaderType shaderType)
Get amount of supported texture formats.
varjo_GLTextureFormat
Definition: Varjo_types_mr_experimental.h:249
varjo_ToDXGIFormat
VARJO_EXPERIMENTAL_API varjo_DXGITextureFormat varjo_ToDXGIFormat(struct varjo_Session *session, varjo_TextureFormat format)
Converts varjo_TextureFormat to DXGI_FORMAT.
varjo_MRPopPointCloudDelta
VARJO_EXPERIMENTAL_API void varjo_MRPopPointCloudDelta(struct varjo_Session *session, varjo_PointCloudSnapshotId id)
Release the oldest delta that is built on top of the given snapshot.