-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set texture sampler properties of ImageryLayer #5890
Changes from 22 commits
28d2921
4aff9c2
e80ba2b
c1e0e54
daa095f
cb90b62
b5fe609
2dd4fd3
b9b8ab7
722cd71
d5ccbb8
8d27fe1
3ec59b0
e5b9b61
47f66ba
88d3458
eb5ec0c
924dc1c
3d5bfaa
151f8fe
270c805
dbf8d3a
3d632cd
2a08e5d
c826ec9
356f677
d5cf453
cdc9045
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | ||
<meta name="description" content="Set the texture minification and magnification filters of an imagery layer."> | ||
<meta name="cesium-sandcastle-labels" content="Beginner, Tutorials, Showcases"> | ||
<title>Cesium Demo</title> | ||
<script type="text/javascript" src="../Sandcastle-header.js"></script> | ||
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script> | ||
<script type="text/javascript"> | ||
require.config({ | ||
baseUrl : '../../../Source', | ||
waitSeconds : 60 | ||
}); | ||
</script> | ||
</head> | ||
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> | ||
|
||
<style> | ||
@import url(../templates/bucket.css); | ||
|
||
#slider { | ||
position: absolute; | ||
left: 50%; | ||
top: 0px; | ||
background-color: #D3D3D3; | ||
width: 2px; | ||
height: 100%; | ||
z-index: 9999; | ||
} | ||
|
||
#slider:hover { | ||
cursor: ew-resize; | ||
} | ||
|
||
</style> | ||
|
||
<div id="cesiumContainer" class="fullSize"> | ||
<div id="slider"></div> | ||
</div> | ||
<div id="loadingOverlay"><h1>Loading...</h1></div> | ||
<div id="toolbar"></div> | ||
|
||
<script id="cesium_sandcastle_script"> | ||
|
||
|
||
function startup(Cesium) { | ||
'use strict'; | ||
//Sandcastle_Begin | ||
var viewer = new Cesium.Viewer('cesiumContainer'); | ||
viewer.camera.flyTo({destination : new Cesium.Rectangle.fromDegrees(-84, 43, -80, 47)}); | ||
|
||
var layers = viewer.imageryLayers; | ||
layers.removeAll(); | ||
|
||
var layerLinear = layers.addImageryProvider(Cesium.createTileMapServiceImageryProvider({ | ||
url : require.toUrl('Assets/Textures/NaturalEarthII') | ||
})); | ||
|
||
var layerNearest = layers.addImageryProvider(Cesium.createTileMapServiceImageryProvider({ | ||
url : require.toUrl('Assets/Textures/NaturalEarthII') | ||
})); | ||
|
||
// Set the texture minification and magnification filters of layerNearest. Default is LINEAR. | ||
layerNearest.minificationFilter = Cesium.TextureMinificationFilter.NEAREST; | ||
layerNearest.magnificationFilter = Cesium.TextureMagnificationFilter.NEAREST; | ||
|
||
// The remaining code installs a split layer so the effect of the texture filters becomes apparent. | ||
|
||
layerNearest.splitDirection = Cesium.ImagerySplitDirection.RIGHT; | ||
|
||
var slider = document.getElementById('slider'); | ||
viewer.scene.imagerySplitPosition = (slider.offsetLeft) / slider.parentElement.offsetWidth; | ||
|
||
var dragStartX = 0; | ||
|
||
document.getElementById('slider').addEventListener('mousedown', mouseDown, false); | ||
window.addEventListener('mouseup', mouseUp, false); | ||
|
||
function mouseUp() { | ||
window.removeEventListener('mousemove', sliderMove, true); | ||
} | ||
|
||
function mouseDown(e) { | ||
var slider = document.getElementById('slider'); | ||
dragStartX = e.clientX - slider.offsetLeft; | ||
window.addEventListener('mousemove', sliderMove, true); | ||
} | ||
|
||
function sliderMove(e) { | ||
var slider = document.getElementById('slider'); | ||
var splitPosition = (e.clientX - dragStartX) / slider.parentElement.offsetWidth; | ||
slider.style.left = 100.0 * splitPosition + "%"; | ||
viewer.scene.imagerySplitPosition = splitPosition; | ||
} | ||
//Sandcastle_End | ||
|
||
Sandcastle.finishedLoading(); | ||
} | ||
if (typeof Cesium !== "undefined") { | ||
startup(Cesium); | ||
} else if (typeof require === "function") { | ||
require(["Cesium"], startup); | ||
} | ||
</script> | ||
|
||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,38 @@ define([ | |
'use strict'; | ||
|
||
/** | ||
* @private | ||
* Enumerates all possible filters used when magnifying WebGL textures, which takes places when zooming | ||
* into imagery. Provides the possible values for the {@link ImageryLayer#magnificationFilter} property. | ||
* | ||
* @exports TextureMagnificationFilter | ||
* | ||
* @see TextureMinificationFilter | ||
* @see ImageryLayer#magnificationFilter | ||
*/ | ||
var TextureMagnificationFilter = { | ||
/** | ||
* Nearest neighbor sampling of image pixels to texture. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this file and below, try to avoid providing reference doc that is just a repeat of the enum. @lilleyse could you add a tad more description and trade offs, e.g., visual quality vs speed? |
||
* | ||
* @type {Number} | ||
* @constant | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For each of these also add
|
||
NEAREST : WebGLConstants.NEAREST, | ||
/** | ||
* Bi-linear interpolation of image pixels to texture. | ||
* | ||
* @type {Number} | ||
* @constant | ||
*/ | ||
LINEAR : WebGLConstants.LINEAR, | ||
|
||
/** | ||
* Validates the given <code>textureMinificationFilter</code> with respect to the possible enum values. | ||
* | ||
* @private | ||
* | ||
* @param textureMagnificationFilter | ||
* @returns {Boolean} <code>true</code> if <code>textureMagnificationFilter</code> is valid. | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
validate : function(textureMagnificationFilter) { | ||
return ((textureMagnificationFilter === TextureMagnificationFilter.NEAREST) || | ||
(textureMagnificationFilter === TextureMagnificationFilter.LINEAR)); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,16 +7,66 @@ define([ | |
'use strict'; | ||
|
||
/** | ||
* @private | ||
* Enumerates all possible filters used when minifying WebGL textures, which takes places when zooming | ||
* out of imagery. Provides the possible values for the {@link ImageryLayer#minificationFilter} property. | ||
* | ||
* @exports TextureMinificationFilter | ||
* | ||
* @see TextureMagnificationFilter | ||
* @see ImageryLayer#minificationFilter | ||
*/ | ||
var TextureMinificationFilter = { | ||
/** | ||
* Nearest neighbor sampling of image pixels to texture. | ||
* | ||
* @type {Number} | ||
* @constant | ||
*/ | ||
NEAREST : WebGLConstants.NEAREST, | ||
/** | ||
* Bi-linear interpolation of image pixels to texture. | ||
* | ||
* @type {Number} | ||
* @constant | ||
*/ | ||
LINEAR : WebGLConstants.LINEAR, | ||
/** | ||
* WebGL <code>NEAREST_MIPMAP_NEAREST</code> interpolation of image pixels to texture. | ||
* | ||
* @type {Number} | ||
* @constant | ||
*/ | ||
NEAREST_MIPMAP_NEAREST : WebGLConstants.NEAREST_MIPMAP_NEAREST, | ||
/** | ||
* WebGL <code>LINEAR_MIPMAP_NEAREST</code> interpolation of image pixels to texture. | ||
* | ||
* @type {Number} | ||
* @constant | ||
*/ | ||
LINEAR_MIPMAP_NEAREST : WebGLConstants.LINEAR_MIPMAP_NEAREST, | ||
/** | ||
* WebGL <code>NEAREST_MIPMAP_LINEAR</code> interpolation of image pixels to texture. | ||
* | ||
* @type {Number} | ||
* @constant | ||
*/ | ||
NEAREST_MIPMAP_LINEAR : WebGLConstants.NEAREST_MIPMAP_LINEAR, | ||
/** | ||
* WebGL <code>LINEAR_MIPMAP_LINEAR</code> interpolation of image pixels to texture. | ||
* | ||
* @type {Number} | ||
* @constant | ||
*/ | ||
LINEAR_MIPMAP_LINEAR : WebGLConstants.LINEAR_MIPMAP_LINEAR, | ||
|
||
/** | ||
* Validates the given <code>textureMinificationFilter</code> with respect to the possible enum values. | ||
* | ||
* @private | ||
* | ||
* @param textureMinificationFilter | ||
* @returns {Boolean} <code>true</code> if <code>textureMinificationFilter</code> is valid. | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comments for this section as above. |
||
validate : function(textureMinificationFilter) { | ||
return ((textureMinificationFilter === TextureMinificationFilter.NEAREST) || | ||
(textureMinificationFilter === TextureMinificationFilter.LINEAR) || | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,6 +136,14 @@ define([ | |
* the gamma value to use for the tile. The function is executed for every | ||
* frame and for every tile, so it must be fast. | ||
* @param {ImagerySplitDirection|Function} [options.splitDirection=ImagerySplitDirection.NONE] The {@link ImagerySplitDirection} split to apply to this layer. | ||
* @param {TextureMinificationFilter} [options.minificationFilter=TextureMinificationFilter.LINEAR] The | ||
* texture minification filter to apply to this layer. Possible values | ||
* are <code>TextureMinificationFilter.LINEAR</code> and | ||
* <code>TextureMinificationFilter.NEAREST</code>. | ||
* @param {TextureMagnificationFilter} [options.magnificationFilter=TextureMagnificationFilter.LINEAR] The | ||
* texture minification filter to apply to this layer. Possible values | ||
* are <code>TextureMagnificationFilter.LINEAR</code> and | ||
* <code>TextureMagnificationFilter.NEAREST</code>. | ||
* @param {Boolean} [options.show=true] True if the layer is shown; otherwise, false. | ||
* @param {Number} [options.maximumAnisotropy=maximum supported] The maximum anisotropy level to use | ||
* for texture filtering. If this parameter is not specified, the maximum anisotropy supported | ||
|
@@ -211,6 +219,32 @@ define([ | |
*/ | ||
this.splitDirection = defaultValue(options.splitDirection, defaultValue(imageryProvider.defaultSplit, ImageryLayer.DEFAULT_SPLIT)); | ||
|
||
/** | ||
* The {@link TextureMinificationFilter} to apply to this layer. | ||
* Possible values are {@link TextureMinificationFilter.LINEAR} (the default) | ||
* and {@link TextureMinificationFilter.NEAREST}. | ||
* | ||
* To take effect, this property must be set immediately after adding the imagery layer. | ||
* Once a texture is loaded it won't be possible to change the texture filter used. | ||
* | ||
* @type {TextureMinificationFilter} | ||
* @default {@link ImageryLayer.DEFAULT_MINIFICATION_FILTER} | ||
*/ | ||
this.minificationFilter = defaultValue(options.minificationFilter, defaultValue(imageryProvider.defaultMinificationFilter, ImageryLayer.DEFAULT_MINIFICATION_FILTER)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you mean to add Probably fine to not have it, but up to you. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't sure if I should add them, because |
||
|
||
/** | ||
* The {@link TextureMagnificationFilter} to apply to this layer. | ||
* Possible values are {@link TextureMagnificationFilter.LINEAR} (the default) | ||
* and {@link TextureMagnificationFilter.NEAREST}. | ||
* | ||
* To take effect, this property must be set immediately after adding the imagery layer. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an important comment since I do not believe we ever create mipmaps for imagery tiles since the mipmapping is basically implicit in the tileset. Is this ever validated? A |
||
* Once a texture is loaded it won't be possible to change the texture filter used. | ||
* | ||
* @type {TextureMagnificationFilter} | ||
* @default {@link ImageryLayer.DEFAULT_MAGNIFICATION_FILTER} | ||
*/ | ||
this.magnificationFilter = defaultValue(options.magnificationFilter, defaultValue(imageryProvider.defaultMagnificationFilter, ImageryLayer.DEFAULT_MAGNIFICATION_FILTER)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be noted somewhere that these values can be set immediately after adding the imagery layer but once a texture is loaded it won't be possible to change its filter. |
||
|
||
/** | ||
* Determines if this layer is shown. | ||
* | ||
|
@@ -309,13 +343,29 @@ define([ | |
ImageryLayer.DEFAULT_GAMMA = 1.0; | ||
|
||
/** | ||
* This value is used as the default spliat for the imagery layer if one is not provided during construction | ||
* This value is used as the default split for the imagery layer if one is not provided during construction | ||
* or by the imagery provider. | ||
* @type {ImagerySplitDirection} | ||
* @default ImagerySplitDirection.NONE | ||
*/ | ||
ImageryLayer.DEFAULT_SPLIT = ImagerySplitDirection.NONE; | ||
|
||
/** | ||
* This value is used as the default texture minification filter for the imagery layer if one is not provided | ||
* during construction or by the imagery provider. | ||
* @type {TextureMinificationFilter} | ||
* @default TextureMinificationFilter.LINEAR | ||
*/ | ||
ImageryLayer.DEFAULT_MINIFICATION_FILTER = TextureMinificationFilter.LINEAR; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency with the rest of the code, |
||
|
||
/** | ||
* This value is used as the default texture magnification filter for the imagery layer if one is not provided | ||
* during construction or by the imagery provider. | ||
* @type {TextureMagnificationFilter} | ||
* @default TextureMagnificationFilter.LINEAR | ||
*/ | ||
ImageryLayer.DEFAULT_MAGNIFICATION_FILTER = TextureMagnificationFilter.LINEAR; | ||
|
||
/** | ||
* Gets a value indicating whether this layer is the base layer in the | ||
* {@link ImageryLayerCollection}. The base layer is the one that underlies all | ||
|
@@ -764,6 +814,11 @@ define([ | |
} | ||
} | ||
|
||
var sampler = new Sampler({ | ||
minificationFilter : this.minificationFilter, | ||
magnificationFilter : this.magnificationFilter | ||
}); | ||
|
||
// Imagery does not need to be discarded, so upload it to WebGL. | ||
var texture; | ||
if (defined(image.internalFormat)) { | ||
|
@@ -774,13 +829,15 @@ define([ | |
height : image.height, | ||
source : { | ||
arrayBufferView : image.bufferView | ||
} | ||
}, | ||
sampler : sampler | ||
}); | ||
} else { | ||
texture = new Texture({ | ||
context : context, | ||
source : image, | ||
pixelFormat : imageryProvider.hasAlphaChannel ? PixelFormat.RGBA : PixelFormat.RGB | ||
pixelFormat : imageryProvider.hasAlphaChannel ? PixelFormat.RGBA : PixelFormat.RGB, | ||
sampler : sampler | ||
}); | ||
} | ||
|
||
|
@@ -793,30 +850,53 @@ define([ | |
imagery.state = ImageryState.TEXTURE_LOADED; | ||
}; | ||
|
||
function getSamplerKey(minificationFilter, magnificationFilter, maximumAnisotropy) { | ||
return minificationFilter + ':' + magnificationFilter + ':' + maximumAnisotropy; | ||
} | ||
|
||
function finalizeReprojectTexture(imageryLayer, context, imagery, texture) { | ||
// Use mipmaps if this texture has power-of-two dimensions. | ||
if (!PixelFormat.isCompressedFormat(texture.pixelFormat) && CesiumMath.isPowerOfTwo(texture.width) && CesiumMath.isPowerOfTwo(texture.height)) { | ||
var mipmapSampler = context.cache.imageryLayer_mipmapSampler; | ||
var minificationFilter = imageryLayer.minificationFilter; | ||
var magnificationFilter = imageryLayer.magnificationFilter; | ||
var usesLinearTextureFilter = minificationFilter === TextureMinificationFilter.LINEAR && magnificationFilter === TextureMagnificationFilter.LINEAR; | ||
// Use mipmaps if this texture uses linear filters and has power-of-two dimensions. | ||
if (usesLinearTextureFilter && !PixelFormat.isCompressedFormat(texture.pixelFormat) && CesiumMath.isPowerOfTwo(texture.width) && CesiumMath.isPowerOfTwo(texture.height)) { | ||
if (minificationFilter === TextureMinificationFilter.NEAREST) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The check for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oops |
||
minificationFilter = TextureMinificationFilter.NEAREST_MIPMAP_NEAREST; | ||
} else if (minificationFilter === TextureMinificationFilter.LINEAR) { | ||
minificationFilter = TextureMinificationFilter.LINEAR_MIPMAP_LINEAR; | ||
} | ||
var maximumSupportedAnisotropy = ContextLimits.maximumTextureFilterAnisotropy; | ||
var maximumAnisotropy = Math.min(maximumSupportedAnisotropy, defaultValue(imageryLayer._maximumAnisotropy, maximumSupportedAnisotropy)); | ||
var mipmapSamplerKey = getSamplerKey(minificationFilter, magnificationFilter, maximumAnisotropy); | ||
var mipmapSamplers = context.cache.imageryLayerMipmapSamplers; | ||
var mipmapSampler = mipmapSamplers && mipmapSamplers[mipmapSamplerKey]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We usually try to be more explicit about checking if something is undefined. The section could be written slightly differently to be a bit more conformant with the rest of the code:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will change this, thanks! |
||
if (!defined(mipmapSampler)) { | ||
var maximumSupportedAnisotropy = ContextLimits.maximumTextureFilterAnisotropy; | ||
mipmapSampler = context.cache.imageryLayer_mipmapSampler = new Sampler({ | ||
if (!defined(mipmapSamplers)) { | ||
mipmapSamplers = context.cache.imageryLayerMipmapSamplers = {}; | ||
} | ||
mipmapSampler = mipmapSamplers[mipmapSamplerKey] = new Sampler({ | ||
wrapS : TextureWrap.CLAMP_TO_EDGE, | ||
wrapT : TextureWrap.CLAMP_TO_EDGE, | ||
minificationFilter : TextureMinificationFilter.LINEAR_MIPMAP_LINEAR, | ||
magnificationFilter : TextureMagnificationFilter.LINEAR, | ||
maximumAnisotropy : Math.min(maximumSupportedAnisotropy, defaultValue(imageryLayer._maximumAnisotropy, maximumSupportedAnisotropy)) | ||
minificationFilter : minificationFilter, | ||
magnificationFilter : magnificationFilter, | ||
maximumAnisotropy : maximumAnisotropy | ||
}); | ||
} | ||
texture.generateMipmap(MipmapHint.NICEST); | ||
texture.sampler = mipmapSampler; | ||
} else { | ||
var nonMipmapSampler = context.cache.imageryLayer_nonMipmapSampler; | ||
var nonMipmapSamplerKey = getSamplerKey(minificationFilter, magnificationFilter, 0); | ||
var nonMipmapSamplers = context.cache.imageryLayerNonMipmapSamplers; | ||
var nonMipmapSampler = nonMipmapSamplers && nonMipmapSamplers[nonMipmapSamplerKey]; | ||
if (!defined(nonMipmapSampler)) { | ||
nonMipmapSampler = context.cache.imageryLayer_nonMipmapSampler = new Sampler({ | ||
if (!defined(nonMipmapSamplers)) { | ||
nonMipmapSamplers = context.cache.imageryLayerNonMipmapSamplers = {}; | ||
} | ||
nonMipmapSampler = nonMipmapSamplers[nonMipmapSamplerKey] = new Sampler({ | ||
wrapS : TextureWrap.CLAMP_TO_EDGE, | ||
wrapT : TextureWrap.CLAMP_TO_EDGE, | ||
minificationFilter : TextureMinificationFilter.LINEAR, | ||
magnificationFilter : TextureMagnificationFilter.LINEAR | ||
minificationFilter : minificationFilter, | ||
magnificationFilter : magnificationFilter | ||
}); | ||
} | ||
texture.sampler = nonMipmapSampler; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ defineSuite([ | |
'Core/Rectangle', | ||
'Core/RequestScheduler', | ||
'Renderer/ComputeEngine', | ||
'Renderer/TextureMagnificationFilter', | ||
'Renderer/TextureMinificationFilter', | ||
'Scene/ArcGisMapServerImageryProvider', | ||
'Scene/BingMapsImageryProvider', | ||
'Scene/createTileMapServiceImageryProvider', | ||
|
@@ -30,6 +32,8 @@ defineSuite([ | |
Rectangle, | ||
RequestScheduler, | ||
ComputeEngine, | ||
TextureMagnificationFilter, | ||
TextureMinificationFilter, | ||
ArcGisMapServerImageryProvider, | ||
BingMapsImageryProvider, | ||
createTileMapServiceImageryProvider, | ||
|
@@ -367,6 +371,41 @@ defineSuite([ | |
expect(layer.isDestroyed()).toEqual(true); | ||
}); | ||
|
||
it('allows setting texture filter properties', function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lilleyse are these tests sufficient? How is coverage? Should these also do a smokescreen render? |
||
var provider = new SingleTileImageryProvider({ | ||
url : 'Data/Images/Red16x16.png' | ||
}); | ||
|
||
// expect default LINEAR | ||
var layer = new ImageryLayer(provider); | ||
expect(layer.minificationFilter).toEqual(TextureMinificationFilter.LINEAR); | ||
expect(layer.magnificationFilter).toEqual(TextureMagnificationFilter.LINEAR); | ||
layer.destroy(); | ||
|
||
// change to NEAREST | ||
layer = new ImageryLayer(provider, { | ||
minificationFilter: TextureMinificationFilter.NEAREST, | ||
magnificationFilter: TextureMagnificationFilter.NEAREST | ||
}); | ||
expect(layer.minificationFilter).toEqual(TextureMinificationFilter.NEAREST); | ||
expect(layer.magnificationFilter).toEqual(TextureMagnificationFilter.NEAREST); | ||
layer.destroy(); | ||
}); | ||
|
||
it('uses default texture filter properties of ImageryProvider', function() { | ||
var provider = new SingleTileImageryProvider({ | ||
url : 'Data/Images/Red16x16.png' | ||
}); | ||
|
||
provider.defaultMinificationFilter = TextureMinificationFilter.NEAREST; | ||
provider.defaultMagnificationFilter = TextureMinificationFilter.NEAREST; | ||
|
||
var layer = new ImageryLayer(provider); | ||
expect(layer.minificationFilter).toEqual(TextureMinificationFilter.NEAREST); | ||
expect(layer.magnificationFilter).toEqual(TextureMagnificationFilter.NEAREST); | ||
layer.destroy(); | ||
}); | ||
|
||
it('returns HTTP status code information in TileProviderError', function() { | ||
// Web browsers unfortunately provide very little information about what went wrong when an Image fails | ||
// to load. But when an imagery provider is configured to use a TileDiscardPolicy, Cesium downloads the image | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lilleyse this
@see
- and the one inTextureMinificationFilter.js
- is not needed and not customary. Can you please remove in master?