   Failed to create shader on this device
  hey guysi go this error in debug runtime while trying to create an FX file that uses Displacement Mapping and sampling of textures in the vertex shaders using tex2Dlod().I know that this technique can't be used on shaders below 3.0 but my hardware does support 3.0 shaders. So, is there a way that this error could have happened because of a different reason??here is the FX filestruct DirLight{float4 Diff;float4 Amb;float4 Spec;float3 DirW;};struct Mtrl{float4 Diff;float4 Amb;float4 Spec;float SpecPower;};//------------------------------------//Stuff for the 3D Objectsuniform extern float4x4 gMatWVP;uniform extern float4x4 gMatW;uniform extern float4x4 gMatInvW;uniform extern texture  gCubeTex;uniform extern texture  gNormMap0;uniform extern texturegNormMap1;uniform extern texturegDispMap0;uniform extern texturegDispMap1;uniform extern float3   gEyePosW;uniform extern DirLightgDirLight;uniform extern MtrlgMtrl;//Offsetsuniform extern float2gDMapOffset0;uniform extern float2gDMapOffset1;uniform extern float2gNMapOffset0;uniform extern float2gNMapOffset1;//Stepuniform extern floatgStepSize;//Scaleuniform extern float2gScaleHeight;//------------------------------------sampler sCubeTex = sampler_state{Texture = <gCubeTex>;MinFilter = LINEAR;MagFilter = LINEAR;MipFilter = LINEAR;AddressU = WRAP;AddressV = WRAP;};sampler sNormMap0 = sampler_state{Texture = <gNormMap0>;MinFilter = Anisotropic;MaxAnisotropy = 12;MagFilter = LINEAR;MipFilter = LINEAR;AddressU = WRAP;AddressV = WRAP;};sampler sNormMap1 = sampler_state{Texture = <gNormMap1>;MinFilter = Anisotropic;MaxAnisotropy = 12;MagFilter = LINEAR;MipFilter = LINEAR;AddressU = WRAP;AddressV = WRAP;};sampler sDispMap0 = sampler_state{Texture = <gDispMap0>;MinFilter = POINT;MagFilter = POINT;MipFilter = POINT;AddressU  = WRAP;AddressV  = WRAP;};sampler sDispMap1 = sampler_state{Texture = <gDispMap1>;MinFilter = POINT;MagFilter = POINT;MipFilter = POINT;AddressU  = WRAP;AddressV  = WRAP;};static const float gRef = 1.0f;static const float MAPSIZE = 128.0f;static const float MAPSIZE_DX = 1.0f/MAPSIZE;struct vOut {    float4 PosH  : POSITION0;float3 EyeVecT  : TEXCOORD0;float3 LightDirT : TEXCOORD1;float2 TexC0   : TEXCOORD2;float2 TexC1 : TEXCOORD3;float3x3 MatTBN : TEXCOORD4;};//------------------------------------float GetDispMap(float2 Tex0, float2 Tex1){float2 TexelPos = Tex0*MAPSIZE_DX;float2 lerps = frac(TexelPos);float c0 = tex2Dlod(sDispMap0, float4(Tex0,0.0f,0.0f)).r;float c1 = tex2Dlod(sDispMap0, float4(Tex0,0.0f,0.0f)+float4(MAPSIZE_DX,0.0f,0.0f,0.0f)).r;float c2 = tex2Dlod(sDispMap0, float4(Tex0,0.0f,0.0f)+float4(0.0f,MAPSIZE_DX,0.0f,0.0f)).r;float c3 = tex2Dlod(sDispMap0, float4(Tex0,0.0f,0.0f)+float4(MAPSIZE_DX,MAPSIZE_DX,0.0f,0.0f)).r;float h0 = lerp(lerp(c0,c1,lerps.x),lerp(c2,c3,lerps.x),lerps.y);TexelPos = Tex1*MAPSIZE_DX;lerps = frac(TexelPos);c0 = tex2Dlod(sDispMap1, float4(Tex1,0.0f,0.0f)).r;c1 = tex2Dlod(sDispMap1, float4(Tex1,0.0f,0.0f)+float4(MAPSIZE_DX,0.0f,0.0f,0.0f)).r;c2 = tex2Dlod(sDispMap1, float4(Tex1,0.0f,0.0f)+float4(0.0f,MAPSIZE_DX,0.0f,0.0f)).r;c3 = tex2Dlod(sDispMap1, float4(Tex1,0.0f,0.0f)+float4(MAPSIZE_DX,MAPSIZE_DX,0.0f,0.0f)).r;float h1 = lerp(lerp(c0,c1,lerps.x),lerp(c2,c3,lerps.x),lerps.y);return gScaleHeight.x*h0 + gScaleHeight.y*h1;}vOut VShader(float3 PosL: POSITION0    , float2 NormalizedTexC : TEXCOORD0    , float2 ScaledTexC: TEXCOORD1){    vOut V = (vOut)0;    V.PosH  = mul(float4(PosL, 1.0f), gMatWVP);    float2 Tex0 = NormalizedTexC + gDMapOffset0;    float2 Tex1 = NormalizedTexC + gDMapOffset1;    PosL.y = GetDispMap(Tex0, Tex1);    float d = GetDispMap(Tex0+float2(MAPSIZE_DX,0.0f),    Tex1+float2(0.0f,MAPSIZE_DX));    float3 Tangent = normalize(float3(1.0f, (d-PosL.y)/gStepSize, 0.0f));    float3 Binormal= normalize(float3(0.0f, (d-PosL.y)/gStepSize, -1.0f));    float3 Normal = cross(Tangent,Binormal);  V.MatTBN[0] = Tangent;  V.MatTBN[1] = Binormal;  V.MatTBN[2] = Normal;float3x3 InvMatTBN = transpose(V.MatTBN);float3 EyePosL = mul(float4(gEyePosW, 1.0f), gMatInvW);float3 EyeVecL = EyePosL - PosL;V.EyeVecT = mul(EyeVecL, InvMatTBN);float3 LightDirL = mul(float4(gDirLight.DirW, 0.0f), gMatInvW);V.LightDirT = mul(LightDirL, InvMatTBN);V.TexC0 = ScaledTexC + gNMapOffset0;V.TexC1 = ScaledTexC + gNMapOffset1;    return V;}float4 PShader(float3 EyeVecT: TEXCOORD0 , float3 LightDirT : TEXCOORD1 , float2 TexC0  : TEXCOORD2 , float2 TexC1: TEXCOORD3 , float3x3 MatTBN: TEXCOORD4) : COLOR{EyeVecT   = normalize(EyeVecT);LightDirT = normalize(LightDirT);float3 LightVecT = -LightDirT;float3 Norm0 = tex2D(sNormMap0, TexC0);float3 Norm1 = tex2D(sNormMap1, TexC1);Norm0 = 2.0f*Norm0 - 1.0f;Norm1 = 2.0f*Norm1 - 1.0f;float3 NormT = normalize(0.5f*(Norm0+Norm1));float3 RefLightVecT = reflect(-LightVecT, NormT);float d = max(dot(NormT, LightVecT), 0.0f);float s = pow(max(dot(EyeVecT, RefLightVecT), 0.0f), gMtrl.SpecPower);float3 RefEyeVecT = reflect(-EyeVecT, NormT);float3 RefEyeVecL = mul(RefEyeVecT, MatTBN);float3 RefEyeVecW = mul(float4(RefEyeVecL, 0.0f), gMatW);float3 CubeTexColor = texCUBE(sCubeTex, RefEyeVecW);float3 DiffMtrl = gRef*CubeTexColor + (1.0f - gRef) * (gMtrl.Diff);float3 AmbMtrl  = gRef*CubeTexColor + (1.0f - gRef) * (gMtrl.Amb);if(d <= 0.0f)s = 0.0f;float3 Diff = d * (DiffMtrl    * gDirLight.Diff.rgb);float3 Amb=  (AmbMtrl* gDirLight.Amb.rgb);float3 Spec = s * (gMtrl.Spec    * gDirLight.Spec).rgb;float3 FinalColor = Diff + Amb + Spec;return float4(FinalColor, gMtrl.Diff.a);}//-----------------------------------technique DefTech{    pass p0{VertexShader = compile vs_3_0 VShader();PixelShader = compile ps_3_0 PShader();    }}Thanks for the help, guys   
  What was the output in the debug window from the compilation error?  You could also try compiling the shader with the FXC.exe tool, which will give you a more detailed error message.   ;What was the output in the debug window from the compilation error?  You could also try compiling the shader with the FXC.exe tool, which will give you a more detailed error message.the error is the title of the thread ID3DXEffect (WARN): Failed to create shader on this deviceI don't really know how to use FXC.exe but i compiled it with Nvidia's FX Composer and it said that my hardware doesn't support Shader 3.0 which is not true   ;  Maybe # of instructions and/or # of registers exceed the limit for sm3.hth.-R   