Skip to content

Commit

Permalink
Merge pull request #6729 from AnalyticalGraphicsInc/htmlImageElementM…
Browse files Browse the repository at this point in the history
…aterial

Add HTMLImageElement for Material uniform
  • Loading branch information
mramato authored Jun 26, 2018
2 parents 0f0c293 + 4ef02ba commit ea95fe8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Change Log
* Improved billboard and label rendering so they no longer sink into terrain when clamped to ground. [#6621](https://github.com/AnalyticalGraphicsInc/cesium/pull/6621)
* Fixed an issue where KMLs containing a `colorMode` of `random` could return the exact same color on successive calls to `Color.fromRandom()`.
* `Iso8601.MAXIMUM_VALUE` now formats to a string which can be parsed by `fromIso8601`.
* Fixed material support when using an image that is already loaded [#6729](https://github.com/AnalyticalGraphicsInc/cesium/pull/6729)

### 1.46.1 - 2018-06-01

Expand Down
4 changes: 2 additions & 2 deletions Source/Scene/Material.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ define([
image: image
});
});
} else if (uniformValue instanceof HTMLCanvasElement) {
} else if (uniformValue instanceof HTMLCanvasElement || uniformValue instanceof HTMLImageElement) {
material._loadedImages.push({
id: uniformId,
image: uniformValue
Expand Down Expand Up @@ -971,7 +971,7 @@ define([
uniformType = 'float';
} else if (type === 'boolean') {
uniformType = 'bool';
} else if (type === 'string' || uniformValue instanceof Resource ||uniformValue instanceof HTMLCanvasElement) {
} else if (type === 'string' || uniformValue instanceof Resource ||uniformValue instanceof HTMLCanvasElement || uniformValue instanceof HTMLImageElement) {
if (/^([rgba]){1,4}$/i.test(uniformValue)) {
uniformType = 'channels';
} else if (uniformValue === Material.DefaultCubeMapId) {
Expand Down

0 comments on commit ea95fe8

Please sign in to comment.