From 54fb6ee4b27fccd3d045cbbc9d46505e29d1beb6 Mon Sep 17 00:00:00 2001 From: rz5 Date: Mon, 18 Jul 2016 14:35:00 +0100 Subject: [PATCH] Update crt-hyllian.slang Cg/HLSL have row major matrices. In GLSL/slang shaders, we have to reverse the operand order around. This shader should now be completely fixed. --- crt/crt-hyllian.slang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crt/crt-hyllian.slang b/crt/crt-hyllian.slang index 8f82cab..06fc356 100644 --- a/crt/crt-hyllian.slang +++ b/crt/crt-hyllian.slang @@ -129,8 +129,8 @@ void main() mat4x3 color_matrix0 = mat4x3(c00, c01, c02, c03); mat4x3 color_matrix1 = mat4x3(c10, c11, c12, c13); - - vec4 invX_Px = invX * vec4(fp.x*fp.x*fp.x, fp.x*fp.x, fp.x, 1.0); + + vec4 invX_Px = vec4(fp.x*fp.x*fp.x, fp.x*fp.x, fp.x, 1.0) * invX; vec3 color0 = color_matrix0 * invX_Px; vec3 color1 = color_matrix1 * invX_Px;