How to change hue of a texture with GLSL?

后端 未结 2 854
梦毁少年i
梦毁少年i 2020-12-04 15:09

Is there a way to efficiently change hue of a 2D OpenGL texture using GLSL (fragment shader)?

Do someone have some code for it?

UPDATE: This

2条回答
  •  不知归路
    2020-12-04 15:24

    Andrea3000, in comparing YIQ examples on the net, i came across your posting, but i think there is an issue with the 'updated' version of your code.... i'm sure your 'mat3' definitions are flip/flopped on the column/row ordering... (maybe that's why you were still having troubles)...

    FYI: OpenGL matrix ordering: "For more values, matrices are filled in in column-major order. That is, the first X values are the first column, the second X values are the next column, and so forth." See: http://www.opengl.org/wiki/GLSL_Types

    mat2(
    float, float,   //first column
    float, float);  //second column
    

提交回复
热议问题