]> git.tdb.fi Git - libs/gl.git/blobdiff - source/colorcurve.cpp
Use libmspmath to provide vector and matrix operations
[libs/gl.git] / source / colorcurve.cpp
index 95c82491740765bfe47d9f18dbe7e33ef0adfeaf..ae09b7e62a9b93da283a3918727e32c2cd9642d2 100644 (file)
@@ -21,12 +21,12 @@ static const char fragment_src[] =
        "               vec3 saturated = sample.rgb/maxc;\n"
        "               if(maxc>1.0+peak)\n"
        "               {\n"
-       "                       gl_FragColor.rgb = mix(vec3(1.0), saturated, 1.0/pow(brightness, maxc-1-peak));\n"
+       "                       gl_FragColor.rgb = mix(vec3(1.0), saturated, 1.0/pow(brightness, maxc-1.0-peak));\n"
        "               }\n"
        "               else\n"
        "               {\n"
        "                       float x = (1.0+peak-maxc)/(2.0*peak);\n"
-       "                       gl_FragColor.rgb = saturated.rgb*(1.0-peak+(1-x*x)*peak);\n"
+       "                       gl_FragColor.rgb = saturated.rgb*(1.0-peak+(1.0-x*x)*peak);\n"
        "               }\n"
        "               gl_FragColor.a = sample.a;\n"
        "       }\n"
@@ -43,8 +43,7 @@ ColorCurve::ColorCurve():
        quad(get_fullscreen_quad())
 {
        shprog.attach_shader(get_fullscreen_vertex_shader());
-       Shader *fs = new Shader(FRAGMENT_SHADER, fragment_src);
-       shprog.attach_shader_owned(fs);
+       shprog.attach_shader_owned(new FragmentShader(fragment_src));
        shprog.link();
 
        set_peak(0.2);