SlimDX Direct3D9.Sprite,Draw + shader

Started by
2 comments, last by LotusExigeS1 13 years, 6 months ago
Hello, I am trying to use an effect with sprite.draw but its not having any effect on the results.

I believe you are supposed to just do effect.begin, effect.beginpass, spritebatch.begin, draw and then end everything. But it has no effect.

The shader loads ok and looks like this (for testing) -

float4 ps1() : COLOR
{
return float4(1,1,1,1);
}

technique main
{
pass P0
{
VertexShader = null;
PixelShader = compile ps_3_0 ps1();
ZEnable = false;
}
}

Any help is very much appreciated.

Advertisement
I don't know that you can ignore the vertex shader for a pixel shader 3.0 target. I'd try writing a vertex shader and see if that fixes the problem. Also check the debug output to see if Direct3D is giving you warnings about anything.
Mike Popoloski | Journal | SlimDX
Thanks for the fast response. I have just tried a ps2_0 version with a vertex shader and its no different. Also no errors are being thrown or reported.

Any other ideas ?
interestingly if I use cDevice.PixelShader = ps insteads of trying to use the effect file it works. Is that a bug or am I doing something wrong ?

This topic is closed to new replies.

Advertisement