私は directX よりも XNA の経験が豊富ですが、原則は同じです。
法線マップが必要です。これにより、特定のポイントでのサーフェス法線が正確にシェーダーに伝えられます。次に、クワッドをテクスチャ マップする必要があります (おそらく既にマップされているので、これは実際には余分な作業ではありません)。次に、ピクセル シェーダーでクワッドを描画し、シェーダー内で次のようにします。
//This shader only handles one directional light, there are various tecnhiques for handling multiple lights.
float3 LightDirection;
//Normal map, set this before rendering the quad
Texture NormalMap;
//sampler
sampler normalSampler = sampler_state
{
texture = <NormalMap>;
}
//Diffusemap, set this before rendering the quad. This is just your normal texture you want applied to the quad
Texture DiffuseMap;
//sampler
sampler diffuseSampler = sampler_state
{
texture = <DiffuseMap>;
}
/* you probably need a vertex shader to run all your translations etc, that's pretty bog standard stuff so I won't include one here */
float4 PixelShader(float2 texCoord : TEXCOORD0) : COLOR0
{
//standard directional lighting equation with normals
float3 Normal = tex2D(normalSampler, texCoord);
float dot = dot(LightDirection, Normal);
return tex2D(normalSampler, texCoord) * dot;
}