summaryrefslogtreecommitdiffhomepage
path: root/src/shaders/simple.fragment.sc
blob: ab72ae46014100978c325de72daeb43d01326e5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$input v_color0, v_texcoord0, v_texcoord1

#include <bgfx_shader.sh>

SAMPLER2D(default_texture, 0);
SAMPLER2D(texture_0, 1);

//vec3 toLinear(vec3 _rgb)
//{
//	return pow(abs(_rgb), vec3_splat(2.2) );
//}
//
//vec4 toLinear(vec4 _rgba)
//{
//	return vec4(toLinear(_rgba.xyz), _rgba.w);
//}

void main()
{
  if(v_texcoord1 == 1.0)
  { 
    gl_FragColor = v_color0 * texture2D(texture_0, v_texcoord0.xy);
  } 
  else
  { 
    gl_FragColor = v_color0 * texture2D(default_texture, v_texcoord0.xy);
  } 
}