Code: Select all
struct fragment
{
float4 position : POSITION;
float4 color0 : COLOR0;
float2 texcoord0 : TEXCOORD0;
};
struct pixel
{
float4 color : COLOR;
};
//-----------------------------------------------------------------------------
pixel main( fragment IN,
uniform sampler2D testTexture,
uniform sampler2D checkerTexture )
{
pixel OUT;
float4 texelColor0 = tex2D( testTexture, IN.texcoord0 );
float4 texelColor1 = tex2D( checkerTexture, IN.texcoord0 );
OUT.color = (1-IN.color0.a) * texelColor0 + IN.color0.a *texelColor1;
return OUT;
}
Code: Select all
fragment_program adam/terrain cg
{
source adam.cg
entry_point main
profiles ps_1_1 arbfp1 fp20
}
material adam
{
technique
{
pass
{
// Fragment program
fragment_program_ref adam/terrain
{
}
texture_unit
{
texture checker.bmp
}
texture_unit
{
texture test.bmp
}
}
}
}
