Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMuzzy A

Posted 22 September 2012 - 03:28 PM

Hello, I'm starting to learn how to use DirectX 11. Everything is going fine so far i think. But, I cannot get it to compile my pixel shader for some reason. I'm following the tutorial on DirectXTutorials.com

// I'm just trying to return the color orange, and that's it
/* shader.fx */
float4 VShader(float4 position : POSITION) : SV_POSITION
{
	return position;
}

float4 PShader(float4 position : SV_POSITION) : SV_TARGET
{
	return float4(1,.5f,0,1);
}

// In C++
ID3D10Blob *pVShader = nullptr;
ID3D10Blob *pPShader = nullptr;
D3DX11CompileFromFileA("shader.fx",0,0,"VShader","vs_5_0",0,0,0,&pVShader,0,0);
D3DX11CompileFromFileA("shader.fx",0,0,"PShader","vs_5_0",0,0,0,&pPShader,0,0);

// pPShader returns NULL here and I have no clue why

any ideas?

#1Muzzy A

Posted 22 September 2012 - 03:27 PM

Hello, I'm starting to learn how to use DirectX 11. Everything is going fine so far i think. But, I cannot get it to compile my pixel shader for some reason. I'm following the tutorial on DirectXTutorials.com

// I'm just trying to return the color orange, and that's it
/* shader.fx */
float4 VShader(float4 position : POSITION) : SV_POSITION
{
    VOut output;
    output.position = position;
    return output;
}

float4 PShader(float4 position : SV_POSITION) : SV_TARGET
{
    return float4(1,.5f,0,1);
}

// In C++
ID3D10Blob *pVShader = nullptr;
ID3D10Blob *pPShader = nullptr;
D3DX11CompileFromFileA("shader.fx",0,0,"VShader","vs_5_0",0,0,0,&pVShader,0,0);
D3DX11CompileFromFileA("shader.fx",0,0,"PShader","vs_5_0",0,0,0,&pPShader,0,0);

// pPShader returns NULL here and I have no clue why

any ideas?

PARTNERS