#include <transform>
#include <fog>
#include <pos>
#include <normal>
#include <light>
#include <color>
#define DXLIGHTING
#define DXFOG
struct vertexOut
{
float4 Pos : POSITION;
float Fog : FOG;
float4 Color : COLOR0;
float2 Tex : TEXCOORD0;
float2 LM : TEXCOORD1;
};
vertexOut solid_VS (
in float4 inPos : POSITION,
in float3 inNormal : NORMAL,
in float2 inTex : TEXCOORD0,
in float2 inLM : TEXCOORD1
)
{
vertexOut Out;
Out.Pos = DoTransform(inPos);
Out.Pos *= inPos.w / length(mul(inPos, matWorldViewProj));
Out.Tex = inTex;
Out.LM = inLM;
Out.Fog = DoFog(inPos);
float3 P = DoPos(inPos);
float3 N = DoNormal(inNormal);
float3 Color = 0;
for (int i = 0; i < 8; i++) // add 8 dynamic lights
{
Color += DoLight(P, N, i);
}
Out.Color = 0.5 * DoAmbient() + 0.5 * float4(Color, 1) * vecDiffuse;
return Out;
}
technique solid
{
pass one
{
CullMode = None;
ZWriteEnable = True;
AlphaBlendEnable = False;
AlphaTestEnable = False;
VertexShader = compile vs_2_0 solid_VS();
}
}
technique fallback { pass one { } }