share/hedgewars/Data/Shaders/default.fs
changeset 12886 a089326f0e16
parent 12879 286e170f4f6b
child 15293 042a5e8d9c59
equal deleted inserted replaced
12885:dab60d247b75 12886:a089326f0e16
     2 precision mediump float;
     2 precision mediump float;
     3 #endif
     3 #endif
     4 
     4 
     5 uniform sampler2D tex0;
     5 uniform sampler2D tex0;
     6 uniform vec4 tint;
     6 uniform vec4 tint;
       
     7 uniform bool tintAdd;
     7 uniform bool enableTexture;
     8 uniform bool enableTexture;
     8 
     9 
     9 varying vec2 tex;
    10 varying vec2 tex;
    10 
    11 
    11 
    12 
    12 void main()
    13 void main()
    13 {
    14 {
    14     if(enableTexture){
    15     if(enableTexture){
    15         gl_FragColor = texture2D(tex0, tex) * tint;
    16         if (tintAdd){
       
    17             tint.a = 0.0;
       
    18             gl_FragColor = clamp(texture2D(tex0, tex) + tint, 0.0, 1.1);
       
    19         }else{
       
    20             gl_FragColor = texture2D(tex0, tex) * tint;
       
    21         }
    16     }else{
    22     }else{
    17         gl_FragColor = tint;
    23         gl_FragColor = tint;
    18     }
    24     }
    19 }
    25 }