Skip to content
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

Fix Firefox warnings #6297

Merged
merged 19 commits into from
Apr 5, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Source/Scene/BatchTable.js
Original file line number Diff line number Diff line change
@@ -371,7 +371,8 @@ define([
sampler : new Sampler({
minificationFilter : TextureMinificationFilter.NEAREST,
magnificationFilter : TextureMagnificationFilter.NEAREST
})
}),
flipY : false
});
}

@@ -456,7 +457,7 @@ define([
' float numberOfAttributes = float('+ stride + '); \n' +
' float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); \n' +
' float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); \n' +
' return vec2(centerX + (xId * stepX), 1.0 - (centerY + (yId * stepY))); \n' +
' return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \n' +
'} \n';
}

3 changes: 2 additions & 1 deletion Source/Scene/GlobeSurfaceTile.js
Original file line number Diff line number Diff line change
@@ -668,7 +668,8 @@ define([
height : textureSize,
arrayBufferView : waterMask
},
sampler : waterMaskData.sampler
sampler : waterMaskData.sampler,
flipY : false
});

texture.referenceCount = 0;
22 changes: 6 additions & 16 deletions Source/Scene/OIT.js
Original file line number Diff line number Diff line change
@@ -111,29 +111,19 @@ define([
function updateTextures(oit, context, width, height) {
destroyTextures(oit);

// Use zeroed arraybuffer instead of null to initialize texture
// to workaround Firefox 50. https://github.com/AnalyticalGraphicsInc/cesium/pull/4762
var source = new Float32Array(width * height * 4);

oit._accumulationTexture = new Texture({
context : context,
width : width,
height : height,
pixelFormat : PixelFormat.RGBA,
pixelDatatype : PixelDatatype.FLOAT,
source : {
arrayBufferView : source,
width : width,
height : height
}
pixelDatatype : PixelDatatype.FLOAT
});
oit._revealageTexture = new Texture({
context : context,
width : width,
height : height,
pixelFormat : PixelFormat.RGBA,
pixelDatatype : PixelDatatype.FLOAT,
source : {
arrayBufferView : source,
width : width,
height : height
}
pixelDatatype : PixelDatatype.FLOAT
});
}

1 change: 1 addition & 0 deletions Source/Shaders/GlobeFS.glsl
Original file line number Diff line number Diff line change
@@ -183,6 +183,7 @@ void main()
vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;
vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;
vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;
waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;

float mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;