Skip to content

Commit 2776735

Browse files
csmartdaltoncsmartdalton
andcommitted
Remove WebGL Unity instructions for patching Emscripten
We have an internal workaround now that doesn't require a patch. Diffs= ba00a6765 Remove WebGL Unity instructions for patching Emscripten (#7297) Co-authored-by: Chris Dalton <[email protected]>
1 parent 323601a commit 2776735

File tree

2 files changed

+1
-39
lines changed

2 files changed

+1
-39
lines changed

.rive_head

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1b9405cdd82b93628579edf5f8d1ab08b7bc018a
1+
ba00a6765c58cd3e7fd895c1b84dddabe6993029

WEBGL.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,3 @@ This is our best-in-class solution for both quality and performance, supporting
1313
A fallback that will work on all modern browsers supporting WebGL 2. Anti-aliasing quality and playback performance won't be quite as high as PLS but will still be very good.
1414

1515
All Rive features are supported, however performance will be impacted when using advanced blend modes.
16-
17-
# ⚠️ Patching Emscripten
18-
19-
Rive's shaders use features Unity's WebGL shader pre-processor doesn't handle. We provide a patch that must be applied once to your local Unity install in order for it to bypass the shader preprocessor when loading Rive shaders.
20-
21-
## Locate Unity's Emscripten
22-
23-
Unity's emscripten installation is based on the location of the installed Unity Engine. For example, on Mac version 2022.3.10f1 will be located here:
24-
25-
```
26-
/Applications/Unity/Hub/Editor/2022.3.10f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten
27-
```
28-
29-
## Patching library_c_processor.js
30-
31-
Apply the patch to library_c_processor.js
32-
33-
```
34-
patch -u -b /Applications/Unity/Hub/Editor/2022.3.10f1/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/src/library_c_preprocessor.js -i ./rive_unity_webgl_patch.diff
35-
```
36-
37-
## Manually patching library_c_processor.js
38-
39-
The patch may not be compatible with your version of Unity, in this case you can manually make the change.
40-
41-
- Find library_c_processor.js in the paths provided above and open it in your code/text editor.
42-
43-
- Find where preprocess_c_code is defined: `$preprocess_c_code: function(code, defs = {}) {`
44-
45-
- Make it early out if it detects the shader is a Rive shader (it'll include GL_ANGLE_shader_pixel_local_storage) by returning the un-altered shader source:
46-
47-
```
48-
$preprocess_c_code: function(code, defs = {}) {
49-
if(code.indexOf('GL_ANGLE_shader_pixel_local_storage') != -1) {
50-
return code;
51-
}
52-
// ...
53-
```

0 commit comments

Comments
 (0)