After Fiddling around I have issues witham pretty sure this is not a pixel shader, myShader issue is mostly that I get nothing draw on the screen.
float4x4 MVP;
// TODO: add effect parameters here.
struct VertexShaderInput
{
float4 Position : POSITION;
float4 normal : NORMAL;
float2 TEXCOORD : TEXCOORD;
};
struct VertexShaderOutput
{
float4 Position : POSITION;
};
VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
input.Position.w = 0;
VertexShaderOutput output;
output.Position = mul(input.Position, MVP);
// TODO: add your vertex shader code here.
return output;
}
float4 PixelShaderFunction(VertexShaderOutput input) : SV_TARGET
{
return float4(1, 0, 0, 1);
}
technique
{
pass
{
Profile = 11.0;
VertexShader = VertexShaderFunction;
PixelShader = PixelShaderFunction;
}
}
I am currently Using it with Matrix.Identity.
Visual Studio Graphics Debug shows me that my vertex shader is actually working, but not the PixelShader. I striped the Shader to the bare minimums so that I was sure the shader was correct.
But why is my screen still black?
I already checked that a few others, and none of the answers solvesolved my issue.
This shows a quad on screen, as it should so the problem is not on my Shader code.
Still I am baffled, I am doing this using another call <GeometricPrimitive.Draw> which if I use the default BasicEffect class renders fine but if I use mine it doesnt show anything:
var a = new VertexPositionNormalTexture[4];
VertexPositionNormalTexture[] QuadsVertices = new VertexPositionNormalTexture[]
a[0] = new VertexPositionNormalTexture(new Vector3(0), new Vector3(0),{
new Vector2(0));
a[1] = new VertexPositionNormalTexture(new Vector3(-1, 0, 1), new Vector3(0), Vector3.Zero,new Vector2(0, 0));,
a[2] = new VertexPositionNormalTexture(new Vector3(1, 1, 10), new Vector3(0).Zero, new Vector2(1, 0));,
a[3] = new VertexPositionNormalTexture(new Vector3(-1, 0, -1), new Vector3(0), Vector3.Zero,new Vector2(0, 1));,
int[] index = new[] {0new VertexPositionNormalTexture(new Vector3(1, -1, 20), 2Vector3.Zero,new 3Vector2(1, 1};)),
var g = new GeometricPrimitive<VertexPositionNormalTexture>(Hyro.RenderDevice, a, index)};
Matrix MVP = Matrix.Identity;
g.Draw(VoxelEffect); //This renders nothing