Skip to content

Commit

Permalink
fix primaries conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
UjinT34 committed Mar 5, 2025
1 parent 58cb7e7 commit ecb62f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/render/shaders/CM.frag
Original file line number Diff line number Diff line change
Expand Up @@ -280,17 +280,17 @@ mat3 primaries2xyz(mat4x2 primaries) {
vec3 b = xy2xyz(primaries[2]);
vec3 w = xy2xyz(primaries[3]);

mat3 invMat = transpose(inverse(
mat3 invMat = inverse(
mat3(r, g, b)
));
);

vec3 s = invMat * w;

return mat3(r * s, g * s, b * s);
return transpose(mat3(r * s, g * s, b * s));
}

vec4 convertPrimaries(vec4 color, mat3 src, mat3 dst) {
mat3 convMat = transpose(src * inverse(dst));
mat3 convMat = src * inverse(dst);
return vec4(convMat * color.rgb, color[3]);
}

Expand Down

0 comments on commit ecb62f2

Please sign in to comment.