   What is wrong with this fx file?
  I'm new to programming shaders in  HLSL. Originally I had this shader doing normal mapping, but I want to do a diffuse texture on the object. If your not sure how diffuse works but can see the error with the code i'd be really happy just to know the syntax error if there is one, because I can't find it. here is the code: (if you need more information then what i've provided please let me know, any help would be appreciated. thx :D/*Normal mapping shaderThis shader performs a per-pixel dot3 bump mapping lighting effect with only the diffuse light component calculated.*/// global matricesuniform extern float4x4 g_matWVP;uniform extern float4x4 g_matWI;// light direction in world spaceuniform extern float3 g_lightDir;// texturesuniform extern texture g_texture;uniform extern texture g_normalMap;// colour texturesampler sampTexture = sampler_state{Texture = <g_texture>;MinFilter = LINEAR;MagFilter = LINEAR;MipFilter = LINEAR;AddressU  = WRAP;    AddressV  = WRAP;};// normal texturesampler sampNormalMap = sampler_state{Texture = <g_normalMap>;MinFilter = LINEAR;MagFilter = LINEAR;MipFilter = LINEAR;AddressU  = WRAP;    AddressV  = WRAP;};// vertex shader input that allows position and texture coordinates as well as TBNstruct VSInput{float3 pos: POSITION0;float3 tan: TANGENT0;float3 bin: BINORMAL0;float3 nor: NORMAL0;float2 tex: TEXCOORD0;};// vertex shader outputstruct VSOutput{float4 pos: POSITION0;float3 lightDir: TEXCOORD0;float2 tex: TEXCOORD1;};// normal mapping vertex shaderVSOutput VS_NormalMapping(VSInput a_Input){VSOutput output;// calculate homogenous positionoutput.pos = mul(float4(a_Input.pos, 1.0f), g_matWVP);// copy texture coordinates acrossoutput.tex = a_Input.tex;// calculate matrix to tangent spacefloat3x3 toTangentSpace = transpose(float3x3(a_Input.tan, a_Input.bin, a_Input.nor));// calculate light's direction relative to tangent spacefloat3 lightDirL = mul(float4(g_lightDir, 0.0f), g_matWI).xyz;output.lightDir = mul(lightDirL, toTangentSpace);return output;}VSOutput VS_DiffuseTexture(VSInput a_input){VSOutput output;//in VS i believe i only need to calculate the vertex's normal since in the other pass the other vertex calulation is doneoutput.nor = mul(float4(a_input.nor,0.0f),g_matWI).xyz;return output;}// normal mapping pixel shaderfloat4 PS_NormalMapping(VSOutput a_Input) : COLOR{// index into texturesfloat4 colour = tex2D(sampTexture, a_Input.tex);float3 normal = tex2D(sampNormalMap, a_Input.tex);// convert normal from (0 - 1) to (-1 - 1)normal = (normal - 0.5f) * 2.0f;// normalize light directionfloat3 light = normalize(a_Input.lightDir);// calculate diffuse componentfloat diffuse = max(dot(normal, light), 0.0f);// return texture colour modified by diffuse componentreturn (colour * diffuse);}float4 PS_DiffuseTexture(VSOutput a_Input): COLOR{//diffuse propertiesfloat3 dLightColor = {0.8,0.8,0.8};float3 dMaterialColor = {0.7,0.6,0.5};//make diffuse intensity matrixfloat3 dIntensity = mul(dLightColor,dMaterialColor);float dVariable = max(dot(g_lightDir,a_Input.nor),0.0f);float3 diffuse = dVariable * dIntensity;return float4(diffuse,a_Input.a);}technique NormalMappingTech{pass P0{vertexShader = compile vs_2_0 VS_NormalMapping();pixelShader = compile ps_2_0 PS_NormalMapping();}pass P1{vertexShader = compile vs_2_0 VS_DiffuseTexture();pixelShader = compile ps_2_0 PS_DiffuseTexture();}}   
  its this lineoutput.nor = mul(float4(a_input.nor,0.0f),g_matWI).xyz;it's because you haven't declared any VSOutput.nor yet.which is in "struct VSOutput"   ;  Yes, your VSOutput struct doesn't have a .nor member. Also, note that on these forums you should enclose large blocks of code in [ source ] [ /source ] tags.   