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

Fix Firefox warnings #6297

merged 19 commits into from
Apr 5, 2018

Conversation

bagnell
Copy link
Contributor

@bagnell bagnell commented Mar 1, 2018

Same as #5939 but also fixes the flipped water mask.

TODO

  • Add tests if existing tests do not cover all new code paths

@cesium-concierge
Copy link

Signed CLA is on file.

@bagnell, thanks for the pull request! Maintainers, we have a signed CLA from @bagnell, so you can review this at any time.

⚠️ I noticed that CHANGES.md has not been updated. If this change updates the public API in any way, fixes a bug, or makes any non-trivial update, please add a bullet point to CHANGES.md and comment on this pull request so we know it was updated. For more info, see the Pull Request Guidelines.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@bagnell
Copy link
Contributor Author

bagnell commented Mar 1, 2018

@lilleyse I fixed the water mask in 4c81e8c. The other option is to flip the array buffer source in Texture. It might be confusing to have the flipY option and the texture is never flipped unless the source is a DOM element.

@lilleyse
Copy link
Contributor

lilleyse commented Mar 1, 2018

Yeah maybe in Texture makes more sense.

Are there other textures besides water mask that are defaulting to flipy? And maybe we have more control to fix them.

@bagnell
Copy link
Contributor Author

bagnell commented Mar 1, 2018

Are there other textures besides water mask that are defaulting to flipy? And maybe we have more control to fix them.

I'm not sure. flipY defaults to true though. I'll add it to texture.

@lilleyse
Copy link
Contributor

lilleyse commented Mar 1, 2018

One example:

With Cesium3DTileBatchTable we can edit the 1.0 - in the shader and send in flipY : false, avoiding the flipping code completely.

We should try to find the other areas like this.

@@ -150,6 +150,7 @@ define([
// Many GPUs store RGB as RGBA internally
// https://devtalk.nvidia.com/default/topic/699479/general-graphics-programming/rgb-auto-converted-to-rgba/post/4142379/#4142379
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we return 3 now, should this comment be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised having it as 4 didn't cause any problems since we use this to create arrays. I guess we don't use RGB textures at all. I kept this there for now because I plan on moving it to a separate function (for when we measure GPU memory usage)

var textureWidth = width * numberOfComponents;
for (var i = 0; i < height; ++i) {
for (var j = 0; j < textureWidth; ++j) {
flipped[(height - i - 1) * height + j] = bufferView[i * height + j];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not factor (height - i - 1) * height and i * height out of the inter loop?

@pjcozzi
Copy link
Contributor

pjcozzi commented Mar 11, 2018

Added above:

[ ] Add tests if existing tests do not cover all new code paths

@bagnell
Copy link
Contributor Author

bagnell commented Mar 26, 2018

@lilleyse Can you look at Cesium3DTileBatchTable renders with featuresLength greater than maximumTextureSize test. It is the only remaining test that fails (causes others to fail by not resetting maximumTextureSize). The other tests were fixed in #6370.

The texture creation doesn't fail for the batch table, but when creating the BRDF LUT. How does this pass in master?

@bagnell
Copy link
Contributor Author

bagnell commented Mar 26, 2018

This is ready with the exception of that one failing test.

@lilleyse
Copy link
Contributor

The code looks good, but I still think we need to scrub through the code to avoid flipY as much as we can. For example hover over picking will repeatedly call the flip code and incur a bunch of overhead.

flipped

@lilleyse
Copy link
Contributor

Cesium3DTileBatchTable renders with featuresLength greater than maximumTextureSize test

I started to look into this...
If frameState.brdfLutGenerator.update(frameState); is commented out the test still fails. It passes when using gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); instead of the new flipY function so maybe there is something wrong there?

@bagnell
Copy link
Contributor Author

bagnell commented Mar 27, 2018

@lilleyse
Copy link
Contributor

lilleyse commented Apr 4, 2018

I looked around to see if any other areas could set flipY : false in addition to Cesium3DTileBatchTable. We can do it in:

  • BatchTable
  • OIT (unless we just remove the workaround in Firefox OIT fix #4762)
  • GlobeSurfaceTile for the water mask. We could invert the .y coordinate in GlobeFS instead.

@bagnell
Copy link
Contributor Author

bagnell commented Apr 5, 2018

@lilleyse Updated.

@bagnell
Copy link
Contributor Author

bagnell commented Apr 5, 2018

Fixes #4815.

@lilleyse
Copy link
Contributor

lilleyse commented Apr 5, 2018

Now I always see the warning:

Error: WebGL warning: drawElements: This operation requires zeroing texture data. This is slow.

I turned OIT off and it didn't appear. I guess we should continue to keep the OIT workaround code in #4762 and even close #4815.

@bagnell
Copy link
Contributor Author

bagnell commented Apr 5, 2018

@lilleyse Updated. Only the second color texture needed to be zeroed out. Seems like a Firefox bug.

@lilleyse
Copy link
Contributor

lilleyse commented Apr 5, 2018

Ok - looks good!

@lilleyse lilleyse merged commit 9259693 into master Apr 5, 2018
@lilleyse lilleyse deleted the warnings branch April 5, 2018 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants