aboutsummaryrefslogtreecommitdiff
path: root/APEX_1.4/media/SampleRenderer/4/shaders/fragment/simple_diffuse_alpha.cg
blob: e89b659967ae8b908e3fd97d73f0d53ec1cbaf92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <phong_lighting.cg>
#include <fragment_entry.cg>

DECLARE_TEXTURE(diffuseTexture)

SurfaceMaterial computeSurfaceMaterial(const FragmentParameters params)
{
	half4 diffuseTextureColor = (half4)tex2D(diffuseTexture, params.texcoord0.xy);

	SurfaceMaterial mout;
	mout.diffuseColor       = diffuseTextureColor.rgb*params.color.rgb;
	mout.alpha              = diffuseTextureColor.a  *params.color.a;
	mout.emissiveColor      = 0;
	mout.specularColor      = half3(1,1,1); // TODO: make this a constant parameter set by the material.
	mout.specularPower      = 16;
	mout.tangentSpaceNormal = half3(0,0,1);
	return mout;
}