Salome HOME
bos #23995 Fix problem with rendering transparent texture as background in VTK scene
[modules/gui.git] / src / VTKViewer / resources / Background.fs.glsl
1 #version 130
2
3 #if (__VERSION__ >= 130)
4   out vec4 outColor;
5   #define Texture2D texture
6 #else
7   #define outColor gl_FragColor
8   #define Texture2D texture2D
9 #endif
10
11 uniform int       uUseTexture;
12 uniform sampler2D uBackgroundTexture;
13
14 in vec4[2] VSColor;
15 void main()
16 {
17   if (uUseTexture == 1)
18   {
19     outColor = Texture2D(uBackgroundTexture, VSColor[0].xy);
20     outColor = (outColor * outColor.a) + (VSColor[1] * (1 - outColor.a));
21     outColor.a = 1.0;
22   }
23   else
24     outColor = VSColor[0];
25 }