diff options
Diffstat (limited to 'graphics/opengl/program_manager.cpp')
-rw-r--r-- | graphics/opengl/program_manager.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/graphics/opengl/program_manager.cpp b/graphics/opengl/program_manager.cpp index 5178428a4a..bd9cc2655c 100644 --- a/graphics/opengl/program_manager.cpp +++ b/graphics/opengl/program_manager.cpp @@ -68,8 +68,23 @@ namespace graphics "}\n"; m_frgShaders[EFrgNoAlphaTest].reset(new Shader(noAlphaTestFrgSrc, EFragmentShader)); + static const char uniformAlfaFrgSrc[] = + "uniform sampler2D Sampler0;\n" + "uniform " PRECISION " float Transparency;\n" + "varying " PRECISION " vec2 TexCoordOut0;\n" + "void main(void) {\n" + " " PRECISION " vec4 color = texture2D(Sampler0, TexCoordOut0);\n" + " " PRECISION " float t = color.a;\n" + " if (t > Transparency)\n" + " t = Transparency;\n" + " gl_FragColor = vec4(color.rgb, t);\n" + "}\n"; + + m_frgShaders[EFrgVarAlfa].reset(new Shader(uniformAlfaFrgSrc, EFragmentShader)); + getProgram(EVxTextured, EFrgAlphaTest); getProgram(EVxTextured, EFrgNoAlphaTest); + getProgram(EVxTextured, EFrgVarAlfa); getProgram(EVxSharp, EFrgAlphaTest); getProgram(EVxSharp, EFrgNoAlphaTest); |