blob: e9b3e90a42bf507f2d6606acaa79d31256af1b14 (
plain) (
blame)
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
29
30
31
|
#include <phong_lighting.cg>
#include <fragment_entry.cg>
DECLARE_TEXTURE(diffuseTexture)
BEGIN_CBUFFER(cbDiffuse)
CONST_TYPE float4 diffuseColor;
END_CBUFFER(cbDiffuse)
SurfaceMaterial computeSurfaceMaterial(const FragmentParameters params)
{
SurfaceMaterial mout;
#if defined(PX_X360) && defined(RENDERER_FRAGMENT)
half4 diffuseTextureColor = tex2D(diffuseTexture, float2(params.spriteTexCoord.x, params.spriteTexCoord.y));
#else
#if defined (RENDERER_GXM)
half4 diffuseTextureColor = (half4)tex2D(diffuseTexture, float2(params.spriteTexCoord.x, params.spriteTexCoord.y));
#else
half4 diffuseTextureColor = (half4)tex2D(diffuseTexture, float2(params.texcoord0.x, params.texcoord0.y));
#endif
#endif
mout.alpha = half(diffuseTextureColor.a * diffuseColor.a * params.color.a);
mout.diffuseColor = half3(diffuseTextureColor.rgb * diffuseColor.rgb);
mout.emissiveColor = 0;
mout.specularColor = half3(1,1,1);
mout.specularPower = 0;
mout.tangentSpaceNormal = half3(0,0,1);
return mout;
}
|