-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Standard material handles textures in sRGB format #6736
Conversation
[PIXELFORMAT_DXT1, { name: 'DXT1', blockSize: 8, srgb: true }], | ||
[PIXELFORMAT_DXT3, { name: 'DXT3', blockSize: 16, srgb: true }], | ||
[PIXELFORMAT_DXT5, { name: 'DXT5', blockSize: 16, srgb: true }], | ||
[PIXELFORMAT_ETC1, { name: 'ETC1', blockSize: 8, srgb: true }], | ||
[PIXELFORMAT_ETC2_RGB, { name: 'ETC2_RGB', blockSize: 8, srgb: true }], | ||
[PIXELFORMAT_ETC2_RGBA, { name: 'ETC2_RGBA', blockSize: 16, srgb: true }], | ||
[PIXELFORMAT_PVRTC_2BPP_RGB_1, { name: 'PVRTC_2BPP_RGB_1', blockSize: 8, srgb: true }], | ||
[PIXELFORMAT_PVRTC_2BPP_RGBA_1, { name: 'PVRTC_2BPP_RGBA_1', blockSize: 8, srgb: true }], | ||
[PIXELFORMAT_PVRTC_4BPP_RGB_1, { name: 'PVRTC_4BPP_RGB_1', blockSize: 8, srgb: true }], | ||
[PIXELFORMAT_PVRTC_4BPP_RGBA_1, { name: 'PVRTC_4BPP_RGBA_1', blockSize: 8, srgb: true }], | ||
[PIXELFORMAT_ASTC_4x4, { name: 'ASTC_4x4', blockSize: 16, srgb: true }], | ||
[PIXELFORMAT_ATC_RGB, { name: 'ATC_RGB', blockSize: 8, srgb: true }], | ||
[PIXELFORMAT_ATC_RGBA, { name: 'ATC_RGBA', blockSize: 16, srgb: true }], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, they're all SRGB all the time? Can't I have a linear normal map, say, using these compressed formats?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these we convert to linear manually.
Soon I'll add compressed texture formats stored in sRGB as well, separate PR.
RGB8
andRGBA8
formats, as they're the same but in addition handles sRGB conversion:Added support for SRGBA8 on WebGPU
When standard material uses a texture in sRGB space, we skip in-shader conversion of sRGB->linear, as sampling it gives us a linear value already.