Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualN1ghtDr34m3r

Posted 06 September 2012 - 06:05 AM

Thank you for answering.

I solved the problem, namely that in CompileShaderFromFile() the tutorial says ps_1_1.
On MSDN I couldn't find PixelShader version 1.1 for DirectX9. Possible values are from 2.0 and higher.
So I changed it to ps_2_0 and now it works.


Okay.

Found a list of which directX version handles which shaderversion.
So I've updated both CompileShaderFromFile() to vs_3_0 & ps_3_0, to handle DirectX 9.0c Shader. =)

Anyway thanks.

#3N1ghtDr34m3r

Posted 06 September 2012 - 05:15 AM

Thank you for answering.

I solved the problem, namely that in CompileShaderFromFile() the tutorial says ps_1_1.
On MSDN I couldn't find PixelShader version 1.1 for DirectX9. Possible values are from 2.0 and higher.
So I changed it to ps_2_0 and now it works.

Now my question is, where I could see, in what version my selfwritten shader is?

#2N1ghtDr34m3r

Posted 06 September 2012 - 04:39 AM

Thank you for answering.
The problem is, that the error comes by CompileShaderFromFile. And this is my HRESULT.

#1N1ghtDr34m3r

Posted 06 September 2012 - 04:36 AM

Thank you for this helpful answer.
I do so, but now the problem is, that none of these errors is one of my. Posted Image
I change the code to:
result = D3DXCompileShaderFromFile("./data/pixel.psh",
		  NULL,
		  NULL,
		  "ps_main",
		  "ps_1_1",
		  0,
		  &tempBuffer,
		  NULL,
		  NULL);
if(FAILED(result))
{
  switch(result)
  {
  case D3DERR_INVALIDCALL:
   MessageBox(NULL, "Invalid PixelShader Code: D3DERR_INVALIDCALL", "Error", MB_ICONERROR|MB_OK);
   break;
  case D3DERR_OUTOFVIDEOMEMORY:
   MessageBox(NULL, "Invalid PixelShader Code: D3DERR_OUTOFVIDEOMEMORY", "Error", MB_ICONERROR|MB_OK);
   break;
  case E_OUTOFMEMORY:
   MessageBox(NULL, "Invalid PixelShader Code: E_OUTOFMEMORY", "Error", MB_ICONERROR|MB_OK);
   break;
  default: MessageBox(NULL, "Invalid PixelShader Code", "Error", MB_ICONERROR|MB_OK);
  }
}
d3d9Device->CreatePixelShader((DWORD*)tempBuffer->GetBufferPointer(), &pixelShader);
Now I got the default error message. Posted Image

PARTNERS