You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kramv - fix display of images to match Figma/Photoshop
These apps do all filtering, blends, and premul in srgb space. This is totally wrong, but to match have to emulate it. The premul code applies the srgbToLinear conversion (not pow2.2) to the alpha before shader premul. pow2.2 is not a good approximation, with 20% of a black to white gradient not matching up. Note that kram already has isPremul and isPremulRGB. These correspond with linear and srgb premul to the texture. See below for how they differ.
sRGB data must be held in an RGBA8Unorm (not RGBAUnorm_srgb) buffer to emulate what these tools do. This is counter-intuitive. But premul is directl is then correlated between alpha and rgb. When premul is applied to srgb, the rgb values are < alpha even when rgb = 111 due to engamma of rgb. This affects fromPremul() calls which try to divide out the alpha.
isPremul:
res = srgbToLinear( srgb ) * a )
build and filter mips in linear space
res2 = linearToSrgb( res )
write out res2 to BC7_srgb
isPremulRGB:
res = srgb * a
build and filter mips in srgb space
write out res to BC7
// Display P3 is a standard made by Apple that covers the same colour space as DCI-P3, but uses the more neutral D65 as a white point instead of the green white of the DCI standard.
0 commit comments