Skip to content

Commit

Permalink
Do not use a texture pool for imagery textures.
Browse files Browse the repository at this point in the history
In current versions of Chrome, at least, using a common texture pool for
both directly-loaded imagery textures (not mipmapped) and for reprojected
imagery (mipmapped) causes mipmapping artifacts.  Higher mip levels of
some textures end up with old data (ie: textures from other parts of the
globe).  Using two texture pools instead of one would solve the problem,
but since we don't seem to be gaining much by the texture pooling anyway, I'm
just ripping it out in the name of simplicity.
  • Loading branch information
kring committed Mar 26, 2014
1 parent b0a87a7 commit 8f3c8a4
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Source/Scene/ImageryLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ define([
'./ImageryState',
'./TileImagery',
'./TerrainProvider',
'./TexturePool',
'../ThirdParty/when',
'../Shaders/ReprojectWebMercatorFS',
'../Shaders/ReprojectWebMercatorVS'
Expand Down Expand Up @@ -59,7 +58,6 @@ define([
ImageryState,
TileImagery,
TerrainProvider,
TexturePool,
when,
ReprojectWebMercatorFS,
ReprojectWebMercatorVS) {
Expand Down Expand Up @@ -234,7 +232,6 @@ define([
this._maximumAnisotropy = description.maximumAnisotropy;

this._imageryCache = {};
this._texturePool = new TexturePool();

this._skeletonPlaceholder = new TileImagery(Imagery.createPlaceholder(this));

Expand Down Expand Up @@ -366,8 +363,6 @@ define([
* imageryLayer = imageryLayer && imageryLayer.destroy();
*/
ImageryLayer.prototype.destroy = function() {
this._texturePool = this._texturePool && this._texturePool.destroy();

return destroyObject(this);
};

Expand Down Expand Up @@ -679,7 +674,7 @@ define([
}

// Imagery does not need to be discarded, so upload it to WebGL.
var texture = this._texturePool.createTexture2D(context, {
var texture = context.createTexture2D({
source : imagery.image
});

Expand Down Expand Up @@ -902,7 +897,7 @@ define([
var northMercatorY = 0.5 * Math.log((1 + sinLatitude) / (1 - sinLatitude));
uniformMap.oneOverMercatorHeight = 1.0 / (northMercatorY - southMercatorY);

var outputTexture = imageryLayer._texturePool.createTexture2D(context, {
var outputTexture = context.createTexture2D({
width : width,
height : height,
pixelFormat : texture.getPixelFormat(),
Expand Down

0 comments on commit 8f3c8a4

Please sign in to comment.