Skip to content

Commit

Permalink
Upgrade to RS2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnashdisguise committed May 5, 2023
1 parent dad0f6b commit 076f06c
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 11 deletions.
19 changes: 15 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
# rs1.32
# RS2.0
Compatible with disguise designer version r25.0 and above.
* Removed unused parameters from D3TrackingData
* Added aperture and focus distance values to CameraData
* Added plugin version identifier to Schema
* Added support for skeleton parameters

# RS1.32
Compatible with disguise designer version r23.4 and above.
* Added mappingName field to StreamDescription.
* Contains the name of the mapping in d3 that this stream is used for.
* Added iFragment field to StreamDescription.
* Contains index of the fragment of the mapping in d3 that this stream is used for.
* d3 will split mappings into multiple fragments when a mapping is distributed over multiple render engines.

# rs1.31
# RS1.31
Compatible with disguise designer version r22.0 and above.
* Engines must no longer call `rs_sendFrame`, `rs_getImage` and `rs_releaseImage`. These have been replaced with a variant which appends `2` to the name. This is in order to change the calling parameters to use a single `SenderFrame` object, while maintaining ABI compatibility with prior releases.
* `VulkanData` now contains the required information directly, rather than requiring a structure (which was due to ABI compatibility concerns.)
* `HostMemoryData` now contains a `format` field which must be set to the pixel format the engine is supplying. Previously this was assumed to be BGRA8.

# rs1.30
# RS1.30
Compatible with disguise designer version r22.0 and above.
* Added support for read-only parameters in the schema - see `REMOTEPARAMETER_READ_ONLY` flag. Breaking change: This requires the engine to pass a `FrameResponseData` to `rs_sendFrame` as the 3rd parameter.
* Added support for Vulkan engines
* Added ability to expose an engine type & version, changed the .json file format saved in `rs_saveSchema` to be versioned (rs1.29 schemas are still compatible.)
* Engines are required to call `rs_releaseImage` when finished with an image parameter retrieved via `rs_getImage`.

# rs1.29
# RS1.29
Compatible with disguise designer version r21.0 and above.
* This is the first version which is ABI forward-compatible with future RenderStream APIs.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This repository is for API definitions, documentation and examples.
# Requirements
* 64-bit Windows 10 and above
* A valid [disguise software license](https://store.disguise.one/) or RenderStream license (available on [rx range](https://www.disguise.one/en/products/rx-range/) hardware)
* An r21.3 install of the disguise software
* The latest install of the disguise designer software (available from https://download.disguise.one/)

# Support
Please raise RenderStream API issues on this GitHub repository or contact [email protected] for general disguise support
Expand Down Expand Up @@ -185,6 +185,8 @@ Perspective cameras should use the focal length and sensor sizes to compute thro

Once the perspective matrix is found, it is necessary to also apply the clipping values to adjust the projected area. This allows distribution of the frame buffer across multiple nodes. This information is available in the `StreamDescription` for the given stream.

Aperture (f-stop) values and focus distance (m) can also be used to simulate depth of field effects.

The samples in this repository show this process in detail, and it is recommended to use the calculations given in the samples as reference for this, to ensure correctness.

# Buffer calling convention
Expand Down
47 changes: 41 additions & 6 deletions src/include/d3renderstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ typedef void (*logger_t)(const char*);
#pragma pack(push, 4)
typedef struct
{
float virtualZoomScale;
uint8_t virtualReprojectionRequired;
float xRealCamera, yRealCamera, zRealCamera;
float rxRealCamera, ryRealCamera, rzRealCamera;
} D3TrackingData; // Tracking data required by d3 but not used to render content

typedef struct
Expand All @@ -126,6 +123,8 @@ typedef struct
float cx, cy;
float nearZ, farZ;
float orthoWidth; // If > 0, an orthographic camera should be used
float aperture; // Apply if > 0
float focusDistance; // Apply if > 0
D3TrackingData d3Tracking;
} CameraData;

Expand All @@ -146,7 +145,6 @@ typedef struct
CameraData camera;
} CameraResponseData;


typedef struct
{
uint8_t* data;
Expand Down Expand Up @@ -241,6 +239,8 @@ enum RemoteParameterType
RS_PARAMETER_POSE, // 4x4 TR matrix
RS_PARAMETER_TRANSFORM, // 4x4 TRS matrix
RS_PARAMETER_TEXT,
RS_PARAMETER_EVENT,
RS_PARAMETER_SKELETON,
};

enum RemoteParameterDmxType
Expand Down Expand Up @@ -315,6 +315,7 @@ typedef struct
{
const char* engineName;
const char* engineVersion;
const char* pluginVersion;
const char* info;
Channels channels;
Scenes scenes;
Expand All @@ -330,8 +331,8 @@ typedef struct

#define D3_RENDER_STREAM_API __declspec( dllexport )

#define RENDER_STREAM_VERSION_MAJOR 1
#define RENDER_STREAM_VERSION_MINOR 32
#define RENDER_STREAM_VERSION_MAJOR 2
#define RENDER_STREAM_VERSION_MINOR 0

#define RENDER_STREAM_VERSION_STRING stringify(RENDER_STREAM_VERSION_MAJOR) "." stringify(RENDER_STREAM_VERSION_MINOR)

Expand All @@ -351,6 +352,40 @@ typedef struct
const char** textData;
} FrameResponseData;

typedef struct
{
float x, y, z;
float rx, ry, rz, rw;
} Transform;

typedef struct
{
uint64_t id;
Transform transform;
} SkeletonJointPose;

typedef struct
{
uint64_t id;
uint64_t parentId;
Transform transform;
} SkeletonJointDesc;

typedef struct
{
uint32_t version;
SkeletonJointDesc* joints;
} SkeletonLayout;

typedef struct
{
uint64_t layoutId;
uint32_t layoutVersion;
char reservedBytes[8];
Transform rootTransform;
SkeletonJointPose* joints;
} SkeletonPose;

// isolated functions, do not require init prior to use
extern "C" D3_RENDER_STREAM_API void rs_registerLoggingFunc(logger_t logger);
extern "C" D3_RENDER_STREAM_API void rs_registerErrorLoggingFunc(logger_t logger);
Expand Down
8 changes: 8 additions & 0 deletions src/include/renderstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ struct ScopedSchema
}
void reset()
{
free(const_cast<char*>(schema.engineName));
free(const_cast<char*>(schema.engineVersion));
free(const_cast<char*>(schema.pluginVersion));
free(const_cast<char*>(schema.info));
for (size_t i = 0; i < schema.channels.nChannels; ++i)
free(const_cast<char*>(schema.channels.channels[i]));
free(schema.channels.channels);
Expand Down Expand Up @@ -403,6 +407,10 @@ struct ScopedSchema
private:
void clear()
{
schema.engineName = nullptr;
schema.engineVersion = nullptr;
schema.pluginVersion = nullptr;
schema.info = nullptr;
schema.channels.nChannels = 0;
schema.channels.channels = nullptr;
schema.scenes.nScenes = 0;
Expand Down
1 change: 1 addition & 0 deletions src/samples/Schema/Schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ int mainImpl(int argc, char** argv)
ScopedSchema scoped; // C++ helper that cleans up mallocs and strdups
scoped.schema.engineName = _strdup("Schema sample");
scoped.schema.engineVersion = _strdup(("RS" + std::to_string(RENDER_STREAM_VERSION_MAJOR) + "." + std::to_string(RENDER_STREAM_VERSION_MINOR)).c_str());
scoped.schema.pluginVersion = _strdup(("RS" + std::to_string(RENDER_STREAM_VERSION_MAJOR) + "." + std::to_string(RENDER_STREAM_VERSION_MINOR) + "-Samples").c_str());
scoped.schema.info = _strdup("");
scoped.schema.channels.nChannels = static_cast<uint32_t>(channels.size());
scoped.schema.channels.channels = channels.data();
Expand Down

0 comments on commit 076f06c

Please sign in to comment.