GLSL display of float buffers with alpha:
Previous version worked, now a version with simplifying this GLSL code.
This commit is contained in:
@@ -92,14 +92,12 @@ static const char *g_fragShaderText = ""
|
|||||||
"void main()\n"
|
"void main()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" vec4 col = texture2D(tex1, gl_TexCoord[0].st);\n"
|
" vec4 col = texture2D(tex1, gl_TexCoord[0].st);\n"
|
||||||
" float inv_alpha = 1.0;"
|
|
||||||
" if (predivide == false || col[3] <= 0.0 || col[3] >= 1.0) {\n"
|
" if (predivide == false || col[3] <= 0.0 || col[3] >= 1.0) {\n"
|
||||||
" float inv_alpha = 1.0 / col[3];\n"
|
" float inv_alpha = 1.0 / col[3];\n"
|
||||||
|
" col[0] *= inv_alpha;\n"
|
||||||
|
" col[1] *= inv_alpha;\n"
|
||||||
|
" col[2] *= inv_alpha;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
" col[0] *= inv_alpha;\n"
|
|
||||||
" col[1] *= inv_alpha;\n"
|
|
||||||
" col[2] *= inv_alpha;\n"
|
|
||||||
"\n"
|
|
||||||
" gl_FragColor = OCIODisplay(col, tex2);\n"
|
" gl_FragColor = OCIODisplay(col, tex2);\n"
|
||||||
"\n"
|
"\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
Reference in New Issue
Block a user