You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A component is attached to an entity at creation time. It cannot be moved to another entity afterwards. Components are explicitly deleted with `Component.Destroy()` or automatically when the component's owner entity is destroyed.
38
52
39
53
Only one instance of each component type may be added to an entity at a time.
Transform queries are synchronous calls on the object. It is important to note that transforms queried through the API are local space transforms, relative to the object's parent. Exceptions are root objects, for which local space and world space are identical.
Bounds queries are asynchronous calls that operate on a full object hierarchy, using one entity as a root. See the dedicated chapter about [object bounds](object-bounds.md).
Copy file name to clipboardExpand all lines: articles/remote-rendering/concepts/graphics-bindings.md
+91-15Lines changed: 91 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,26 +30,46 @@ The only other relevant part for Unity is accessing the [basic binding](#access)
30
30
31
31
To select a graphics binding, take the following two steps: First, the graphics binding has to be statically initialized when the program is initialized:
StartupRemoteRendering(managerInit); // static function in namespace Microsoft::Azure::RemoteRendering
47
+
```
48
+
41
49
The call above is necessary to initialize Azure Remote Rendering into the holographic APIs. This function must be called before any holographic API is called and before any other Remote Rendering APIs are accessed. Similarly, the corresponding de-init function `RemoteManagerStatic.ShutdownRemoteRendering();` should be called after no holographic APIs are being called anymore.
42
50
43
51
## <span id="access">Accessing graphics binding
44
52
45
53
Once a client is set up, the basic graphics binding can be accessed with the `AzureSession.GraphicsBinding` getter. As an example, the last frame statistics can be retrieved like this:
46
54
47
-
```cs
48
-
AzureSessioncurrentSesson=...;
49
-
if (currentSesson.GraphicsBinding)
55
+
```cs
56
+
AzureSession currentSession = ...;
57
+
if (currentSession.GraphicsBinding)
58
+
{
59
+
FrameStatistics frameStatistics;
60
+
if (currentSession.GraphicsBinding.GetLastFrameStatistics(out frameStatistics) == Result.Success)
61
+
{
62
+
...
63
+
}
64
+
}
65
+
```
66
+
67
+
```cpp
68
+
ApiHandle<AzureSession> currentSession = ...;
69
+
if (ApiHandle<GraphicsBinding> binding = currentSession->GetGraphicsBinding())
50
70
{
51
71
FrameStatistics frameStatistics;
52
-
if (session.GraphicsBinding.GetLastFrameStatistics(outframeStatistics) ==Result.Success)
72
+
if (*binding->GetLastFrameStatistics(&frameStatistics) == Result::Success)
53
73
{
54
74
...
55
75
}
@@ -69,26 +89,43 @@ There are two things that need to be done to use the WMR binding:
69
89
70
90
#### Inform Remote Rendering of the used coordinate system
71
91
72
-
```cs
73
-
AzureSessioncurrentSesson=...;
92
+
```cs
93
+
AzureSessioncurrentSession=...;
74
94
IntPtrptr=...; // native pointer to ISpatialCoordinateSystem
if (*wmrBinding->UpdateUserCoordinateSystem(ptr) == Result::Success)
107
+
{
108
+
//...
109
+
}
110
+
```
111
+
112
+
82
113
Where the above `ptr` must be a pointer to a native `ABI::Windows::Perception::Spatial::ISpatialCoordinateSystem` object that defines the world space coordinate system in which coordinates in the API are expressed in.
83
114
84
115
#### Render remote image
85
116
86
117
At the start of each frame the remote frame needs to be rendered into the back buffer. This is done by calling `BlitRemoteFrame`, which will fill both color and depth information into the currently bound render target. Thus it is important that this is done after binding the back buffer as a render target.
87
118
88
-
```cs
89
-
AzureSessioncurrentSesson=...;
119
+
```cs
120
+
AzureSession currentSession = ...;
90
121
GraphicsBindingWmrD3d11 wmrBinding = (currentSession.GraphicsBinding as GraphicsBindingWmrD3d11);
@@ -101,8 +138,8 @@ The setup is a bit more involved and works as follows:
101
138
Remote and local content needs to be rendered to an offscreen color / depth render target called 'proxy' using
102
139
the proxy camera data provided by the `GraphicsBindingSimD3d11.Update` function. The proxy must match the resolution of the back buffer. Once a session is ready, `GraphicsBindingSimD3d11.InitSimulation` needs to be called before connecting to it:
103
140
104
-
```cs
105
-
AzureSessioncurrentSesson=...;
141
+
```cs
142
+
AzureSessioncurrentSession=...;
106
143
IntPtrd3dDevice=...; // native pointer to ID3D11Device
107
144
IntPtrcolor=...; // native pointer to ID3D11Texture2D
108
145
IntPtrdepth=...; // native pointer to ID3D11Texture2D
@@ -113,6 +150,18 @@ GraphicsBindingSimD3d11 simBinding = (currentSession.GraphicsBinding as Graphics
The init function needs to be provided with pointers to the native d3d-device as well as to the color and depth texture of the proxy render target. Once initialized, `AzureSession.ConnectToRuntime` and `DisconnectFromRuntime` can be called multiple times but when switching to a different session, `GraphicsBindingSimD3d11.DeinitSimulation` needs to be called first on the old session before `GraphicsBindingSimD3d11.InitSimulation` can be called on another session.
117
166
118
167
#### Render loop update
@@ -124,8 +173,8 @@ If the returned proxy update `SimulationUpdate.frameId` is null, there is no rem
124
173
1. The application should now bind the proxy render target and call `GraphicsBindingSimD3d11.BlitRemoteFrameToProxy`. This will fill the remote color and depth information into the proxy render target. Any local content can now be rendered onto the proxy using the proxy camera transform.
125
174
1. Next, the back buffer needs to be bound as a render target and `GraphicsBindingSimD3d11.ReprojectProxy` called at which point the back buffer can be presented.
126
175
127
-
```cs
128
-
AzureSessioncurrentSesson=...;
176
+
```cs
177
+
AzureSession currentSession = ...;
129
178
GraphicsBindingSimD3d11 simBinding = (currentSession.GraphicsBinding as GraphicsBindingSimD3d11);
Copy file name to clipboardExpand all lines: articles/remote-rendering/concepts/materials.md
+23-4Lines changed: 23 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ During conversion multiple materials with the same properties and textures are a
38
38
39
39
All materials provided by the API derive from the base class `Material`. Their type can be queried through `Material.MaterialSubType` or by casting them directly:
Afterwards you can traverse the entity hierarchy and modify the entities and components. Loading the same model multiple times creates multiple instances, each with their own copy of the entity/component structure. Since meshes, materials, and textures are [shared resources](../concepts/lifetime.md), their data will not be loaded again, though. Therefore instantiating a model more than once incurs relatively little memory overhead.
Copy file name to clipboardExpand all lines: articles/remote-rendering/concepts/object-bounds.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ It's possible to compute the bounds of an entire object hierarchy this way, but
19
19
20
20
A better way is to call `QueryLocalBoundsAsync` or `QueryWorldBoundsAsync` on an entity. The computation is then offloaded to the server and returned with minimal delay.
21
21
22
-
```cs
22
+
```cs
23
23
privateBoundsQueryAsync_boundsQuery=null;
24
24
25
25
publicvoidGetBounds(Entityentity)
@@ -37,6 +37,22 @@ public void GetBounds(Entity entity)
Copy file name to clipboardExpand all lines: articles/remote-rendering/concepts/sessions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,7 @@ You can [extend the lease time](../how-tos/session-rest-api.md#update-a-session)
77
77
78
78
The code below shows a simple implementation of starting a session, waiting for the *ready* state, connecting, and then disconnecting and shutting down again.
0 commit comments