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 14:46:18 +0400
committerTon Roosendaal <ton@blender.org>2013-04-28 14:46:18 +0400
commite355abebee14694837281ef8813a29d8ab97f4db (patch)
tree03de15a66c97162b6fcc710ab7983675a9c32d6e /intern/opencolorio
parent24a4e195cdec5ff9f07378bb8f26392173d41791 (diff)
This glsl shader works for OCIO with alpha. OSX iMac with ATI.
There's no logical reason I can find... but I commit it because many others have the same error, so we can check.
Diffstat (limited to 'intern/opencolorio')
-rw-r--r--intern/opencolorio/ocio_impl_glsl.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/intern/opencolorio/ocio_impl_glsl.cc b/intern/opencolorio/ocio_impl_glsl.cc
index 0c96a000b9e..3dbf7c9f7cb 100644
--- a/intern/opencolorio/ocio_impl_glsl.cc
+++ b/intern/opencolorio/ocio_impl_glsl.cc
@@ -92,18 +92,15 @@ static const char *g_fragShaderText = ""
"void main()\n"
"{\n"
" vec4 col = texture2D(tex1, gl_TexCoord[0].st);\n"
-" if (predivide == false || col[3] == 1.0 || col[3] == 0.0) {\n"
-" gl_FragColor = OCIODisplay(col, tex2);\n"
-" } else {\n"
-" float alpha = col[3];\n"
-" float inv_alpha = 1.0 / alpha;\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"
+"}\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"
+" gl_FragColor = OCIODisplay(col, tex2);\n"
"\n"
"}\n";