-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathcesium+1.68.0.patch
41 lines (40 loc) · 1.54 KB
/
cesium+1.68.0.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/node_modules/cesium/Source/Scene/Material.js b/node_modules/cesium/Source/Scene/Material.js
index 59d00a8..ddd8bc7 100644
--- a/node_modules/cesium/Source/Scene/Material.js
+++ b/node_modules/cesium/Source/Scene/Material.js
@@ -762,6 +762,36 @@ import when from '../ThirdParty/when.js';
return;
}
+ if (uniformValue instanceof HTMLCanvasElement) {
+
+ if (!uniformValue.drawing) {
+ if (uniformChanged && defined(texture)) {
+ if (texture !== context.defaultTexture) {
+ texture.destroy();
+ }
+ texture = undefined;
+ }
+
+ if (!defined(texture) || texture === context.defaultTexture) {
+ texture = new Texture({
+ context : context,
+ source : uniformValue
+ });
+
+ material._textures[uniformId] = texture;
+
+ return;
+ }
+
+ texture.copyFrom(uniformValue);
+
+ } else if (!defined(texture)) {
+ material._textures[uniformId] = context.defaultTexture;
+ }
+
+ return;
+ }
+
if (uniformValue instanceof Texture && uniformValue !== texture) {
material._texturePaths[uniformId] = undefined;
var tmp = material._textures[uniformId];