[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56357] trunk/blender/intern/opencolorio/ ocio_impl_glsl.cc: GLSL display of float buffers with alpha:

Ton Roosendaal ton at blender.org
Sun Apr 28 13:03:02 CEST 2013


Revision: 56357
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56357
Author:   ton
Date:     2013-04-28 11:03:01 +0000 (Sun, 28 Apr 2013)
Log Message:
-----------
GLSL display of float buffers with alpha:
Previous version worked, now a version with simplifying this GLSL code.

Modified Paths:
--------------
    trunk/blender/intern/opencolorio/ocio_impl_glsl.cc

Modified: trunk/blender/intern/opencolorio/ocio_impl_glsl.cc
===================================================================
--- trunk/blender/intern/opencolorio/ocio_impl_glsl.cc	2013-04-28 10:46:18 UTC (rev 56356)
+++ trunk/blender/intern/opencolorio/ocio_impl_glsl.cc	2013-04-28 11:03:01 UTC (rev 56357)
@@ -92,14 +92,12 @@
 "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";




More information about the Bf-blender-cvs mailing list