Skip to content

Commit ea95fe8

Browse files
authored
Merge pull request #6729 from AnalyticalGraphicsInc/htmlImageElementMaterial
Add HTMLImageElement for Material uniform
2 parents 0f0c293 + 4ef02ba commit ea95fe8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Change Log
2929
* Improved billboard and label rendering so they no longer sink into terrain when clamped to ground. [#6621](https://github.com/AnalyticalGraphicsInc/cesium/pull/6621)
3030
* Fixed an issue where KMLs containing a `colorMode` of `random` could return the exact same color on successive calls to `Color.fromRandom()`.
3131
* `Iso8601.MAXIMUM_VALUE` now formats to a string which can be parsed by `fromIso8601`.
32+
* Fixed material support when using an image that is already loaded [#6729](https://github.com/AnalyticalGraphicsInc/cesium/pull/6729)
3233

3334
### 1.46.1 - 2018-06-01
3435

Source/Scene/Material.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ define([
813813
image: image
814814
});
815815
});
816-
} else if (uniformValue instanceof HTMLCanvasElement) {
816+
} else if (uniformValue instanceof HTMLCanvasElement || uniformValue instanceof HTMLImageElement) {
817817
material._loadedImages.push({
818818
id: uniformId,
819819
image: uniformValue
@@ -971,7 +971,7 @@ define([
971971
uniformType = 'float';
972972
} else if (type === 'boolean') {
973973
uniformType = 'bool';
974-
} else if (type === 'string' || uniformValue instanceof Resource ||uniformValue instanceof HTMLCanvasElement) {
974+
} else if (type === 'string' || uniformValue instanceof Resource ||uniformValue instanceof HTMLCanvasElement || uniformValue instanceof HTMLImageElement) {
975975
if (/^([rgba]){1,4}$/i.test(uniformValue)) {
976976
uniformType = 'channels';
977977
} else if (uniformValue === Material.DefaultCubeMapId) {

0 commit comments

Comments
 (0)