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
renderer, unity: replaces the single onFrame tick with discrete render passes
This replaces the single `onFrame` tick with discrete render passes, allowing finer-grained control over each stage of rendering.
- Introduces `UnityRenderPassEvent` and dispatches per-pass events in `OnUnityRenderEvent`.
- Adds new lifecycle methods (`onBeforeRendering`, `onOpaquesRenderPass`, `onTransparentsRenderPass`, `onAfterRendering`) in `TrEmbedder` and `TrConstellation`.
- Refactors renderer interfaces and updates the OpenGL example to call the new pass methods.
Copy file name to clipboardExpand all lines: docs/api/embedder.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,11 +102,26 @@ The above fields are used to configure the runtime:
102
102
103
103
Internally, this method will start the internal components: renderer, content manager, media service and other services.
104
104
105
-
#### `void onFrame()`
105
+
#### `void onBeforeRendering()`
106
106
107
-
This method should be called in every frame to update the runtime, such as `Update()` in Unity or `Tick()` in Unreal.
107
+
Call this method before rendering in each frame, it will prepare the runtime for rendering, such as updating the renderer
108
+
and content manager.
108
109
109
-
Note: This frame in the method name doesn't mean the actual frame especially in the case of XR, it represents an update cycle by the host engine, the frame in OpenXR or WebXR should be configured by the `configureXrDevice(bool enabled, xr::TrDeviceInit &init)` method which will be explained later.
110
+
#### `void onOpaquesRenderPass()`
111
+
112
+
Call this method to render the opaque objects.
113
+
114
+
This pass is the mainly render pass which renders all the opaque objects of the JSAR applications, and also schedules the draw calls which should be rendered in the next passes, such as transparents, post-processing, and other render-texture rendering.
115
+
116
+
#### `void onTransparentsRenderPass()`
117
+
118
+
Call this method to render the transparent objects.
119
+
120
+
This pass executes the draw calls which enabled the blending, and uses the Weighted Blended OIT algorithm to render all the transparents elements (e.g. glass, water and GUIs) without depth sorting.
121
+
122
+
#### `void onAfterRendering()`
123
+
124
+
In this pass, it uses to achieve some post-processing effects or asynchronous rendering tasks.
0 commit comments