/usr/share/libwildmagic/Data/CgShaders/MaterialTexture.fx is in libwildmagic-common 5.13-1ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 32 33 34 35 36 37 38 39 40 41 42 43 44 | // The application can changes these parameters at run time.
sampler2D BaseSampler = sampler_state
{
MinFilter = Nearest;
MagFilter = Nearest;
WrapS = Clamp;
WrapT = Clamp;
};
void v_MaterialTexture
(
in float3 modelPosition : POSITION,
in float2 modelTCoord : TEXCOORD0,
out float4 clipPosition : POSITION,
out float4 vertexColor : COLOR,
out float2 vertexTCoord : TEXCOORD0,
uniform float4x4 PVWMatrix,
uniform float4 MaterialDiffuse)
{
// Transform the position from model space to clip space.
clipPosition = mul(PVWMatrix, float4(modelPosition,1.0f));
// Pass through the material diffuse color.
vertexColor = MaterialDiffuse;
// Pass through the texture coordinate.
vertexTCoord = modelTCoord;
}
void p_MaterialTexture
(
in float4 vertexColor : COLOR,
in float2 vertexTCoord : TEXCOORD0,
out float4 pixelColor : COLOR
)
{
// Add the material and texture colors.
float4 baseColor = tex2D(BaseSampler, vertexTCoord);
pixelColor.rgb = saturate(baseColor.rgb + vertexColor.rgb);
// Multiply the material and texture alphas.
pixelColor.a = baseColor.a*vertexColor.a;
}
|