shaderExplodeSmoothVolumes.frag 408 Bytes
Newer Older
1
// ShaderExplodeSmoothVolumes::fragmentShaderText
Sylvain Thery's avatar
Sylvain Thery committed
2
3
4
5

uniform vec4 ambient;
uniform vec4 backColor;

6
7
VARYING_FRAG vec3 normalFS;
VARYING_FRAG vec3 lightFS;
Sylvain Thery's avatar
Sylvain Thery committed
8
9
10
VARYING_FRAG vec3 colorVert;


11
12
void main()
{
Sylvain Thery's avatar
Sylvain Thery committed
13
14
15
16
17
18
	float lambertTerm = dot(normalize(normalFS),normalize(lightFS));
	if (lambertTerm > 0.0)
		gl_FragColor = ambient + vec4(colorVert*lambertTerm, 1.0);
	else
		gl_FragColor = ambient - backColor*lambertTerm;

19
}