Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2013-04-28 15:03:01 +0400
committerTon Roosendaal <ton@blender.org>2013-04-28 15:03:01 +0400
commiteae651db3acce0c45727189a7adef30c7f1740b2 (patch)
tree7501e98ce79cbe27178b2fa6f93c2940dbe045f8 /intern/opencolorio
parente355abebee14694837281ef8813a29d8ab97f4db (diff)
GLSL display of float buffers with alpha:
Previous version worked, now a version with simplifying this GLSL code.
Diffstat (limited to 'intern/opencolorio')
-rw-r--r--intern/opencolorio/ocio_impl_glsl.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/intern/opencolorio/ocio_impl_glsl.cc b/intern/opencolorio/ocio_impl_glsl.cc
index 3dbf7c9f7cb..9503b272752 100644
--- a/intern/opencolorio/ocio_impl_glsl.cc
+++ b/intern/opencolorio/ocio_impl_glsl.cc
@@ -92,14 +92,12 @@ static const char *g_fragShaderText = ""
"void main()\n"
"{\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"
" float inv_alpha = 1.0 / col[3];\n"
+" col[0] *= inv_alpha;\n"
+" col[1] *= inv_alpha;\n"
+" col[2] *= inv_alpha;\n"
"}\n"
-" col[0] *= inv_alpha;\n"
-" col[1] *= inv_alpha;\n"
-" col[2] *= inv_alpha;\n"
-"\n"
" gl_FragColor = OCIODisplay(col, tex2);\n"
"\n"
"}\n";