Original Post
Hi, I'm following the book, "3D Game Engine Programming" but instead of the assembly shaders, I want to implement HLSL shaders. I have used a few tutorials to set them up and am using a basic position HLSL shader from RenderMonkey. Here are the vertex and pixel shaders: When I run the program, the shaders compile fine and there are no complaints creating the shaders. However, I don't see any shapes ( I should see a box ). I have found that when rendering POINTS rather than SOLID, I can see one red point in the centre of the screen. As the pixel shader is set to change any input to red, I know the pixel shader is working. Perhaps there is something wrong with the way the vertices are sent to the shader? I think I am setting the matViewProjection correctly too. As I really have no idea where the problem is I can't post any more code. Just ask if you need to see more though. Help is much appreciated. All the best, Hugh Osborne
float4x4 matViewProjection;
struct VS_INPUT
{
float4 Position : POSITION0;
};
struct VS_OUTPUT
{
float4 Position : POSITION0;
};
VS_OUTPUT vs_main( VS_INPUT Input )
{
VS_OUTPUT Output;
Output.Position = mul( matViewProjection, Input.Position );
return( Output );
}
float4 ps_main() : COLOR0
{
return( float4( 1.0f, 0.0f, 0.0f, 1.0f ) );
}