Image sources (like JPEG) are typically non-linearly encoded, e.g. with sRGB.
Using copyExternalImageToTexture, these non-linear values can be uploaded into:
- e.g.
rgba8unorm, if the application wants to sample the original values
- e.g.
rgba8unorm-srgb, if the application wants to sample linear values (e.g. for linear rendering pipelines).
EDIT: probably only if the destination color space is srgb-encoded [1], and not premultiplied [2])
However in order to store actual linear values in the texture (in particular with formats like rgba16float), currently applications would need to perform the conversion themselves (either on CPU + writeTexture, or in a compute/fragment shader).
A destination color-space option on copyExternalImageToTexture (soon to be added) would provide a place for users to control the upload: instead of srgb, they could specify srgb-linear, which is the same color space but linearly encoded.
Image sources (like JPEG) are typically non-linearly encoded, e.g. with sRGB.
Using
copyExternalImageToTexture, these non-linear values can be uploaded into:rgba8unorm, if the application wants to sample the original valuesrgba8unorm-srgb, if the application wants to sample linear values (e.g. for linear rendering pipelines).EDIT: probably only if the destination color space is srgb-encoded [1], and not premultiplied [2])
However in order to store actual linear values in the texture (in particular with formats like
rgba16float), currently applications would need to perform the conversion themselves (either on CPU + writeTexture, or in a compute/fragment shader).A destination color-space option on
copyExternalImageToTexture(soon to be added) would provide a place for users to control the upload: instead ofsrgb, they could specifysrgb-linear, which is the same color space but linearly encoded.