shaderFlat.frag 352 Bytes
Newer Older
1
// ShaderFlat::fragmentShaderText
Sylvain Thery's avatar
Sylvain Thery committed
2 3 4
uniform vec4 diffuse;
uniform vec4 diffuseBack;
uniform vec4 ambient;
5 6
uniform bool doubleSided;

Sylvain Thery's avatar
Sylvain Thery committed
7
VARYING_FRAG float lambertTerm;
Kenneth Vanhoey's avatar
Kenneth Vanhoey committed
8
FRAG_OUT_DEF;
9

10 11
void main()
{
12 13 14
	if (gl_FrontFacing)
		FRAG_OUT = ambient + lambertTerm*diffuse;
	else
15 16 17
	{
		if (!doubleSided)
			discard;
18
		FRAG_OUT = ambient - lambertTerm*diffuseBack;
19 20
	}

21
}