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
{{ message }}
This repository was archived by the owner on Apr 29, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -213,8 +213,29 @@ Status bar is always hidden by default when an Unity project is running on an An
213
213
#### Automatically Adjust Frame Rate
214
214
215
215
To build an App that is able to adjust the frame rate automatically, please open Project Settings, and in the Quality tab, set the "V Sync Count" option of the target platform to "Don't Sync".
216
-
The default logic is to set the frame rate to 15 when the screen is static, and change the frame rate to 60 whenever the screen changes.
216
+
The default logic is to set the frame rate to 25 when the screen is static, and change the frame rate to 60 whenever the screen changes.
217
217
If you would like to modify the behavior of speeding up or cooling down the frame rate, please set `Window.onFrameRateSpeedUp` and/or `Window.onFrameRateCoolDown` to your own functions.
218
+
219
+
#### WebGL Canvas Device Pixel Ratio Plugin
220
+
The width and height of the Canvas in browser may differ from the number of pixels the Canvas occupies on the screen.
221
+
Therefore, the image may blur in the builded WebGL program.
222
+
The Plugin `Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio.jslib` solves this issue.
223
+
If you need to disable this plugin for any reason, please select this plugin in the **Project** panel, and put an arbitrary string (that is not defined as a macro by Unity) in the **Define Constraints** field in the **Inspector** panel (for example, `ENABLE_CANVAS_DEVICE_PIXEL_RATIO_PLUGIN`), so that the plugin is enabled only if this macro is defined in **Player Settings**, which effectively disables the plugin.
224
+
225
+
This plugin overrides the following parameters in the Unity WebGL building module:
226
+
```
227
+
JS_SystemInfo_GetWidth
228
+
JS_SystemInfo_GetHeight
229
+
JS_SystemInfo_GetCurrentCanvasWidth
230
+
JS_SystemInfo_GetCurrentCanvasHeight
231
+
$Browser
232
+
$JSEvents
233
+
```
234
+
If you would like to implement your own WebGL plugin, and your plugin overrides at least one of the above parameters, you need to disable the `UIWidgetsCanvasDevicePixelRatio` plugin in the above mentioned way to avoid possible conflicts.
235
+
If you still need the function provided by this plugin, you can mannually apply the modification to Unity WebGL building module introduced in this plugin.
236
+
All the modifications introduced in `UIWidgetsCanvasDevicePixelRatio` are marked by `////////// Modifcation Start ////////////` and `////////// Modifcation End ////////////`.
237
+
In the marked codes, all the multiplications and divisions with `devicePixelRatio` are introduced by our modification.
238
+
To learn about the original script in detail, please refer to `SystemInfo.js` and `UnityNativeJS/UnityNative.js` in `PlaybackEngines/WebGLSupport/BuildTools/lib` in your Unity Editor installation.
0 commit comments