Skip to content

Commit 61b2e8c

Browse files
committed
TODOs
1 parent 9f43b38 commit 61b2e8c

File tree

12 files changed

+139
-26
lines changed

12 files changed

+139
-26
lines changed

articles/remote-rendering/concepts/graphics-bindings.md

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,25 @@ The only other relevant part for Unity is accessing the [basic binding](#access)
3030

3131
To select a graphics binding, take the following two steps: First, the graphics binding has to be statically initialized when the program is initialized:
3232

33-
``` cs
33+
```cs
3434
RemoteRenderingInitialization managerInit = new RemoteRenderingInitialization;
3535
managerInit.graphicsApi = GraphicsApiType.WmrD3D11;
3636
managerInit.connectionType = ConnectionType.General;
3737
managerInit.right = ///...
3838
RemoteManagerStatic.StartupRemoteRendering(managerInit);
3939
```
4040

41+
```cpp
42+
TODO
43+
```
44+
4145
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.
4246

4347
## <span id="access">Accessing graphics binding
4448

4549
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:
4650

47-
``` cs
51+
```cs
4852
AzureSession currentSesson = ...;
4953
if (currentSesson.GraphicsBinding)
5054
{
@@ -56,6 +60,10 @@ if (currentSesson.GraphicsBinding)
5660
}
5761
```
5862

63+
```cpp
64+
TODO
65+
```
66+
5967
## Graphic APIs
6068

6169
There are currently two graphics APIs that can be selected, `WmrD3D11` and `SimD3D11`. A third one `Headless` exists but is not yet supported on the client side.
@@ -69,7 +77,7 @@ There are two things that need to be done to use the WMR binding:
6977

7078
#### Inform Remote Rendering of the used coordinate system
7179

72-
``` cs
80+
```cs
7381
AzureSession currentSesson = ...;
7482
IntPtr ptr = ...; // native pointer to ISpatialCoordinateSystem
7583
GraphicsBindingWmrD3d11 wmrBinding = (currentSession.GraphicsBinding as GraphicsBindingWmrD3d11);
@@ -79,18 +87,27 @@ if (binding.UpdateUserCoordinateSystem(ptr) == Result.Success)
7987
}
8088
```
8189

90+
```cpp
91+
TODO
92+
```
93+
94+
8295
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.
8396

8497
#### Render remote image
8598

8699
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.
87100

88-
``` cs
101+
```cs
89102
AzureSession currentSesson = ...;
90103
GraphicsBindingWmrD3d11 wmrBinding = (currentSession.GraphicsBinding as GraphicsBindingWmrD3d11);
91104
binding.BlitRemoteFrame();
92105
```
93106

107+
```cpp
108+
TODO
109+
```
110+
94111
### Simulation
95112

96113
`GraphicsApiType.SimD3D11` is the simulation binding and if selected it creates the `GraphicsBindingSimD3d11` graphics binding. This interface is used to simulate head movement, for example in a desktop application and renders a monoscopic image.
@@ -101,7 +118,7 @@ The setup is a bit more involved and works as follows:
101118
Remote and local content needs to be rendered to an offscreen color / depth render target called 'proxy' using
102119
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:
103120

104-
``` cs
121+
```cs
105122
AzureSession currentSesson = ...;
106123
IntPtr d3dDevice = ...; // native pointer to ID3D11Device
107124
IntPtr color = ...; // native pointer to ID3D11Texture2D
@@ -113,6 +130,10 @@ GraphicsBindingSimD3d11 simBinding = (currentSession.GraphicsBinding as Graphics
113130
simBinding.InitSimulation(d3dDevice, depth, color, refreshRate, flipBlitRemoteFrameTextureVertically, flipReprojectTextureVertically);
114131
```
115132

133+
```cpp
134+
TODO
135+
```
136+
116137
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.
117138

118139
#### Render loop update
@@ -124,7 +145,7 @@ If the returned proxy update `SimulationUpdate.frameId` is null, there is no rem
124145
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.
125146
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.
126147

127-
``` cs
148+
```cs
128149
AzureSession currentSesson = ...;
129150
GraphicsBindingSimD3d11 simBinding = (currentSession.GraphicsBinding as GraphicsBindingSimD3d11);
130151
SimulationUpdate update = new SimulationUpdate();
@@ -150,6 +171,10 @@ else
150171
}
151172
```
152173

174+
```cpp
175+
TODO
176+
```
177+
153178
## Next steps
154179

155180
* [Tutorial: Setting up a Unity project from scratch](../tutorials/unity/project-setup.md)

articles/remote-rendering/concepts/materials.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ When you modify a material directly on the mesh resource, this change affects al
3434

3535
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:
3636

37-
``` cs
37+
```cs
3838
void SetMaterialColorToGreen(Material material)
3939
{
4040
if (material.MaterialSubType == MaterialType.Color)
@@ -54,6 +54,11 @@ void SetMaterialColorToGreen(Material material)
5454
}
5555
```
5656

57+
```cpp
58+
TODO
59+
```
60+
61+
5762
## Next steps
5863

5964
* [PBR materials](../overview/features/pbr-materials.md)

articles/remote-rendering/concepts/object-bounds.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ It's possible to compute the bounds of an entire object hierarchy this way, but
1919

2020
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.
2121

22-
``` cs
22+
```cs
2323
private BoundsQueryAsync _boundsQuery = null;
2424

2525
public void GetBounds(Entity entity)
@@ -37,6 +37,11 @@ public void GetBounds(Entity entity)
3737
}
3838
```
3939

40+
```cpp
41+
TODO
42+
```
43+
44+
4045
## Next steps
4146

4247
* [Spatial queries](../overview/features/spatial-queries.md)

articles/remote-rendering/concepts/sessions.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ You can [extend the lease time](../how-tos/session-rest-api.md#update-a-session)
7777

7878
The code below shows a simple implementation of starting a session, waiting for the *ready* state, connecting, and then disconnecting and shutting down again.
7979

80-
``` cs
80+
```cs
8181
RemoteRenderingInitialization init = new RemoteRenderingInitialization();
8282
// fill out RemoteRenderingInitialization parameters...
8383
@@ -131,6 +131,11 @@ await session.StopAsync().AsTask();
131131
RemoteManagerStatic.ShutdownRemoteRendering();
132132
```
133133

134+
```cpp
135+
TODO
136+
```
137+
138+
134139
Multiple `AzureFrontend` and `AzureSession` instances can be maintained, manipulated, and queried from code. But only a single device may connect to an `AzureSession` at a time.
135140

136141
The lifetime of a virtual machine isn't tied to the `AzureFrontend` instance or the `AzureSession` instance. `AzureSession.StopAsync` must be called to stop a session.

articles/remote-rendering/concepts/textures.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Similar to loading models, there are two variants of addressing a texture asset
3434

3535
The following sample code shows how to load a texture via its SAS URI (or built-in texture) - note that only the loading function/parameter differs for the other case:
3636

37-
``` cs
37+
```cs
3838
LoadTextureAsync _textureLoad = null;
3939
void LoadMyTexture(AzureSession session, string textureUri)
4040
{
@@ -55,6 +55,11 @@ void LoadMyTexture(AzureSession session, string textureUri)
5555
}
5656
```
5757

58+
```cpp
59+
TODO
60+
```
61+
62+
5863
Depending on what the texture is supposed to be used for, there may be restrictions for the texture type and content. For example, the roughness map of a [PBR material](../overview/features/pbr-materials.md) must be grayscale.
5964

6065
> [!CAUTION]

articles/remote-rendering/how-tos/frontend-apis.md

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ For more information about the conversion service, see [the model conversion RES
7373

7474
#### Start asset conversion
7575

76-
``` cs
76+
```cs
7777
private StartConversionAsync _pendingAsync = null;
7878

7979
void StartAssetConversion(AzureFrontend frontend, string modelName, string modelUrl, string assetContainerUrl)
@@ -97,9 +97,14 @@ void StartAssetConversion(AzureFrontend frontend, string modelName, string model
9797
}
9898
```
9999

100+
```cpp
101+
TODO
102+
```
103+
104+
100105
#### Get conversion status
101106

102-
``` cs
107+
```cs
103108
private ConversionStatusAsync _pendingAsync = null
104109
void GetConversionStatus(AzureFrontend frontend, string assetId)
105110
{
@@ -121,6 +126,11 @@ void GetConversionStatus(AzureFrontend frontend, string assetId)
121126
}
122127
```
123128

129+
```cpp
130+
TODO
131+
```
132+
133+
124134
### Rendering APIs
125135

126136
See [the session management REST API](session-rest-api.md) for details about session management.
@@ -129,7 +139,7 @@ A rendering session can either be created dynamically on the service or an alrea
129139

130140
#### Create rendering session
131141

132-
``` cs
142+
```cs
133143
private CreateSessionAsync _pendingAsync = null;
134144
void CreateRenderingSession(AzureFrontend frontend, RenderingSessionVmSize vmSize, ARRTimeSpan maxLease)
135145
{
@@ -152,21 +162,30 @@ void CreateRenderingSession(AzureFrontend frontend, RenderingSessionVmSize vmSiz
152162
}
153163
```
154164

165+
```cpp
166+
TODO
167+
```
168+
155169
#### Open an existing rendering session
156170

157171
Opening an existing session is a synchronous call.
158172

159-
``` cs
173+
```cs
160174
void CreateRenderingSession(AzureFrontend frontend, string sessionId)
161175
{
162176
AzureSession session = frontend.OpenRenderingSession(sessionId);
163177
// Query session status, etc.
164178
}
165179
```
166180

181+
```cpp
182+
TODO
183+
```
184+
185+
167186
#### Get current rendering sessions
168187

169-
``` cs
188+
```cs
170189
private SessionPropertiesArrayAsync _pendingAsync = null;
171190
void GetCurrentRenderingSessions(AzureFrontend frontend)
172191
{
@@ -187,11 +206,15 @@ void GetCurrentRenderingSessions(AzureFrontend frontend)
187206
}
188207
```
189208

209+
```cpp
210+
TODO
211+
```
212+
190213
### Session APIs
191214

192215
#### Get rendering session properties
193216

194-
``` cs
217+
```cs
195218
private SessionPropertiesAsync _pendingAsync = null;
196219
void GetRenderingSessionProperties(AzureSession session)
197220
{
@@ -212,9 +235,13 @@ void GetRenderingSessionProperties(AzureSession session)
212235
}
213236
```
214237

238+
```cpp
239+
TODO
240+
```
241+
215242
#### Update rendering session
216243

217-
``` cs
244+
```cs
218245
private SessionAsync _pendingAsync;
219246
void UpdateRenderingSession(AzureSession session, ARRTimeSpan updatedLease)
220247
{
@@ -236,9 +263,13 @@ void UpdateRenderingSession(AzureSession session, ARRTimeSpan updatedLease)
236263
}
237264
```
238265

266+
```cpp
267+
TODO
268+
```
269+
239270
#### Stop rendering session
240271

241-
``` cs
272+
```cs
242273
private SessionAsync _pendingAsync;
243274
void StopRenderingSession(AzureSession session)
244275
{
@@ -259,9 +290,13 @@ void StopRenderingSession(AzureSession session)
259290
}
260291
```
261292

293+
```cpp
294+
TODO
295+
```
296+
262297
#### Connect to ARR inspector
263298

264-
``` cs
299+
```cs
265300
private ArrInspectorAsync _pendingAsync = null;
266301
void ConnectToArrInspector(AzureSession session, string hostname)
267302
{
@@ -294,6 +329,10 @@ void ConnectToArrInspector(AzureSession session, string hostname)
294329
}
295330
```
296331

332+
```cpp
333+
TODO
334+
```
335+
297336
## Next steps
298337

299338
* [Create an account](create-an-account.md)

articles/remote-rendering/overview/features/debug-rendering.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The debug rendering API provides a range of global options to alter server-side
2121

2222
The following code enables these debugging effects:
2323

24-
``` cs
24+
```cs
2525
void EnableDebugRenderingEffects(AzureSession session, bool highlight)
2626
{
2727
DebugRenderingSettings settings = session.Actions.DebugRenderingSettings;
@@ -37,6 +37,10 @@ void EnableDebugRenderingEffects(AzureSession session, bool highlight)
3737
}
3838
```
3939

40+
```cpp
41+
TODO
42+
```
43+
4044
![Debug rendering](./media/debug-rendering.png)
4145

4246
> [!NOTE]

articles/remote-rendering/overview/features/outlines.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Class `OutlineSettings` holds the settings related to global outline properties.
2929

3030
The following code shows an example for setting outline parameters via the API:
3131

32-
``` cs
32+
```cs
3333
void SetOutlineParameters(AzureSession session)
3434
{
3535
OutlineSettings outlineSettings = session.Actions.OutlineSettings;
@@ -39,6 +39,10 @@ void SetOutlineParameters(AzureSession session)
3939
}
4040
```
4141

42+
```cpp
43+
TODO
44+
```
45+
4246
## Performance
4347

4448
Outline rendering may have a significant impact on rendering performance. This impact varies based on screen-space spatial relation between selected and non-selected objects for a given frame.

0 commit comments

Comments
 (0)