X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcolorcurve.cpp;h=ae09b7e62a9b93da283a3918727e32c2cd9642d2;hb=46921b54c8252bb535a3b2cb7be97eb38e66eaed;hp=95c82491740765bfe47d9f18dbe7e33ef0adfeaf;hpb=9a54442d865974ac8785988e7e740480e72ab24c;p=libs%2Fgl.git diff --git a/source/colorcurve.cpp b/source/colorcurve.cpp index 95c82491..ae09b7e6 100644 --- a/source/colorcurve.cpp +++ b/source/colorcurve.cpp @@ -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);