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

CompressedTexture: Add more ASTC formats. #18771

Merged
merged 2 commits into from
Feb 28, 2020
Merged

CompressedTexture: Add more ASTC formats. #18771

merged 2 commits into from
Feb 28, 2020

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Feb 28, 2020

Fixed #18764.

@YorickCobb 37847 should now be recognized as SRGB8_ALPHA8_ASTC_8x8_Format. Does the PR look good to you?

@YorickCobb
Copy link

Works perfect 👍

@donmccurdy
Copy link
Collaborator

How do the sRGB formats work in conjunction with texture.encoding? Would you also set texture.encoding = THREE.sRGBEncoding on a texture using SRGB8_ALPHA8_ASTC_8x8_Format, or is the sRGB->linear step done by WebGL?

@YorickCobb
Copy link

You still have to set texture.encoding for it to render correctly, but I humbly suggest that this is the correct behavior. AFAIK sRGB-encoded PNGs for example still default to linear encoding, so it would be inconsistent if ASTCs/any other specific format didn't also respect the default. The advantage in sRGB-encoded textures is that the bit depth is spread out more usefully, so this doesn't make the distinction useless or anything.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Feb 28, 2020

or is the sRGB->linear step done by WebGL?

EXT_sRGB is for this use case. In WebGL 2 you can use the respective formats without the extension.

When defining the internal format of a texture as e.g. gl.SRGB8, the texture will be automatically converted to linear space when being fetched in the shader. This is of course more performant than doing the color space conversion manually.

@mrdoob mrdoob added this to the r114 milestone Feb 28, 2020
@mrdoob mrdoob merged commit 7715d96 into mrdoob:dev Feb 28, 2020
@mrdoob
Copy link
Owner

mrdoob commented Feb 28, 2020

Thanks!

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.

sRGB ASTC formats not supported
4 participants