X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=white_balance_effect.cpp;h=07c95cac4ca473b52dda9f9d80ddbf9fda918a52;hp=69759adfc6148379698998674109a5ae17213e4b;hb=f216b7bef5a968c89f6fc78e83cc26a91e504a8a;hpb=8c7e53028a3ef4805d2608643041a5d7e6bd1b6e diff --git a/white_balance_effect.cpp b/white_balance_effect.cpp index 69759ad..07c95ca 100644 --- a/white_balance_effect.cpp +++ b/white_balance_effect.cpp @@ -105,6 +105,7 @@ WhiteBalanceEffect::WhiteBalanceEffect() { register_vec3("neutral_color", (float *)&neutral_color); register_float("output_color_temperature", &output_color_temperature); + register_uniform_mat3("correction_matrix", &uniform_correction_matrix); } string WhiteBalanceEffect::output_fragment_shader() @@ -142,13 +143,12 @@ void WhiteBalanceEffect::set_gl_state(GLuint glsl_program_num, const string &pre * Note that since we postmultiply our vectors, the order of the matrices * has to be the opposite of the execution order. */ - Matrix3d corr_matrix = + uniform_correction_matrix = rgb_to_xyz_matrix.inverse() * Map(xyz_to_lms_matrix).inverse() * lms_scale.asDiagonal() * Map(xyz_to_lms_matrix) * rgb_to_xyz_matrix; - set_uniform_mat3(glsl_program_num, prefix, "correction_matrix", corr_matrix); } } // namespace movit