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

Add support for linear filtering of floating point textures. #6943

Merged
merged 5 commits into from
Sep 11, 2018

Conversation

bagnell
Copy link
Contributor

@bagnell bagnell commented Aug 20, 2018

Textures can now have any of the linear options for the minification and magnification filter when the extensions are available. Otherwise, the filtering defaults to nearest.

This was pulled from the hdr branch.

CHANGES.md was not updated. All of the modifications are at the Renderer level.

@cesium-concierge
Copy link

Thanks for the pull request @bagnell!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

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

🌍 🌎 🌏

@bagnell bagnell mentioned this pull request Sep 6, 2018
4 tasks
@bagnell
Copy link
Contributor Author

bagnell commented Sep 6, 2018

Bump.

@mramato
Copy link
Contributor

mramato commented Sep 6, 2018

Who is best to review this? @ggetz @likangning93 @lilleyse

Copy link
Contributor

@lilleyse lilleyse left a comment

Choose a reason for hiding this comment

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

Looks good, just a couple small comments about the tests.

}
});

it('creates a cube map with half floating-point textures and linear filtering', function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like creates a cube map with half floating-point textures and creates a cube map with half floating-point textures and linear filtering are actually testing the opposite thing, should the titles be swapped?

}
};

if (!context.textureFloatLinear) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be textureHalfFloatLinear?

this._textureFloat = !!getExtension(gl, ['OES_texture_float']);
this._textureHalfFloat = !!getExtension(gl, ['OES_texture_half_float']);

this._textureFloatLinear = !!getExtension(gl, ['OES_texture_float_linear']);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does anything need to be taken into account for WebGL 1 vs. 2?

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 assuming that the extension is still required for WebGL 2. I couldn't find anything in the spec that says it isn't allowed in WebGL 2; however, I do see the extension for OES_texture_float_linear under the WebGL 2 tab at webglreport.com. Also, I don't see the extension for OES_texture_half_float_linear in the WebGL 2 tab, but I do see it under the WebGL 1 tab.

Copy link
Contributor

Choose a reason for hiding this comment

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

According to MDN it is both a WebGL 1 and 2 extension.
https://developer.mozilla.org/en-US/docs/Web/API/OES_texture_float_linear

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And OES_texture_half_float_linear is gone under WebGL 2 and it's included with OES_texture_float_linear. (Similar to what they did for floating-point color buffer attachments)

Copy link
Contributor

@lilleyse lilleyse Sep 11, 2018

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@bagnell bagnell Sep 11, 2018

Choose a reason for hiding this comment

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

I guess so. The WebGL 2 conformance tests have a check to make sure that extension isn't available in WebGL 2:
https://github.com/KhronosGroup/WebGL/blob/master/conformance-suites/2.0.0/conformance2/extensions/promoted-extensions.html#L59

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 9, 2018

Looks good at quick glance.

@bagnell
Copy link
Contributor Author

bagnell commented Sep 11, 2018

@lilleyse @pjcozzi Updated.

@lilleyse
Copy link
Contributor

Looks good, thanks @bagnell.

@lilleyse lilleyse merged commit 4607a19 into master Sep 11, 2018
@lilleyse lilleyse deleted the float-linear branch September 11, 2018 20:47
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