Original Post
I want implement a effect in my program in my code must read shader file in my shader file have 2 extern matrix variable in my program this is my code: ID3DXConstantTable* OutlineConstTable; ID3DXBuffer* outlineCompiledCode = 0; ID3DXBuffer* outlineErrorBuffer = 0; hr = D3DXCompileShaderFromFile( shaderfile, 0, 0, "Main", "vs_1_1", D3DXSHADER_DEBUG, &outlineCompiledCode, &outlineErrorBuffer, &OutlineConstTable); if(outlineErrorBuffer) { MessageBox(0,(char*)outlineErrorBuffer->GetBufferPointer(),0,0); SAFE_RELEASE(outlineErrorBuffer); } if(FAILED(hr)) { MessageBox(0,"D3DXCompileShaderFromFile() - FAILED",0,0); return false; } hr = pd3dDevice->CreateVertexShader( (DWORD*)outlineCompiledCode->GetBufferPointer(), &OutlineShader); if(FAILED(hr)) { MessageBox(0,"CreateVertexShader - FAILED",0,0); return false; } OutlineWorldViewHandle = OutlineConstTable->GetConstantByName(0,"WorldViewMatrix"); OutlineProjHandle = OutlineConstTable->GetConstantByName(0,"ProjMatrix"); OutlineConstTable->SetDefaults(pd3dDevice); SAFE_RELEASE(outlineCompiledCode); but I found OutlineWorldViewHandle variable can't Get constant worldviewmatrix varible in shader file this is my shader file code: extern matrix WorldViewMatrix; extern matrix ProjMatrix;