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

New GraphicsDevice.getRenderableHdrFormat function #5830

Merged
merged 2 commits into from
Nov 17, 2023
Merged

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Nov 17, 2023

New public API:

Screenshot 2023-11-17 at 14 02 58

New public constant: BlendState.ADDBLEND - predefined constant for additive blending

  • few small fixes
  • removed no longer needed WebglGraphicsDevice. getHdrFormat

* @returns {number|undefined} The first supported renderable HDR format or undefined if none is
* supported.
*/
getRenderableHdrFormat(formats = [PIXELFORMAT_111110F, PIXELFORMAT_RGBA16F, PIXELFORMAT_RGBA32F], filterable = true) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering whether for API simplicity whether it's better to just have:

const supported = device.isRenderable(PIXELFORMAT_111110F);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are optional parameters, and typically the user would not pass any, to get any format from smallest size to largest.

It's similar to the device creation where we specify GL1, GL2 and GPU array in any other. Simple to call without having to implement logic on the user side.

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 already call this function twice in this code, and one more time in follow up PR .. and it's convenient to not have to implement format logic at each place.

Co-authored-by: Will Eastcott <will@playcanvas.com>
@mvaligursky mvaligursky merged commit af8e9ad into main Nov 17, 2023
7 checks passed
@mvaligursky mvaligursky deleted the mv-hdr-format branch November 17, 2023 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants